Ticket #881: more-graphperiod-substitutions-1.4.3.patch

File more-graphperiod-substitutions-1.4.3.patch, 0.9 kB (added by stavros, 2 years ago)
  • /usr/lib/perl5/vendor_perl/5.8.8/Munin/Master/GraphOld.pm

    old new  
    280280sub get_title { 
    281281    my $service = shift; 
    282282    my $scale   = shift; 
    283  
    284     return (munin_get($service, "graph_title", $service) . " - by $scale"); 
     283    my $res     = munin_get($service, "graph_title", $service) . " - by $scale"; 
     284    my $period  = munin_get($service, "graph_period", "second"); 
     285    $res =~ s/\$\{graph_period\}/$period/g; 
     286    return $res; 
    285287} 
    286288 
    287289sub get_custom_graph_args { 
     
    856858        $field_count++; 
    857859 
    858860        my $tmplabel = munin_get($field, "label", $fname); 
     861        my $period  = munin_get($service, "graph_period", "second"); 
     862        $tmplabel =~ s/\$\{graph_period\}/$period/g; 
    859863 
    860864        push(@rrd, 
    861865                  $fielddraw