diff options
Diffstat (limited to 'other/tor/bin/rrd-graph')
-rwxr-xr-x | other/tor/bin/rrd-graph | 45 |
1 files changed, 33 insertions, 12 deletions
diff --git a/other/tor/bin/rrd-graph b/other/tor/bin/rrd-graph index 67ba501..5566a62 100755 --- a/other/tor/bin/rrd-graph +++ b/other/tor/bin/rrd-graph @@ -4,6 +4,7 @@ use strict; use RRDs; my $HOSTNAME = `hostname`; +chomp $HOSTNAME; #my $IMG_URL = 'http://images.noreply.org/tor-running-routers/'; #my $IMG_URL = 'http://new.noreply.org/tor-running-routers/'; @@ -13,9 +14,13 @@ my $GMTIME = gmtime($NOW); my $START_AT = $NOW-4*30*24*3600; my $END_AT = $NOW-24*3600; my $OLD_AT = $NOW-7*24*3600; -my $RRD = '/home/weasel/www/www.noreply.org/Build/other/tor/rrd/running_Routers.rrd'; -my $RRD_DIR = '/home/weasel/www/www.noreply.org/Build/other/tor/rrd/nodes'; -my $INDEX_DIR = '/home/weasel/www/www.noreply.org/Build/other/tor/index'; +my $BASE = '/home/weasel/www/www.noreply.org/Build/other/tor/'; +if ($HOSTNAME eq 'simona') { + $BASE = '/scratch/weasel/tor/'; +}; +my $RRD = $BASE.'rrd/running_Routers.rrd'; +my $RRD_DIR = $BASE.'rrd/nodes'; +my $INDEX_DIR = $BASE.'index'; my $RESULT_DIR = 'result.new'; my $LONG_TIME_MONTHS = 24; my $VERBOSE = 0; @@ -164,7 +169,7 @@ for my $source (@SOURCES) { push @nodesTraffic, sprintf('CDEF:max_aggwrite%d=max_cleanwrite%d', $traf_item_counter, $traf_item_counter); #push @nodesTraffic, sprintf('CDEF:min_aggread%d=min_cleanread%d', $traf_item_counter, $traf_item_counter); #push @nodesTraffic, sprintf('CDEF:min_aggwrite%d=min_cleanwrite%d', $traf_item_counter, $traf_item_counter); - push @nodesTraffic, sprintf('CDEF:max_aggcapacity%d=max_cleancapacity%d', $traf_item_counter, $traf_item_counter); + ##MAX_AGGCAPACITY##push @nodesTraffic, sprintf('CDEF:max_aggcapacity%d=max_cleancapacity%d', $traf_item_counter, $traf_item_counter); } else { push @nodesTraffic, sprintf('CDEF:aggread%d=cleanread%d,aggread%d,+', $traf_item_counter, $traf_item_counter, $traf_item_counter-1); push @nodesTraffic, sprintf('CDEF:aggwrite%d=cleanwrite%d,aggwrite%d,+', $traf_item_counter, $traf_item_counter, $traf_item_counter-1); @@ -172,7 +177,7 @@ for my $source (@SOURCES) { push @nodesTraffic, sprintf('CDEF:max_aggwrite%d=max_cleanwrite%d,max_aggwrite%d,+', $traf_item_counter, $traf_item_counter, $traf_item_counter-1); #push @nodesTraffic, sprintf('CDEF:min_aggread%d=min_cleanread%d,min_aggread%d,+', $traf_item_counter, $traf_item_counter, $traf_item_counter-1); #push @nodesTraffic, sprintf('CDEF:min_aggwrite%d=min_cleanwrite%d,min_aggwrite%d,+', $traf_item_counter, $traf_item_counter, $traf_item_counter-1); - push @nodesTraffic, sprintf('CDEF:max_aggcapacity%d=max_cleancapacity%d,max_aggcapacity%d,+', $traf_item_counter, $traf_item_counter, $traf_item_counter-1); + ##MAX_AGGCAPACITY##push @nodesTraffic, sprintf('CDEF:max_aggcapacity%d=max_cleancapacity%d,max_aggcapacity%d,+', $traf_item_counter, $traf_item_counter, $traf_item_counter-1); }; for my $thumb (0, 1) { @@ -267,7 +272,7 @@ sub makeTotalTrafficPic($$$) { push @totalTraffic, sprintf('LINE1:max_aggwrite%d#5555FF:Write [max 15min]', $traf_item_counter) if $include15min; #push @totalTraffic, sprintf('LINE1:min_aggread%d#FF76D4:Read [min]', $traf_item_counter); #push @totalTraffic, sprintf('LINE1:min_aggwrite%d#222255:Write [min]', $traf_item_counter); - push @totalTraffic, sprintf('LINE1:max_aggcapacity%d#FF5555:Capacity', $traf_item_counter); + ##MAX_AGGCAPACITY##push @totalTraffic, sprintf('LINE1:max_aggcapacity%d#FF5555:Capacity', $traf_item_counter); push @totalTraffic, sprintf('CDEF:zeroline=aggread%d,0,*', $traf_item_counter); push @totalTraffic, sprintf('%s:%s' , 'LINE1' , 'zeroline' ); @@ -336,13 +341,27 @@ sub makeNumbersGraph($$) { my $html = "<html><head><title>Number of Running Tor routers</title></head><body>"; $html .= "<h1><a name=\"_top\">Number of Running Tor routers</a></h1>"; -$html .= "<a href=\"../\">..</a><br>\n"; +$html .= "<a href=\"../\">..</a>\n"; +$html .= << 'EOF'; +<p> +<h2>Note: this list is not updated anymore as of August 2007.</h2> +Check out +<a href="http://torstatus.kgprog.com/">one</a> +of the +<a href="http://torstatus.blutmagie.de/">status</a> +<a href="https://torstat.xenobite.eu/">pages</a> +listed on the <a href="https://www.torproject.org/documentation">Tor documentation page</a>. +EOF my ($averages,$xsize,$ysize); +#my (undef,undef,$hour,undef,undef,undef,$wday,undef,undef) = localtime(time); + makeNumbersGraph($RESULT_DIR.'/totalWeekly.png', 7*24*3600); makeNumbersGraph($RESULT_DIR.'/totalBiWeekly.png', 14*24*3600); makeNumbersGraph($RESULT_DIR.'/totalMonthly.png', 35*24*3600); +# XXX do run only every so often +#makeNumbersGraph($RESULT_DIR.'/totalLong.png', $LONG_TIME_MONTHS*30*24*3600) if ($hour < 10 && $wday == 1); makeNumbersGraph($RESULT_DIR.'/totalLong.png', $LONG_TIME_MONTHS*30*24*3600); ($averages,$xsize,$ysize) = makeNumbersGraph($RESULT_DIR.'/total.png', $NOW - $START_AT); @@ -357,6 +376,8 @@ $html .= " <a href=\"$IMG_URL"."totalWeekly.html\">last week</a></p>"; makeTotalTrafficPic($RESULT_DIR.'/totalTrafficWeekly.png', 7*24*3600, 1); makeTotalTrafficPic($RESULT_DIR.'/totalTrafficBiWeekly.png', 14*24*3600, 1); makeTotalTrafficPic($RESULT_DIR.'/totalTrafficMonthly.png', 35*24*3600, 0); +# XXX do run only every so often +#makeTotalTrafficPic($RESULT_DIR.'/totalTrafficLong.png', $LONG_TIME_MONTHS*30*24*3600, 0) if ($hour < 10 && $wday == 1); makeTotalTrafficPic($RESULT_DIR.'/totalTrafficLong.png', $LONG_TIME_MONTHS*30*24*3600, 0); ($averages,$xsize,$ysize) = makeTotalTrafficPic($RESULT_DIR.'/totalTraffic.png', $NOW - $START_AT, 0); @@ -372,11 +393,11 @@ $html .= "<p>The directory is downloaded from "; $html .= "<a href=\"http://tor.noreply.org/tor/\">http://tor.noreply.org/tor/</a>"; $html .= " at regular intervals.<br>\n"; -$html .= "Other directory sources are "; - $html .= "<a href=\"http://moria.mit.edu:9031/tor/\">http://moria.mit.edu:9031/tor/</a>"; - -$html .= " and\n"; - $html .= "<a href=\"http://belegost.mit.edu/tor/\">http://belegost.mit.edu/tor/</a>"; +#$html .= "Other directory sources are "; +# $html .= "<a href=\"http://moria.seul.org:9031/tor/\">http://moria.seul.org:9031/tor/</a>"; +# +#$html .= " and\n"; +# $html .= "<a href=\"http://moria.seul.org:9032/tor/\">http://moria.seul.org:9032/tor/</a>"; $html .= "."; $html .= "<h1>Recent Nodes</h1>"; |