From f6b332736611da0569a99e32075a936f6ac8c1d9 Mon Sep 17 00:00:00 2001 From: Marius Halden Date: Sat, 14 Feb 2015 07:13:44 +0100 Subject: Some cleanup --- stats.pl | 120 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/stats.pl b/stats.pl index 7284285..44cf402 100755 --- a/stats.pl +++ b/stats.pl @@ -62,12 +62,12 @@ for my $section (@content) { } $group_info->{'rrd_groups'}->{$user} = "GAUGE"; - $group_info->{'position'}->{$user} = $position; - $group_info->{'balance'}->{$user} = $balance; - $group_info->{'uptime'}->{$user} = $time_up; - $group_info->{'downtime'}->{$user} = $time_down; + $group_info->{'position'}->{$user} = $position; + $group_info->{'balance'}->{$user} = $balance; + $group_info->{'uptime'}->{$user} = $time_up; + $group_info->{'downtime'}->{$user} = $time_down; $group_info->{'maintenance'}->{$user} = $time_maint; - $group_info->{'server'}->{$user} = $endpoint; + $group_info->{'server'}->{$user} = $endpoint; } @group_names = sort keys %{$group_info->{'rrd_groups'}}; @@ -94,17 +94,17 @@ for my $group (@group_names) { } } - $group_info->{'users'}->{$group} = $users; - $group_info->{'posts'}->{$group} = $posts; - $group_info->{'comments'}->{$group} = $comments; + $group_info->{'users'}->{$group} = $users; + $group_info->{'posts'}->{$group} = $posts; + $group_info->{'comments'}->{$group} = $comments; } my %g_rrd_info = ( - destination => "$rrd_path/graph", - periods => [ qw(day week month) ], - interlaced => "", + destination => "$rrd_path/graph", + periods => [ qw(day week month) ], + interlaced => "", extended_legend => "true", - timestamp => "both", + timestamp => "both", ); for my $group (@group_names) { @@ -136,73 +136,73 @@ for my $group (@group_names) { $uptime_rrd->graph( %rrd_info, - basename => "all-times", - sources => [ qw(uptime maintenance downtime) ], + basename => "all-times", + sources => [ qw(uptime maintenance downtime) ], source_colors => [ qw(00CC00 0000FF FF0000) ], - title => "Time stats group: $group", + title => "Time stats group: $group", vertical_label => "Time/seconds", ); $uptime_rrd->graph( %rrd_info, - basename => "uptime", - sources => [ qw(uptime) ], + basename => "uptime", + sources => [ qw(uptime) ], source_colors => [ qw(00CC00) ], - title => "Uptime stats group: $group", + title => "Uptime stats group: $group", vertical_label => "Time/seconds", ); $uptime_rrd->graph( %rrd_info, - basename => "maintenance", - sources => [ qw(maintenance) ], + basename => "maintenance", + sources => [ qw(maintenance) ], source_colors => [ qw(0000FF) ], - title => "Uptime stats group: $group", + title => "Uptime stats group: $group", vertical_label => "Time/seconds", ); $uptime_rrd->graph( %rrd_info, - basename => "downtime", - sources => [ qw(downtime) ], + basename => "downtime", + sources => [ qw(downtime) ], source_colors => [ qw(FF0000) ], - title => "Uptime stats group: $group", + title => "Uptime stats group: $group", vertical_label => "Time/seconds", ); $users_rrd->graph( %rrd_info, - basename => "all-user-stats", - sources => [ qw(users posts comments) ], + basename => "all-user-stats", + sources => [ qw(users posts comments) ], source_colors => [ qw(00CC00 0000FF FF0000) ], - title => "Users/Posts/Comments for $group", + title => "Users/Posts/Comments for $group", vertical_label => "Count", ); $users_rrd->graph( %rrd_info, - basename => "users", - sources => [ qw(users) ], + basename => "users", + sources => [ qw(users) ], source_colors => [ qw(00CC00) ], - title => "User count for $group", + title => "User count for $group", vertical_label => "Nr. of users", ); $users_rrd->graph( %rrd_info, - basename => "posts", - sources => [ qw(posts) ], + basename => "posts", + sources => [ qw(posts) ], source_colors => [ qw(0000FF) ], - title => "Post count for $group", + title => "Post count for $group", vertical_label => "Nr. of posts", ); $users_rrd->graph( %rrd_info, - basename => "comments", - sources => [ qw(comments) ], + basename => "comments", + sources => [ qw(comments) ], source_colors => [ qw(FF0000) ], - title => "Comment count for $group", + title => "Comment count for $group", vertical_label => "Nr. of comments", ); @@ -269,64 +269,64 @@ $g_rrd_info{'source_colors'} = [ @group_colors ]; $position_rrd->graph( %g_rrd_info, - basename => "positions", - title => "Positions", + basename => "positions", + title => "Positions", vertical_label => "Position", ); $balance_rrd->graph( %g_rrd_info, - basename => "balance", - title => "Balances", + basename => "balance", + title => "Balances", vertical_label => "Balance", ); $uptime_rrd->graph( %g_rrd_info, - basename => "uptime", - title => "Uptime per group", + basename => "uptime", + title => "Uptime per group", vertical_label => "Uptime/seconds", ); $downtime_rrd->graph( %g_rrd_info, - basename => "downtime", - title => "Downtime per group", + basename => "downtime", + title => "Downtime per group", vertical_label => "Downtime/seconds", ); $maint_rrd->graph( %g_rrd_info, - basename => "maintenance", - title => "Maintenance per group", + basename => "maintenance", + title => "Maintenance per group", vertical_label => "Maintenance/seconds", ); $uptime_rrd->graph( %g_rrd_info, - basename => "uptime", - title => "Uptime per group", + basename => "uptime", + title => "Uptime per group", vertical_label => "Uptime/seconds", ); $user_rrd->graph( %g_rrd_info, - basename => "users", - title => "Number of users per group", + basename => "users", + title => "Number of users per group", vertical_label => "Nr. of users", ); $post_rrd->graph( %g_rrd_info, - basename => "posts", - title => "Number of posts per group", + basename => "posts", + title => "Number of posts per group", vertical_label => "Nr. of posts", ); $comment_rrd->graph( %g_rrd_info, - basename => "comments", - title => "Number of comments per group", + basename => "comments", + title => "Number of comments per group", vertical_label => "Nr. of comments", ); @@ -339,19 +339,19 @@ for my $group (@group_names) { $balance_rrd->graph( %rrd_info, - basename => "balance", - sources => [ $group ], + basename => "balance", + sources => [ $group ], source_colors => [ qw(00CC00) ], - title => "Balance for $group", + title => "Balance for $group", vertical_label => "Balance", ); $position_rrd->graph( %rrd_info, - basename => "position", - sources => [ $group ], + basename => "position", + sources => [ $group ], source_colors => [ qw(00CC00) ], - title => "Position for $group", + title => "Position for $group", vertical_label => "Position", ); } -- cgit v1.2.3