Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

dynamic timeframe

  • Loading branch information...
commit 5374e8efa6e2d630f0c36490077378f17390aa47 1 parent e58431e
@doertehasselberg doertehasselberg authored
Showing with 13 additions and 3 deletions.
  1. +13 −3 public/js/main.js
View
16 public/js/main.js
@@ -25,12 +25,11 @@ var Healthety = function(){
setInterval(function(){
// clean up values
for(var name in lines){
- // ((new Date()).getTime()-300000)
+ var threshold = getThreshold(json.name);
for(var host in lines[name]){
for(var value in lines[name][host]['data']){
- var ref = ((new Date()).getTime()-300000);
if(
- lines[name][host]['data'][value][0] < ref
+ lines[name][host]['data'][value][0] < threshold
){
lines[name][host]['data'].shift();
}
@@ -132,6 +131,17 @@ var Healthety = function(){
return colors[hosts.indexOf(hostname)];
}
+ function getThreshold(hostname){
+ var custom = $(document).getUrlParam(hostname+'_thres');
+ var threshold;
+ if(custom == null){
+ threshold = 300000;
+ } else {
+ threshold = parseInt($(document).getUrlParam(hostname+'_thres')) * 60*1000;
+ }
+ return (new Date()).getTime() - threshold;
+ }
+
return minime;
}
Please sign in to comment.
Something went wrong with that request. Please try again.