summaryrefslogtreecommitdiff
path: root/other
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2005-09-11 22:39:40 +0000
committerPeter Palfrader <peter@palfrader.org>2005-09-11 22:39:40 +0000
commita88af8c65066a71ab10fb7789cb94275879bfaec (patch)
tree24615c8397cf949f0616320c1d7e3ab8e1e17067 /other
parente532d79cfbebd2cd97879a14a546a7cfc0cd74b7 (diff)
Make long be 15 months,
move pictures into their own html files more stuff
Diffstat (limited to 'other')
-rw-r--r--other/tor/Makefile3
-rwxr-xr-xother/tor/bin/rrd-graph306
-rwxr-xr-xother/tor/bin/rrd-update1
3 files changed, 149 insertions, 161 deletions
diff --git a/other/tor/Makefile b/other/tor/Makefile
index e08ee8e..a10f38c 100644
--- a/other/tor/Makefile
+++ b/other/tor/Makefile
@@ -2,7 +2,8 @@ TODAY=`TZ=UTC date +'%Y-%m-%d_%H:%M:%S'`
WGET=wget --cache=off
OUTDIR=tor-directory
#SOURCE=http://moria.mit.edu:9031/
-SOURCE=http://tor.noreply.org:9030/
+#SOURCE=http://tor.noreply.org:9030/
+SOURCE=http://tor.noreply.org:80/tor/
TMPFILE=download.tmp
LAST_NAME=dir.last
diff --git a/other/tor/bin/rrd-graph b/other/tor/bin/rrd-graph
index bd4cc05..2940f7c 100755
--- a/other/tor/bin/rrd-graph
+++ b/other/tor/bin/rrd-graph
@@ -2,7 +2,6 @@
use strict;
use RRDs;
-use BER;
my $HOSTNAME = `hostname`;
@@ -18,6 +17,7 @@ my $RRD = '/home/weasel/www/www.noreply.org/Build/other/tor/rrd/running_Routers.
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 $RESULT_DIR = 'result.new';
+my $LONG_TIME_MONTHS = 15;
# Get list of RRD files
opendir(D,$RRD_DIR) or die ("Cannot opendir $RRD_DIR: $!\n");
@@ -58,64 +58,8 @@ for my $hash (@NAME) {
$a cmp $b
} @SOURCES;
-my @params = 'MAGIX1';
-push @params, sprintf('MAGIX2');
-push @params, sprintf('-e %s', $END_AT);
-#push @params, sprintf('-e %s', $NOW- 2*24*3600);
-push @params, sprintf('-t %s', "Running routers");
-push @params, sprintf('-aPNG');
-push @params, sprintf('-v %s', "# Routers");
-#push @params, sprintf('-w %d', 600);
-#push @params, sprintf('-h %d', 400);
-push @params, sprintf('-w %d', 497);
-push @params, sprintf('-h %d', 301);
-#push @params, sprintf('-h %d', 271);
-
-push @params, sprintf('DEF:%s=%s:%s:%s', 'd_runningVerified' , $RRD, 'runningVerified', 'AVERAGE');
-push @params, sprintf('CDEF:%s=%s' , 'c_runningVerified' , 'd_runningVerified');
-push @params, sprintf('DEF:%s=%s:%s:%s', 'd_runningUnverified' , $RRD, 'runningUnverified', 'AVERAGE');
-push @params, sprintf('CDEF:%s=%s' , 'c_runningUnverified' , 'd_runningUnverified');
-push @params, sprintf('DEF:%s=%s:%s:%s', 'd_exit80Verified' , $RRD, 'exit80Verified', 'AVERAGE');
-push @params, sprintf('CDEF:%s=%s' , 'c_exit80Verified' , 'd_exit80Verified');
-
-push @params, sprintf('DEF:%s=%s:%s:%s', 'd_f_runningVerified' , $RRD, 'fastRunningVerified', 'AVERAGE');
-push @params, sprintf('CDEF:%s=%s' , 'c_f_runningVerified' , 'd_f_runningVerified');
-push @params, sprintf('DEF:%s=%s:%s:%s', 'd_f_runningUnverified' , $RRD, 'fastRunningUnverifi', 'AVERAGE');
-push @params, sprintf('CDEF:%s=%s' , 'c_f_runningUnverified' , 'd_f_runningUnverified');
-push @params, sprintf('DEF:%s=%s:%s:%s', 'd_f_exit80Verified' , $RRD, 'fastExit80Verified', 'AVERAGE');
-push @params, sprintf('CDEF:%s=%s' , 'c_f_exit80Verified' , 'd_f_exit80Verified');
-
-#push @params, sprintf('%s:%s#%s:%s' , 'AREA' , 'c_runningVerified' , '7777FF', 'verified Nodes' );
-#push @params, sprintf('%s:%s#%s:%s' , 'STACK' , 'c_runningUnverified' , 'FF7700', 'unverified Nodes' );
-#push @params, sprintf('%s:%s#%s:%s' , 'LINE3' , 'c_exit80Verified' , '00FF00', 'verified Nodes exiting to port 80' );
-push @params, sprintf('%s:%s#%s:%s' , 'AREA' , 'c_runningVerified' , 'AAAAFF', 'verified Nodes' );
-push @params, sprintf('%s:%s#%s:%s' , 'STACK' , 'c_runningUnverified' , 'FF7700', '+unverified Nodes' );
-push @params, sprintf('%s:%s#%s:%s' , 'LINE2' , 'c_exit80Verified' , 'BBFFBB', 'verified Nodes exiting to port 80' );
-
-push @params, sprintf('%s:%s#%s:%s' , 'LINE3' , 'c_f_runningVerified' , '0000FF', 'fast verified Nodes' );
-push @params, sprintf('%s:%s#%s:%s' , 'STACK' , 'c_f_runningUnverified' , 'FF0000', '+fast unverified Nodes' );
-push @params, sprintf('%s:%s#%s:%s' , 'LINE3' , 'c_f_exit80Verified' , '00FF00', 'fast verified Nodes exiting to port 80' );
-
-push @params, sprintf('CDEF:%s=d_runningVerified,0,*,%s,+' , 'zeroline' , '0');
-push @params, sprintf('%s:%s' , 'LINE1' , 'zeroline' );
-
-
-
-my @totalTraffic = 'MAGIX1';
-push @totalTraffic, sprintf('MAGIX2');
-#push @totalTraffic, sprintf('-s %s', $START_AT);
-push @totalTraffic, sprintf('-e %s', $END_AT);
-#push @totalTraffic, sprintf('-e %s', $NOW- 2*24*3600);
-push @totalTraffic, sprintf('-t %s', "Total Traffic");
-push @totalTraffic, sprintf('-aPNG');
-push @totalTraffic, sprintf('-v %s', "Bandwidth Used");
-#push @totalTraffic, sprintf('-w %d', 600);
-#push @totalTraffic, sprintf('-h %d', 400);
-push @totalTraffic, sprintf('-w %d', 497);
-push @totalTraffic, sprintf('-h %d', 201);
-#push @totalTraffic, sprintf('-h %d', 301);
-#push @totalTraffic, sprintf('-h %d', 271);
+my @nodesTraffic = ();
my %body;
my %index;
@@ -179,38 +123,38 @@ for my $source (@SOURCES) {
if (-e $source_traffic) {
$traf_item_counter++;
- push @totalTraffic, sprintf('DEF:read%d=%s:read:AVERAGE', $traf_item_counter, $source_traffic);
- push @totalTraffic, sprintf('DEF:write%d=%s:write:AVERAGE', $traf_item_counter, $source_traffic);
- push @totalTraffic, sprintf('DEF:max_read%d=%s:read:MAX', $traf_item_counter, $source_traffic);
- push @totalTraffic, sprintf('DEF:max_write%d=%s:write:MAX', $traf_item_counter, $source_traffic);
- #push @totalTraffic, sprintf('DEF:min_read%d=%s:read:MIN', $traf_item_counter, $source_traffic);
- #push @totalTraffic, sprintf('DEF:min_write%d=%s:write:MIN', $traf_item_counter, $source_traffic);
- push @totalTraffic, sprintf('DEF:max_capacity%d=%s:capacity:MAX', $traf_item_counter, $source);
-
- push @totalTraffic, sprintf('CDEF:cleanread%d=read%d,UN,0,read%d,IF', $traf_item_counter, $traf_item_counter, $traf_item_counter);
- push @totalTraffic, sprintf('CDEF:cleanwrite%d=write%d,UN,0,write%d,IF', $traf_item_counter, $traf_item_counter, $traf_item_counter);
- push @totalTraffic, sprintf('CDEF:max_cleanread%d=max_read%d,UN,0,max_read%d,IF', $traf_item_counter, $traf_item_counter, $traf_item_counter);
- push @totalTraffic, sprintf('CDEF:max_cleanwrite%d=max_write%d,UN,0,max_write%d,IF', $traf_item_counter, $traf_item_counter, $traf_item_counter);
- #push @totalTraffic, sprintf('CDEF:min_cleanread%d=min_read%d,UN,0,min_read%d,IF', $traf_item_counter, $traf_item_counter, $traf_item_counter);
- #push @totalTraffic, sprintf('CDEF:min_cleanwrite%d=min_write%d,UN,0,min_write%d,IF', $traf_item_counter, $traf_item_counter, $traf_item_counter);
- push @totalTraffic, sprintf('CDEF:max_cleancapacity%d=max_capacity%d,UN,0,max_capacity%d,IF', $traf_item_counter, $traf_item_counter, $traf_item_counter);
+ push @nodesTraffic, sprintf('DEF:read%d=%s:read:AVERAGE', $traf_item_counter, $source_traffic);
+ push @nodesTraffic, sprintf('DEF:write%d=%s:write:AVERAGE', $traf_item_counter, $source_traffic);
+ push @nodesTraffic, sprintf('DEF:max_read%d=%s:read:MAX', $traf_item_counter, $source_traffic);
+ push @nodesTraffic, sprintf('DEF:max_write%d=%s:write:MAX', $traf_item_counter, $source_traffic);
+ #push @nodesTraffic, sprintf('DEF:min_read%d=%s:read:MIN', $traf_item_counter, $source_traffic);
+ #push @nodesTraffic, sprintf('DEF:min_write%d=%s:write:MIN', $traf_item_counter, $source_traffic);
+ push @nodesTraffic, sprintf('DEF:max_capacity%d=%s:capacity:MAX', $traf_item_counter, $source);
+
+ push @nodesTraffic, sprintf('CDEF:cleanread%d=read%d,UN,0,read%d,IF', $traf_item_counter, $traf_item_counter, $traf_item_counter);
+ push @nodesTraffic, sprintf('CDEF:cleanwrite%d=write%d,UN,0,write%d,IF', $traf_item_counter, $traf_item_counter, $traf_item_counter);
+ push @nodesTraffic, sprintf('CDEF:max_cleanread%d=max_read%d,UN,0,max_read%d,IF', $traf_item_counter, $traf_item_counter, $traf_item_counter);
+ push @nodesTraffic, sprintf('CDEF:max_cleanwrite%d=max_write%d,UN,0,max_write%d,IF', $traf_item_counter, $traf_item_counter, $traf_item_counter);
+ #push @nodesTraffic, sprintf('CDEF:min_cleanread%d=min_read%d,UN,0,min_read%d,IF', $traf_item_counter, $traf_item_counter, $traf_item_counter);
+ #push @nodesTraffic, sprintf('CDEF:min_cleanwrite%d=min_write%d,UN,0,min_write%d,IF', $traf_item_counter, $traf_item_counter, $traf_item_counter);
+ push @nodesTraffic, sprintf('CDEF:max_cleancapacity%d=max_capacity%d,UN,0,max_capacity%d,IF', $traf_item_counter, $traf_item_counter, $traf_item_counter);
if ($traf_item_counter == 1) {
- push @totalTraffic, sprintf('CDEF:aggread%d=cleanread%d', $traf_item_counter, $traf_item_counter);
- push @totalTraffic, sprintf('CDEF:aggwrite%d=cleanwrite%d', $traf_item_counter, $traf_item_counter);
- push @totalTraffic, sprintf('CDEF:max_aggread%d=max_cleanread%d', $traf_item_counter, $traf_item_counter);
- push @totalTraffic, sprintf('CDEF:max_aggwrite%d=max_cleanwrite%d', $traf_item_counter, $traf_item_counter);
- #push @totalTraffic, sprintf('CDEF:min_aggread%d=min_cleanread%d', $traf_item_counter, $traf_item_counter);
- #push @totalTraffic, sprintf('CDEF:min_aggwrite%d=min_cleanwrite%d', $traf_item_counter, $traf_item_counter);
- push @totalTraffic, sprintf('CDEF:max_aggcapacity%d=max_cleancapacity%d', $traf_item_counter, $traf_item_counter);
+ push @nodesTraffic, sprintf('CDEF:aggread%d=cleanread%d', $traf_item_counter, $traf_item_counter);
+ push @nodesTraffic, sprintf('CDEF:aggwrite%d=cleanwrite%d', $traf_item_counter, $traf_item_counter);
+ push @nodesTraffic, sprintf('CDEF:max_aggread%d=max_cleanread%d', $traf_item_counter, $traf_item_counter);
+ 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);
} else {
- push @totalTraffic, sprintf('CDEF:aggread%d=cleanread%d,aggread%d,+', $traf_item_counter, $traf_item_counter, $traf_item_counter-1);
- push @totalTraffic, sprintf('CDEF:aggwrite%d=cleanwrite%d,aggwrite%d,+', $traf_item_counter, $traf_item_counter, $traf_item_counter-1);
- push @totalTraffic, sprintf('CDEF:max_aggread%d=max_cleanread%d,max_aggread%d,+', $traf_item_counter, $traf_item_counter, $traf_item_counter-1);
- push @totalTraffic, sprintf('CDEF:max_aggwrite%d=max_cleanwrite%d,max_aggwrite%d,+', $traf_item_counter, $traf_item_counter, $traf_item_counter-1);
- #push @totalTraffic, sprintf('CDEF:min_aggread%d=min_cleanread%d,min_aggread%d,+', $traf_item_counter, $traf_item_counter, $traf_item_counter-1);
- #push @totalTraffic, sprintf('CDEF:min_aggwrite%d=min_cleanwrite%d,min_aggwrite%d,+', $traf_item_counter, $traf_item_counter, $traf_item_counter-1);
- push @totalTraffic, sprintf('CDEF:max_aggcapacity%d=max_cleancapacity%d,max_aggcapacity%d,+', $traf_item_counter, $traf_item_counter, $traf_item_counter-1);
+ 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);
+ push @nodesTraffic, sprintf('CDEF:max_aggread%d=max_cleanread%d,max_aggread%d,+', $traf_item_counter, $traf_item_counter, $traf_item_counter-1);
+ 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);
};
for my $thumb (0, 1) {
@@ -272,104 +216,146 @@ for my $source (@SOURCES) {
$body{$section} .= "<br><a href=\"./\">back</a>";
$body{$section} .= '</p>';
};
-push @totalTraffic, sprintf('AREA:aggread%d#00FF00:Read bytes/s', $traf_item_counter);
-push @totalTraffic, sprintf('LINE2:aggwrite%d#0000FF:Write bytes/s', $traf_item_counter);
-push @totalTraffic, sprintf('LINE1:max_aggread%d#009A2C:Read [max 15min]', $traf_item_counter);
-push @totalTraffic, sprintf('LINE1:max_aggwrite%d#5555FF:Write [max 15min]', $traf_item_counter);
-#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);
-push @totalTraffic, sprintf('CDEF:zeroline=aggread%d,0,*', $traf_item_counter);
-push @totalTraffic, sprintf('%s:%s' , 'LINE1' , 'zeroline' );
-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";
+sub makeTotalTrafficPic($$$) {
+ my ($file, $age, $include15min) = @_;
+ my @totalTraffic = ();
+ push @totalTraffic, $file;
+ push @totalTraffic, sprintf('-s %s', $NOW-$age);
-if ($params[0] ne 'MAGIX1' || $params[1] ne 'MAGIX2') {
- warn "params[0,1] aren't MAGIX1,2. not nice";
-} else {
- $params[0] = $RESULT_DIR.'/totalWeekly.png';
- $params[1] = sprintf('-s %s', $NOW-7*24*3600);
- my ($averages,$xsize,$ysize) = RRDs::graph @params;
- warn RRDs::error if RRDs::error;
+ #push @totalTraffic, sprintf('-s %s', $START_AT);
+ push @totalTraffic, sprintf('-e %s', $END_AT);
+ #push @totalTraffic, sprintf('-e %s', $NOW- 2*24*3600);
+ push @totalTraffic, sprintf('-t %s', "Total Traffic");
+ push @totalTraffic, sprintf('-aPNG');
+ push @totalTraffic, sprintf('-v %s', "Bandwidth Used");
+ #push @totalTraffic, sprintf('-w %d', 600);
+ #push @totalTraffic, sprintf('-h %d', 400);
+ push @totalTraffic, sprintf('-w %d', 497);
+ push @totalTraffic, sprintf('-h %d', 201);
+ #push @totalTraffic, sprintf('-h %d', 301);
+ #push @totalTraffic, sprintf('-h %d', 271);
- $params[0] = $RESULT_DIR.'/totalBiWeekly.png';
- $params[1] = sprintf('-s %s', $NOW-14*24*3600);
- ($averages,$xsize,$ysize) = RRDs::graph @params;
- warn RRDs::error if RRDs::error;
+ push @totalTraffic, @nodesTraffic;
- $params[0] = $RESULT_DIR.'/totalMonthly.png';
- $params[1] = sprintf('-s %s', $NOW-35*24*3600);
- ($averages,$xsize,$ysize) = RRDs::graph @params;
- warn RRDs::error if RRDs::error;
- $params[0] = $RESULT_DIR.'/total.png';
- $params[1] = sprintf('-s %s', $START_AT);
- ($averages,$xsize,$ysize) = RRDs::graph @params;
- warn RRDs::error if RRDs::error;
+ push @totalTraffic, sprintf('AREA:aggread%d#00FF00:Read bytes/s', $traf_item_counter);
+ push @totalTraffic, sprintf('LINE2:aggwrite%d#0000FF:Write bytes/s', $traf_item_counter);
+ push @totalTraffic, sprintf('LINE1:max_aggread%d#009A2C:Read [max 15min]', $traf_item_counter) if $include15min;
+ 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);
+
+ push @totalTraffic, sprintf('CDEF:zeroline=aggread%d,0,*', $traf_item_counter);
+ push @totalTraffic, sprintf('%s:%s' , 'LINE1' , 'zeroline' );
- $params[0] = $RESULT_DIR.'/total9Months.png';
- $params[1] = sprintf('-s %s', $NOW-9*30*24*3600);
- ($averages,$xsize,$ysize) = RRDs::graph @params;
+ my ($averages,$xsize,$ysize) = RRDs::graph @totalTraffic;
warn RRDs::error if RRDs::error;
- $html .= "<p><img width=\"$xsize\" height=\"$ysize\" src=\"$IMG_URL"."total.png\"></p>";
- $html .= "<p>\"Fast\" means a capacity of over 20,000 bytes/second</p>\n";
- $html .= "<p>Number of routers over the <a href=\"$IMG_URL"."total9Months.html\">last 9 months</a> | ";
- $html .= " <a href=\"$IMG_URL"."totalMonthly.html\">last month</a> |";
- $html .= " <a href=\"$IMG_URL"."totalBiWeekly.html\">last 2 weeks</a></p>";
+ return ($averages,$xsize,$ysize);
};
+sub makeNumbersGraph($$) {
+ my ($file, $age) = @_;
+
+ my @params;
+ push @params, $file;
+ push @params, sprintf('-s %s', $NOW-$age);
+
+ push @params, sprintf('-e %s', $END_AT);
+ #push @params, sprintf('-e %s', $NOW- 2*24*3600);
+ push @params, sprintf('-t %s', "Running routers");
+ push @params, sprintf('-aPNG');
+ push @params, sprintf('-v %s', "# Routers");
+ #push @params, sprintf('-w %d', 600);
+ #push @params, sprintf('-h %d', 400);
+ push @params, sprintf('-w %d', 497);
+ push @params, sprintf('-h %d', 301);
+ #push @params, sprintf('-h %d', 271);
+
+ push @params, sprintf('DEF:%s=%s:%s:%s', 'd_runningVerified' , $RRD, 'runningVerified', 'AVERAGE');
+ push @params, sprintf('CDEF:%s=%s' , 'c_runningVerified' , 'd_runningVerified');
+ push @params, sprintf('DEF:%s=%s:%s:%s', 'd_runningUnverified' , $RRD, 'runningUnverified', 'AVERAGE');
+ push @params, sprintf('CDEF:%s=%s' , 'c_runningUnverified' , 'd_runningUnverified');
+ push @params, sprintf('DEF:%s=%s:%s:%s', 'd_exit80Verified' , $RRD, 'exit80Verified', 'AVERAGE');
+ push @params, sprintf('CDEF:%s=%s' , 'c_exit80Verified' , 'd_exit80Verified');
+
+ push @params, sprintf('DEF:%s=%s:%s:%s', 'd_f_runningVerified' , $RRD, 'fastRunningVerified', 'AVERAGE');
+ push @params, sprintf('CDEF:%s=%s' , 'c_f_runningVerified' , 'd_f_runningVerified');
+ push @params, sprintf('DEF:%s=%s:%s:%s', 'd_f_runningUnverified' , $RRD, 'fastRunningUnverifi', 'AVERAGE');
+ push @params, sprintf('CDEF:%s=%s' , 'c_f_runningUnverified' , 'd_f_runningUnverified');
+ push @params, sprintf('DEF:%s=%s:%s:%s', 'd_f_exit80Verified' , $RRD, 'fastExit80Verified', 'AVERAGE');
+ push @params, sprintf('CDEF:%s=%s' , 'c_f_exit80Verified' , 'd_f_exit80Verified');
+
+ #push @params, sprintf('%s:%s#%s:%s' , 'AREA' , 'c_runningVerified' , '7777FF', 'verified Nodes' );
+ #push @params, sprintf('%s:%s#%s:%s' , 'STACK' , 'c_runningUnverified' , 'FF7700', 'unverified Nodes' );
+ #push @params, sprintf('%s:%s#%s:%s' , 'LINE3' , 'c_exit80Verified' , '00FF00', 'verified Nodes exiting to port 80' );
+ push @params, sprintf('%s:%s#%s:%s' , 'AREA' , 'c_runningVerified' , 'AAAAFF', 'verified Nodes' );
+ push @params, sprintf('%s:%s#%s:%s' , 'STACK' , 'c_runningUnverified' , 'FF7700', '+unverified Nodes' );
+ push @params, sprintf('%s:%s#%s:%s' , 'LINE2' , 'c_exit80Verified' , 'BBFFBB', 'verified Nodes exiting to port 80' );
+
+ push @params, sprintf('%s:%s#%s:%s' , 'LINE3' , 'c_f_runningVerified' , '0000FF', 'fast verified Nodes' );
+ push @params, sprintf('%s:%s#%s:%s' , 'STACK' , 'c_f_runningUnverified' , 'FF0000', '+fast unverified Nodes' );
+ push @params, sprintf('%s:%s#%s:%s' , 'LINE3' , 'c_f_exit80Verified' , '00FF00', 'fast verified Nodes exiting to port 80' );
+
+ push @params, sprintf('CDEF:%s=d_runningVerified,0,*,%s,+' , 'zeroline' , '0');
+ push @params, sprintf('%s:%s' , 'LINE1' , 'zeroline' );
-if ($totalTraffic[0] ne 'MAGIX1' || $totalTraffic[1] ne 'MAGIX2') {
- warn "totalTraffic[0,1] aren't MAGIX1,2. not nice";
-} else {
- $totalTraffic[0] = $RESULT_DIR.'/totalTrafficWeekly.png';
- $totalTraffic[1] = sprintf('-s %s', $NOW-7*24*3600);
- my ($averages,$xsize,$ysize) = RRDs::graph @totalTraffic;
- warn RRDs::error if RRDs::error;
- $totalTraffic[0] = $RESULT_DIR.'/totalTrafficBiWeekly.png';
- $totalTraffic[1] = sprintf('-s %s', $NOW-14*24*3600);
- ($averages,$xsize,$ysize) = RRDs::graph @totalTraffic;
- warn RRDs::error if RRDs::error;
- $totalTraffic[0] = $RESULT_DIR.'/totalTrafficMonthly.png';
- $totalTraffic[1] = sprintf('-s %s', $NOW-35*24*3600);
- ($averages,$xsize,$ysize) = RRDs::graph @totalTraffic;
+ my ($averages,$xsize,$ysize) = RRDs::graph @params;
warn RRDs::error if RRDs::error;
- $totalTraffic[0] = $RESULT_DIR.'/totalTraffic.png';
- $totalTraffic[1] = sprintf('-s %s', $START_AT);
- ($averages,$xsize,$ysize) = RRDs::graph @totalTraffic;
- warn RRDs::error if RRDs::error;
+ return ($averages,$xsize,$ysize);
+};
- $totalTraffic[0] = $RESULT_DIR.'/totalTraffic9Months.png';
- $totalTraffic[1] = sprintf('-s %s', $NOW-9*30*24*3600);
- ($averages,$xsize,$ysize) = RRDs::graph @totalTraffic;
- warn RRDs::error if RRDs::error;
+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";
+
+my ($averages,$xsize,$ysize);
+
+makeNumbersGraph($RESULT_DIR.'/totalWeekly.png', 7*24*3600);
+makeNumbersGraph($RESULT_DIR.'/totalBiWeekly.png', 14*24*3600);
+makeNumbersGraph($RESULT_DIR.'/totalMonthly.png', 35*24*3600);
+makeNumbersGraph($RESULT_DIR.'/totalLong.png', $LONG_TIME_MONTHS*30*24*3600);
+($averages,$xsize,$ysize) = makeNumbersGraph($RESULT_DIR.'/total.png', $NOW - $START_AT);
+
+$html .= "<p><img width=\"$xsize\" height=\"$ysize\" src=\"$IMG_URL"."total.png\"></p>";
+$html .= "<p>\"Fast\" means a capacity of over 20,000 bytes/second</p>\n";
+$html .= "<p>Number of routers over the <a href=\"$IMG_URL"."totalLong.html\">last $LONG_TIME_MONTHS months</a> | ";
+$html .= " <a href=\"$IMG_URL"."totalMonthly.html\">last month</a> |";
+$html .= " <a href=\"$IMG_URL"."totalBiWeekly.html\">last 2 weeks</a> |";
+$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);
+makeTotalTrafficPic($RESULT_DIR.'/totalTrafficLong.png', $LONG_TIME_MONTHS*30*24*3600, 0);
+($averages,$xsize,$ysize) = makeTotalTrafficPic($RESULT_DIR.'/totalTraffic.png', $NOW - $START_AT, 0);
- $html .= "<p><img width=\"$xsize\" height=\"$ysize\" src=\"$IMG_URL"."totalTraffic.png\"></p>";
- $html .= "<p>Bandwidth usage for <a href=\"$IMG_URL"."totalTraffic9Months.html\">last 9 months</a> | ";
- $html .= " <a href=\"$IMG_URL"."totalTrafficMonthly.html\">last month</a> |";
- $html .= " <a href=\"$IMG_URL"."totalTrafficBiWeekly.html\">last 2 weeks</a></p>";
-}
+$html .= "<p><img width=\"$xsize\" height=\"$ysize\" src=\"$IMG_URL"."totalTraffic.png\"></p>";
+$html .= "<p>Bandwidth usage for <a href=\"$IMG_URL"."totalTrafficLong.html\">last $LONG_TIME_MONTHS months</a> | ";
+$html .= " <a href=\"$IMG_URL"."totalTrafficMonthly.html\">last month</a> |";
+$html .= " <a href=\"$IMG_URL"."totalTrafficBiWeekly.html\">last 2 weeks</a> |";
+$html .= " <a href=\"$IMG_URL"."totalTrafficWeekly.html\">last week</a></p>";
$html .= "<p>The directory is downloaded from ";
- $html .= "<a href=\"http://tor.noreply.org:9030/\">http://tor.noreply.org:9030/</a>";
+ $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/\">http://moria.mit.edu:9031/</a>";
+ $html .= "<a href=\"http://moria.mit.edu:9031/tor/\">http://moria.mit.edu:9031/tor/</a>";
$html .= " and\n";
- $html .= "<a href=\"http://moria.mit.edu:9032/\">http://moria.mit.edu:9032/</a>";
+ $html .= "<a href=\"http://belegost.mit.edu/tor/\">http://belegost.mit.edu/tor/</a>";
$html .= ".";
$html .= "<h1>Recent Nodes</h1>";
@@ -414,12 +400,14 @@ close F;
my %imgs = (
- total9Months => 'Number of routers over the last 9 months',
+ totalLong => 'Number of routers over the last '.$LONG_TIME_MONTHS.' months',
totalMonthly => 'Number of routers over the last month',
totalBiWeekly => 'Number of routers over the last 2 weeks',
- totalTraffic9Months => 'Traffic over the last 9 months',
+ totalWeekly => 'Number of routers over the last week',
+ totalTrafficLong => 'Traffic over the last '.$LONG_TIME_MONTHS.' months',
totalTrafficMonthly => 'Traffic over the last month',
- totalTrafficBiWeekly => 'Traffic over the last 2 weeks' );
+ totalTrafficBiWeekly => 'Traffic over the last 2 weeks',
+ totalTrafficWeekly => 'Traffic over the last week' );
for my $key (keys %imgs) {
open (F, ">$RESULT_DIR/$key.html") or die ("Cannot open $key.html: $!\n");
diff --git a/other/tor/bin/rrd-update b/other/tor/bin/rrd-update
index 7151641..c7062f7 100755
--- a/other/tor/bin/rrd-update
+++ b/other/tor/bin/rrd-update
@@ -2,7 +2,6 @@
use strict;
use RRDs;
-use BER;
use MIME::Base64;
use Digest::SHA1 qw(sha1_hex);
use Time::ParseDate;