# {{{ ->create graph method # sub create_graph { my $class = shift; open my $plot => "| /usr/local/bin/gnuplot" or die "Failed to open pipe: $!\n"; my $outfile = "/tmp/graph.png"; print $plot <<" --"; set terminal png color set out "$outfile" set format x "/%b%y/" set xdata time set key left top Left reverse samplen 2 title "Legend" box set timefmt "%s:" set grid xtics ytics set xtics nomirror set ytics nomirror set y3tics nomirror set autoscale set ylabel "ResponseTime" plot "$_[0]" using 1:2 smooth unique axis x1y1 title "Time in ms" -- #set timefmt "%Y-%m-%d:" close $plot or die "Failed to close pipe: $!\n"; chmod 0644 => $outfile or die "Failed to chmod $outfile: $!\n"; } # }}}