[smokeping-users] Zooming bug in 2.3.3?

Tobias Oetiker tobi at oetiker.ch
Thu Mar 13 15:48:59 CET 2008


Hi Bernard,

try this:

Index: Smokeping.pm
===================================================================
--- Smokeping.pm        (revision 947)
+++ Smokeping.pm        (working copy)
@@ -939,8 +939,10 @@
        /^(\d+)$/ && do { my $value = $1; $value = time if $value > 2**32; return $value};
         /^\s*(\d{4})-(\d{1,2})-(\d{1,2})(?:\s+(\d{1,2}):(\d{2})(?::(\d{2}))?)?\s*$/  &&
             return POSIX::mktime($6||0,$5||0,$4||0,$3,$2-1,$1-1900,0,0,-1);
-        /([ -:a-z0-9]+)/ && return $1;
+        /^now$/ && return time;
+        /([ -:a-z0-9]+)/ && return $1;
     };
+    return time;
 }

 sub get_detail ($$$$;$){
@@ -1063,6 +1065,8 @@
             $imghref =$cfg->{General}{imgurl}."/__navcache/".$serial;
         }

+       $q->param('epoch_start',parse_datetime($q->param('start')));
+       $q->param('epoch_end',parse_datetime($q->param('end')));
         @tasks = (["Navigator Graph".$name, parse_datetime($q->param('start')),parse_datetime($q->param('end'))]);
         my ($graphret,$xs,$ys) = RRDs::graph
           ("dummy",
@@ -1337,12 +1341,11 @@
 #           $page .= qq|<div class="zoom" style="cursor: crosshair;">|;
            $page .= qq|<IMG id="zoom" BORDER="0" width="$xs{''}" height="$ys{''}" SRC="${imghref}_${end}_${start}.png">| ;
 #           $page .= "</div>";
-
-           $page .= $q->start_form(-method=>'GET', -id=>'range_form')
-              . "<p>Time range: "
-              . $q->hidden(-name=>'epoch_start',-id=>'epoch_start',-default=>$start)
+           $page .= $q->start_form(-method=>'POST', -id=>'range_form')
+              . "<p>Time range: "
+              . $q->hidden(-name=>'epoch_start',-id=>'epoch_start')
               . $q->hidden(-name=>'hierarchy',-id=>'hierarchy')
-              . $q->hidden(-name=>'epoch_end',-id=>'epoch_end',-default=>time())
+              . $q->hidden(-name=>'epoch_end',-id=>'epoch_end')
               . $q->hidden(-name=>'target',-id=>'target' )
               . $q->hidden(-name=>'displaymode',-default=>$mode )
               . $q->textfield(-name=>'start',-default=>$startstr)

cheers
tobi

Tuesday Bernard Li wrote:

> Hi all:
>
> I just updated SmokePing from 2.2.2 to 2.3.3 and noticed that zooming
> is broken with graphs generated using "Time range".
>
> I just tried to re-produce this with the demo at the SmokePing site
> (running 2.3.2) and it's broken there too.  To see what I mean, go to
> this link:
>
> http://oss.oetiker.ch/smokeping-demo/?start=2008-03-05+0%3A01&end=2008-03-05+23%3A59&epoch_start=1205270940&epoch_end=1205284082&target=multi.USA&hierarchy=&displaymode=n&Generate%21=Generate%21
>
> The graph generated is from 2008-03-05 0:01 to 2008-03-05 23:59.
>
> Now try to zoom between 04:00 - 06:00.
>
> It looks like instead of zooming from the graph generated by the time
> range specified, it zoomed the *default* graph with the current time
> (which is the graph you get before you generate the "time range"
> graph).
>
> Hope this makes sense.
>
> Thanks,
>
> Bernard
>
> _______________________________________________
> 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