Commit 142e1ad4 authored by Cecylia Bocovich's avatar Cecylia Bocovich
Browse files

Removed bandwidth log from makecsv

Updated readme and removed total bandwidth time measurements from
bridgetest and makecsv because we use pcap files to get a more accurate
idea of throughput.
parent 7e4bf94e
#Python 2.7 and related packages
apt install python python-pip
pip install stem
#Python 3 and related packages
apt install python python-pip3
pip3 install stem
#obfs4 and tor
apt install obfs4proxy tor torsocks
......@@ -18,7 +18,7 @@ Add to crontab to run tests 4x a day:
0 */6 * * * cd ~/bridgetest && ./ [SITENAME]
Generate a CSV file from logs:
find log -name '*.log' | sort | ./makecsv > bridgetest.csv 2> bandwidth.csv
find log -name '*.log' | sort | ./makecsv > bridgetest.csv
Make a graph:
Rscript graph.R bridgetest.csv
......@@ -54,16 +54,9 @@ def download_file(socks_port):"Attempting to download large file")
start = time.time()["/usr/bin/torsocks", "-P", str(socks_port), "wget", "-O", "/dev/null", LARGE_FILE_URL], check=True)
stop = time.time()
download_time = stop - start
except subprocess.CalledProcessError as e:"failed to download file: %s", e)
download_time = -1
return download_time
def start_tor(tor_config):
......@@ -154,10 +147,7 @@ with open(bridge_lines_file) as f:
#Now try a large file download
download_time = download_file(socks_port)
f = open(os.path.join(".", "%s.log" % nickname), 'a')
f.write("Downloaded " + str(download_time) + "s\n")
......@@ -12,18 +12,13 @@ locale.setlocale(locale.LC_ALL, "C")
# Dec 01 20:57:53.000 [notice] Bootstrapped 0%: Starting
bootstrapped_re = re.compile(r'^(\w+ \d+ \d\d:\d\d:\d\d\.\d\d\d) \[\w+\] Bootstrapped (\d+)%')
bandwidth_re = re.compile(r'^Downloaded (-?\d+.\d+)s')
csvW = csv.DictWriter(sys.stdout, fieldnames=("timestamp", "site", "runid", "nickname", "percent"))
csvE = csv.DictWriter(sys.stderr, fieldnames=("site", "runid", "nickname", "download"))
def process_log(f, site, runid, nickname):
for line in f:
m = bootstrapped_re.match(line)
n = bandwidth_re.match(line)
if m is not None:
timestamp = datetime.datetime.strptime(, "%b %d %H:%M:%S.%f")
......@@ -39,16 +34,6 @@ def process_log(f, site, runid, nickname):
"percent": percent,
elif n is not None:
download_time =
row = {
"site": site,
"runid": runid,
"nickname": nickname,
"download": download_time,
for filename in sys.stdin:
filename = filename.strip()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment