+sub output_graph_mysql_commands
+{
+ my @inst = @_;
+ my @ret = ();
+
+ die if (@inst < 2);
+
+ my @colors = get_n_colors (scalar (@inst));
+
+ for (my $i = 0; $i < scalar (@inst); $i++)
+ {
+ my $inst = $inst[$i];
+ push (@ret,
+ "DEF:avg_$i=$AbsDir/mysql_commands-$inst.rrd:value:AVERAGE",
+ "DEF:min_$i=$AbsDir/mysql_commands-$inst.rrd:value:MIN",
+ "DEF:max_$i=$AbsDir/mysql_commands-$inst.rrd:value:MAX");
+ }
+
+ for (my $i = 0; $i < scalar (@inst); $i++)
+ {
+ my $inst = $inst[$i];
+ my $color = $colors[$i];
+
+ if (length ($inst) > 18)
+ {
+ $inst = substr ($inst, 0, 15) . '...';
+ }
+ else
+ {
+ $inst = sprintf ('%-18s', $inst);
+ }
+
+ push (@ret,
+ "LINE1:avg_$i#$color:$inst",
+ "GPRINT:min_$i:MIN:%6.1lf Min,",
+ "GPRINT:avg_$i:AVERAGE:%6.1lf Avg,",
+ "GPRINT:max_$i:MAX:%6.1lf Max,",
+ "GPRINT:avg_$i:LAST:%6.1lf Last\\l");
+ }
+
+ return (@ret);
+}
+
+sub output_graph_mysql_handler
+{
+ my @inst = @_;
+ my @ret = ();
+
+ die if (@inst < 2);
+
+ my @colors = get_n_colors (scalar (@inst));
+
+ for (my $i = 0; $i < scalar (@inst); $i++)
+ {
+ my $inst = $inst[$i];
+ push (@ret,
+ "DEF:avg_$i=$AbsDir/mysql_handler-$inst.rrd:value:AVERAGE",
+ "DEF:min_$i=$AbsDir/mysql_handler-$inst.rrd:value:MIN",
+ "DEF:max_$i=$AbsDir/mysql_handler-$inst.rrd:value:MAX");
+ }
+
+ for (my $i = 0; $i < scalar (@inst); $i++)
+ {
+ my $inst = $inst[$i];
+ my $color = $colors[$i];
+
+ if (length ($inst) > 18)
+ {
+ $inst = substr ($inst, 0, 15) . '...';
+ }
+ else
+ {
+ $inst = sprintf ('%-18s', $inst);
+ }
+
+ push (@ret,
+ "LINE1:avg_$i#$color:$inst",
+ "GPRINT:min_$i:MIN:%6.1lf Min,",
+ "GPRINT:avg_$i:AVERAGE:%6.1lf Avg,",
+ "GPRINT:max_$i:MAX:%6.1lf Max,",
+ "GPRINT:avg_$i:LAST:%6.1lf Last\\l");
+ }
+
+ return (@ret);
+}
+