Commit ddb81de5 by Christian Winther

allow hour, day, week and year time rounding

parent c4219ba0
...@@ -534,12 +534,30 @@ function($, _, moment) { ...@@ -534,12 +534,30 @@ function($, _, moment) {
if (size < 1000) { if (size < 1000) {
return size.toFixed(0) + " ms"; return size.toFixed(0) + " ms";
} }
// Less than 1 min
else if (size < 60000) { else if (size < 60000) {
return (size / 1000).toFixed(decimals) + " s"; return (size / 1000).toFixed(decimals) + " s";
} }
else { // Less than 1 hour, devide in minutes
else if (size < 3600000) {
return (size / 60000).toFixed(decimals) + " min"; return (size / 60000).toFixed(decimals) + " min";
} }
// Less than one day, devide in hours
else if (size < 86400000) {
return (size / 3600000).toFixed(decimals) + " hour";
}
// Less than one week, devide in days
else if (size < 604800000) {
return (size / 86400000).toFixed(decimals) + " day";
}
// Less than one month, devide in weeks
else if (size < 2.62974e9) {
return (size / 604800000).toFixed(decimals) + " week";
}
// Less than one year, devide in weeks
else if (size < 3.15569e10) {
return (size / 2.62974e9).toFixed(decimals) + " year";
}
}; };
kbn.microsFormat = function(size, decimals) { kbn.microsFormat = function(size, decimals) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment