]> err.no Git - varnish/commitdiff
$delta_time should never be 0, but just in case...
authorpetter <petter@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 26 Feb 2009 13:36:44 +0000 (13:36 +0000)
committerpetter <petter@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 26 Feb 2009 13:36:44 +0000 (13:36 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3831 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-tools/webgui/Varnish/Statistics.pm

index 589fddb433fd12151ad1418b4297e07df3f98659..fc6cf78d059467616fb25418119ee3fcf6799818 100644 (file)
@@ -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;