1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-25 18:38:30 +00:00

reorder graph to, hopefully, fix stacking

This commit is contained in:
Antoine Beaupré 2014-01-02 18:52:58 -05:00
parent ade1481717
commit 88ba6e86be

View file

@ -82,9 +82,6 @@ sub print_graph_data() {
$upper_limit = poll_variables($MYSQL_VARIABLES,"max_connections"); $upper_limit = poll_variables($MYSQL_VARIABLES,"max_connections");
# Return the values to Munin # Return the values to Munin
print "current.value $current\n";
print "limit.value $upper_limit\n";
my $threads = get_thread_list(); my $threads = get_thread_list();
my %counts = (); my %counts = ();
my ($thread, $user, $count); my ($thread, $user, $count);
@ -102,6 +99,8 @@ sub print_graph_data() {
last if $i++ >= $numusers; last if $i++ >= $numusers;
print "$user.value $counts{$user}\n"; print "$user.value $counts{$user}\n";
} }
print "current.value $current\n";
print "limit.value $upper_limit\n";
} }
sub poll_variables { sub poll_variables {
@ -130,14 +129,6 @@ graph_vlabel Connections
graph_info The number of current connexions per user. graph_info The number of current connexions per user.
graph_category mysql graph_category mysql
graph_total Total graph_total Total
current.label In Use
current.draw LINE1
current.info The number of current threads connected
current.warning $warning
current.critical $critical
limit.label Maximum
limit.draw LINE1
limit.info The current value of the "max_connections" variable
EOM EOM
my $threads = get_thread_list(); my $threads = get_thread_list();
my %seen = (); my %seen = ();
@ -148,7 +139,6 @@ while (($thread, $user) = each %$threads) {
next; next;
} }
else { else {
$seen{$user} = 1;
print <<EOM; print <<EOM;
$user.label Connexions for user $user $user.label Connexions for user $user
$user.info Number of connexions used by user $user $user.info Number of connexions used by user $user
@ -161,10 +151,20 @@ EOM
else { else {
print "AREA\n"; print "AREA\n";
} }
$seen{$user} = 1;
} }
} }
print <<EOM;
current.label In Use
current.draw LINE1
current.info The number of current threads connected
current.warning $warning
current.critical $critical
limit.label Maximum
limit.draw LINE1
limit.info The current value of the "max_connections" variable
EOM
} }
sub get_thread_list { sub get_thread_list {