diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-06-10 18:28:10 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-06-10 18:28:10 +0000 |
commit | b87a7760e03c81d1c9a853b29863f92f1a50596d (patch) | |
tree | c9ce7fc041498abb95e6a863a2749510b55bd59a /src/or/geoip.c | |
parent | d0a4ad3a1cda334f5213b5abdd4d15483d3eb805 (diff) | |
download | tor-b87a7760e03c81d1c9a853b29863f92f1a50596d.tar.gz tor-b87a7760e03c81d1c9a853b29863f92f1a50596d.zip |
r16129@tombo: nickm | 2008-06-10 14:28:06 -0400
More geoip tweaks. Include in the file a rough estimator of our total share.
svn:r15099
Diffstat (limited to 'src/or/geoip.c')
-rw-r--r-- | src/or/geoip.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/or/geoip.c b/src/or/geoip.c index c3bde4f226..49250a7648 100644 --- a/src/or/geoip.c +++ b/src/or/geoip.c @@ -528,6 +528,7 @@ dump_geoip_stats(void) char *data_v2 = NULL, *data_v3 = NULL; char since[ISO_TIME_LEN+1], written[ISO_TIME_LEN+1]; open_file_t *open_file = NULL; + double v2_share = 0.0, v3_share = 0.0; FILE *out; data_v2 = geoip_get_client_history(now, GEOIP_CLIENT_NETWORKSTATUS_V2); @@ -554,6 +555,12 @@ dump_geoip_stats(void) since, data_v3 ? data_v3 : "", data_v2 ? data_v2 : "") < 0) goto done; + if (!router_get_my_share_of_directory_requests(&v2_share, &v3_share)) { + if (fprintf(out, "v2-ns-share %0.2lf%%\n", v2_share*100) < 0) + goto done; + if (fprintf(out, "v3-ns-share %0.2lf%%\n", v3_share*100) < 0) + goto done; + } finish_writing_to_file(open_file); open_file = NULL; |