+sub output_graph_email_count
+{
+ my @inst = @_;
+ my @ret = ();
+
+ my $c = scalar @inst;
+
+ my @colors = get_n_colors ($c);
+
+ for (my $i = 0; $i < $c; ++$i) {
+ push @ret,
+ "DEF:min_$i=$AbsDir/email-$inst[$i].rrd:count:MIN",
+ "DEF:avg_$i=$AbsDir/email-$inst[$i].rrd:count:AVERAGE",
+ "DEF:max_$i=$AbsDir/email-$inst[$i].rrd:count:MAX";
+ }
+
+ for (my $i = 0; $i < $c; ++$i) {
+ my $s = "";
+
+ if (length $inst[$i] > 10) {
+ $s = substr ($inst[$i], 0, 7) . '...';
+ }
+ else {
+ $s = sprintf '%-10s', $inst[$i];
+ }
+
+ push @ret,
+ "LINE1:avg_$i#$colors[$i]:$s",
+ "GPRINT:min_$i:MIN:%4.1lf Min,",
+ "GPRINT:avg_$i:AVERAGE:%4.1lf Avg,",
+ "GPRINT:max_$i:MAX:%4.1lf Max,",
+ "GPRINT:avg_$i:LAST:%4.1lf Last\\l";
+ }
+ return @ret;
+}
+
+sub output_graph_email_size
+{
+ my @inst = @_;
+ my @ret = ();
+
+ my $c = scalar @inst;
+
+ my @colors = get_n_colors ($c);
+
+ for (my $i = 0; $i < $c; ++$i) {
+ push @ret,
+ "DEF:min_$i=$AbsDir/email_size-$inst[$i].rrd:size:MIN",
+ "DEF:avg_$i=$AbsDir/email_size-$inst[$i].rrd:size:AVERAGE",
+ "DEF:max_$i=$AbsDir/email_size-$inst[$i].rrd:size:MAX";
+ }
+
+ for (my $i = 0; $i < $c; ++$i) {
+ my $s = "";
+
+ if (length $inst[$i] > 10) {
+ $s = substr ($inst[$i], 0, 7) . '...';
+ }
+ else {
+ $s = sprintf '%-10s', $inst[$i];
+ }
+
+ push @ret,
+ "LINE1:avg_$i#$colors[$i]:$s",
+ "GPRINT:min_$i:MIN:%4.1lf Min,",
+ "GPRINT:avg_$i:AVERAGE:%4.1lf Avg,",
+ "GPRINT:max_$i:MAX:%4.1lf Max,",
+ "GPRINT:avg_$i:LAST:%4.1lf Last\\l";
+ }
+ return @ret;
+}
+
+sub output_graph_spam_check
+{
+ my @inst = sort @_;
+ my @ret = ();
+
+ my $c = scalar @inst;
+
+ my @colors = get_n_colors ($c);
+
+ for (my $i = 0; $i < $c; ++$i) {
+ push @ret,
+ "DEF:min_$i=$AbsDir/spam_check-$inst[$i].rrd:hits:MIN",
+ "DEF:avg_$i=$AbsDir/spam_check-$inst[$i].rrd:hits:AVERAGE",
+ "DEF:max_$i=$AbsDir/spam_check-$inst[$i].rrd:hits:MAX";
+ }
+
+ for (my $i = 0; $i < $c; ++$i) {
+ my $s = "";
+
+ if (length $inst[$i] > 25) {
+ $s = substr ($inst[$i], 0, 22) . '...';
+ }
+ else {
+ $s = sprintf '%-25s', $inst[$i];
+ }
+
+ push @ret,
+ "LINE1:avg_$i#$colors[$i]:$s",
+ "GPRINT:min_$i:MIN:%4.1lf Min,",
+ "GPRINT:avg_$i:AVERAGE:%4.1lf Avg,",
+ "GPRINT:max_$i:MAX:%4.1lf Max,",
+ "GPRINT:avg_$i:LAST:%4.1lf Last\\l";
+ }
+ return @ret;
+}
+