| 1 window.swarming=window.swarming||function(){var swarming={};swarming.stableSort=
function(arr,comp){if(!arr||!comp){console.log("missing arguments to stableSort"
,arr,comp);return}arr.forEach(function(e,i){if(e!==undefined&&e!==null){e.__sort
Idx=i}});arr.sort(function(a,b){if(a===undefined||a===null){if(b===undefined||b=
==null){return 0}return 1}if(b===undefined||b===null){return-1}var c=comp(a,b);i
f(c===0){return a.__sortIdx-b.__sortIdx}return c})};swarming.naturalCompare=func
tion(a,b){var ns=a-b;if(ns){return ns}return a.localeCompare(b)};return swarming
}(); | 1 window.swarming=window.swarming||function(){var swarming={};swarming.stableSort=
function(arr,comp){if(!arr||!comp){console.log("missing arguments to stableSort"
,arr,comp);return}arr.forEach(function(e,i){if(e!==undefined&&e!==null){e.__sort
Idx=i}});arr.sort(function(a,b){if(a===undefined||a===null){if(b===undefined||b=
==null){return 0}return 1}if(b===undefined||b===null){return-1}var c=comp(a,b);i
f(c===0){return a.__sortIdx-b.__sortIdx}return c})};swarming.naturalCompare=func
tion(a,b){var ns=a-b;if(!isNaN(ns)){return ns}return a.localeCompare(b)};var TIM
E_DELTAS=[{units:"w",delta:7*24*60*60},{units:"d",delta:24*60*60},{units:"h",del
ta:60*60},{units:"m",delta:60},{units:"s",delta:1}];swarming.diffDate=function(s
,now){var ms=typeof s=="number"?s:Date.parse(s);now=now||Date.now();var diff=(ms
-now)/1e3;if(diff<0){diff=-1*diff}return humanize(diff,TIME_DELTAS)};swarming.KB
=1024;swarming.MB=swarming.KB*1024;swarming.GB=swarming.MB*1024;var BYTES_DELTAS
=[{units:" TB",delta:1024*swarming.GB},{units:" GB",delta:swarming.GB},{units:"
MB",delta:swarming.MB},{units:" KB",delta:swarming.KB},{units:" B",delta:1}];swa
rming.humanBytes=function(b,unit){if(Number.isInteger(unit)){b=b*unit}return hum
anize(b,BYTES_DELTAS)};function humanize(n,deltas){for(var i=0;i<deltas.length-1
;i++){var nextDeltaRounded=Math.round(n/deltas[i+1].delta)*deltas[i+1].delta;if(
nextDeltaRounded/deltas[i].delta>=1){return Math.round(n/deltas[i].delta)+deltas
[i].units}}var i=DELTAS.length-1;return Math.round(n/DELTAS[i].delta)+DELTAS[i].
units}return swarming}(); |