From: petter Date: Thu, 26 Feb 2009 13:36:44 +0000 (+0000) Subject: $delta_time should never be 0, but just in case... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebdaee8fe3073df9b3b8ee2125ab2d35fd9b2877;p=varnish $delta_time should never be 0, but just in case... git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3831 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-tools/webgui/Varnish/Statistics.pm b/varnish-tools/webgui/Varnish/Statistics.pm index 589fddb4..fc6cf78d 100644 --- a/varnish-tools/webgui/Varnish/Statistics.pm +++ b/varnish-tools/webgui/Varnish/Statistics.pm @@ -159,7 +159,12 @@ use Varnish::DB; } } else { - $delta_value = ($value - $last_value) / $delta_time; + if ($delta_time > 0) { + $delta_value = ($value - $last_value) / $delta_time; + } + else { + $delta_value = undef; + } } $last_value = $value;