3 my $file = shift || "bin/watch-tmp-partition-size.out";
4 open my $fh, $file or die "Could not open '$file': $!";
10 (@t) = /(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})/;
14 $t = timelocal
(reverse @t);
17 ($score) = $1 if m
|\d
+\s
+\d
+\s
+\d
+\s
+(\d
+)\
%\s
+/tmp
|;
18 if ($t && $score && !(++$i % 67)) {
20 if ($t > 1290241849 && $t < 1290249769) {
28 require Chart
::Clicker
;
29 require Chart
::Clicker
::Axis
::DateTime
;
30 require Chart
::Clicker
::Data
::Series
;
31 require Chart
::Clicker
::Data
::DataSet
;
34 my $chart = Chart
::Clicker
->new(width
=> 1200, height
=> 400);
36 # build the series (static here, will usually be supplied arrayrefs from elsewhere)
38 my $series = Chart
::Clicker
::Data
::Series
->new
45 my $dataset = Chart
::Clicker
::Data
::DataSet
->new
47 series
=> [ $series ],
50 # add the dataset to the chart
51 $chart->add_to_datasets($dataset);
52 my $def = $chart->get_context('default');
53 my $dtaxis = Chart
::Clicker
::Axis
::DateTime
->new
55 format
=> '%Y-%m-%d %H:%M',
57 orientation
=> 'horizontal'
59 $def->domain_axis($dtaxis);
60 my $yaxis = Chart
::Clicker
::Axis
->new
64 orientation
=> 'vertical',
65 range
=> Chart
::Clicker
::Data
::Range
->new
71 $def->range_axis($yaxis);
74 $chart->title->text($title);
75 $chart->legend->visible(0);
76 # $chart->title->font->size(20);
78 use Chart
::Clicker
::Renderer
::Point
;
79 my $renderer = Chart
::Clicker
::Renderer
::Point
->new
86 Geometry
::Primitive
::Circle
->new({radius
=> 1})
90 # assign the renderer to the default context
91 $chart->set_renderer($renderer);
93 # write the chart to a file
94 $chart->write_output("watch-tmp-partition-size.png");