/[Sack]/trunk/lib/Sack/Server/Gnuplot.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Sack/Server/Gnuplot.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 243 by dpavlin, Thu Nov 26 14:46:46 2009 UTC revision 244 by dpavlin, Thu Nov 26 18:48:13 2009 UTC
# Line 6  use strict; Line 6  use strict;
6  use Data::Dump qw(dump);  use Data::Dump qw(dump);
7    
8  sub date {  sub date {
9          my $out = shift;          my ( $out, $param ) = @_;
10    
11          die "out not hash but ", dump($out) unless ref($out) eq 'HASH';          die "out not hash but ", dump($out) unless ref($out) eq 'HASH';
12    
# Line 15  sub date { Line 15  sub date {
15    
16          foreach my $key ( keys %$out ) {          foreach my $key ( keys %$out ) {
17    
18                  next unless $key =~ m{^date,};                  my $title = $key;
19                    $title =~ s{\+$}{};
20                    next unless $title =~ s{^date,}{};
21    
22                    if ( my $filter = $param->{filter} ) {
23                            next unless $title =~ m{$filter};
24                    }
25    
26                  my $path = "/tmp/sack.gnuplot.$key.txt";                  my $path = "/tmp/sack.gnuplot.$key.txt";
27                  open( my $fh, '>', $path ) || die "$path: $!";                  open( my $fh, '>', $path ) || die "$path: $!";
# Line 33  sub date { Line 39  sub date {
39    
40                  warn "data $path ", -s $path, " bytes\n";                  warn "data $path ", -s $path, " bytes\n";
41    
42                  push @plot, qq|"$path" using 1:2 title "$key" with linespoints|;                  push @plot, qq|"$path" using 1:2 title "$title" with linespoints|;
43                  $uid .= $key;                  $uid .= $key;
44          }          }
45    

Legend:
Removed from v.243  
changed lines
  Added in v.244

  ViewVC Help
Powered by ViewVC 1.1.26