[smokeping-users] DNS probe - sqrt error
Tobias Oetiker
tobi at oetiker.ch
Tue Sep 11 08:10:58 CEST 2007
Hi Ken,
I guess we are hitting a rounding error here ...
Index: Smokeping/RRDhelpers.pm
===================================================================
--- Smokeping/RRDhelpers.pm (revision 820)
+++ Smokeping/RRDhelpers.pm (working copy)
@@ -52,7 +52,8 @@
}
}
return undef unless $cnt;
- return sqrt( 1.0 / $cnt * ( $sqsum - $sum**2 / $cnt ))
+ my $sqdev = 1.0 / $cnt * ( $sqsum - $sum**2 / $cnt );
+ return $sqdev < 0.0 ? 0.0 : sqrt($sqdev);
}
or is my stdev math worng ?
cheers
tobi
Yesterday Ken Dreyer wrote:
> When I try to view the webpage for a particular DNS target, I get the
> following error:
>
> Can't take sqrt of -4.62018e-22 at
> /usr/local/smokeping/lib/Smokeping/RRDhelpers.pm line 55.
>
> ...but the problem is intermittent. One target in particular almost
> always gives the error when I view its page. Once it occurred on all
> my DNS targets; and sometimes it doesn't happen on any of them. I'm
> using the normal dig probe:
>
> $ dig -v
> DiG 9.3.4-P1
>
> with a fresh install of smokeping 2.2.2:
>
> /usr/local/smokeping/bin/smokeping --version
> 2.002002
>
> Has anyone else experienced this error?
>
> - Ken
>
> _______________________________________________
> smokeping-users mailing list
> smokeping-users at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/smokeping-users
>
>
--
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten
http://it.oetiker.ch tobi at oetiker.ch ++41 62 213 9902
More information about the smokeping-users
mailing list