aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMatt Rude <[email protected]>2011-07-03 19:29:53 -0500
committerMatt Rude <[email protected]>2011-07-03 19:29:53 -0500
commit111e625ec4cabfe555d8267708529cada610037a (patch)
tree9b6b4628afef7c75d72c70fe67823a04561a36d0 /scripts
parent8e2c41e7813e1a5c7fadb276d32fb78d09935ae1 (diff)
downloadtime.mattrude.com-111e625ec4cabfe555d8267708529cada610037a.tar.gz
time.mattrude.com-111e625ec4cabfe555d8267708529cada610037a.tar.bz2
time.mattrude.com-111e625ec4cabfe555d8267708529cada610037a.zip
Add combo graph to graphs each script creats
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/templates/graphs.cgi35
1 files changed, 27 insertions, 8 deletions
diff --git a/scripts/templates/graphs.cgi b/scripts/templates/graphs.cgi
index 46de70b..e323f3b 100755
--- a/scripts/templates/graphs.cgi
+++ b/scripts/templates/graphs.cgi
@@ -148,6 +148,25 @@ sub graph_clients_small($$) {
);
}
+sub graph_combo($$) {
+ my ($range, $file) = @_;
+ my $step = $range*$points_per_sample/$xpoints;
+ rrd_graph($range, $file, $ypoints,
+ "DEF:offset=$rrd:offset:LAST",
+ 'LINE1:offset#002A97FF:Offset:',
+ 'GPRINT:offset:LAST:Current\:%8.2lf %s',
+ 'GPRINT:offset:AVERAGE:Average\:%8.2lf %s',
+ 'GPRINT:offset:MIN:Minimum\:%8.2lf %s',
+ 'GPRINT:offset:MAX:Maximum\:%8.2lf %s\n',
+ "DEF:cjit=$rrd:cjit:LAST",
+ 'LINE1:cjit#F51D30FF:cJit:',
+ 'GPRINT:cjit:LAST:Current\:%8.2lf %s',
+ 'GPRINT:cjit:AVERAGE:Average\:%8.2lf %s',
+ 'GPRINT:cjit:MIN:Minimum\:%8.2lf %s',
+ 'GPRINT:cjit:MAX:Maximum\:%8.2lf %s\n',
+ );
+}
+
sub graph_offset($$) {
my ($range, $file) = @_;
my $step = $range*$points_per_sample/$xpoints;
@@ -316,23 +335,23 @@ sub main()
my $file = "$tmp_dir/$host/ntpgraph_$1_offset.png";
graph_offset($graphs[$1]{seconds}, $file);
send_image($file);
- }
- elsif($img =~ /^(\d+)-sjit$/) {
+ } elsif($img =~ /^(\d+)-combo$/) {
+ my $file = "$tmp_dir/$host/ntpgraph_$1_combo.png";
+ graph_combo($graphs[$1]{seconds}, $file);
+ send_image($file);
+ } elsif($img =~ /^(\d+)-sjit$/) {
my $file = "$tmp_dir/$host/ntpgraph_$1_sjit.png";
graph_sjit($graphs[$1]{seconds}, $file);
send_image($file);
- }
- elsif($img =~ /^(\d+)-cjit$/) {
+ } elsif($img =~ /^(\d+)-cjit$/) {
my $file = "$tmp_dir/$host/ntpgraph_$1_cjit.png";
graph_cjit($graphs[$1]{seconds}, $file);
send_image($file);
- }
- elsif($img =~ /^(\d+)-wander$/) {
+ } elsif($img =~ /^(\d+)-wander$/) {
my $file = "$tmp_dir/$host/ntpgraph_$1_wander.png";
graph_wander($graphs[$1]{seconds}, $file);
send_image($file);
- }
- elsif($img =~ /^(\d+)-freq$/) {
+ } elsif($img =~ /^(\d+)-freq$/) {
my $file = "$tmp_dir/$host/ntpgraph_$1_freq.png";
graph_freq($graphs[$1]{seconds}, $file);
send_image($file);