Browse Source

Update source

master
trackingv2 4 months ago
parent
commit
845d471185
  1. 4
      plotter.py
  2. 4
      plotter2.py
  3. 2
      trackingv2.py

4
plotter.py

@ -6,12 +6,12 @@ import matplotlib.pyplot as plt
from shutil import copyfile
x_axis='datetime'
y_axes=['v2','nonv2']
y_axes=['v2','nonv2','all']
df = pd.read_csv("/home/trackingv2/trackingv2.csv")
filter = [x_axis] + y_axes
title = "Tracking how many Tor HSDirs run a version that is non-v2"
df[filter].plot(kind="line", x=x_axis, title=title, grid=True, rot=20, figsize=(6,5))
df[filter].plot.line(x=x_axis, title=title, grid=True, rot=20, figsize=(6,5))
plt.savefig("/var/www/data/plot.png")
copyfile("/home/trackingv2/trackingv2.csv", "/var/www/data/v2.csv")

4
plotter2.py

@ -13,9 +13,9 @@ with open("/home/trackingv2/trackingv2.csv", "r") as f:
writer = csv.writer(write)
writer.writerow(["fraction_nonv2", "datetime"])
for row in reader:
per = int(row[1]) / (int(row[0])+int(row[1]))
per = int(row[1]) / int(row[2])
per = round(per, 4)
writer.writerow([per, row[2]])
writer.writerow([per, row[3]])
x_axis='datetime'
y_axis='fraction_nonv2'

2
trackingv2.py

@ -38,7 +38,7 @@ while True:
dt = datetime.datetime.utcnow().strftime("%Y/%m/%d %H")
with open("/home/trackingv2/trackingv2.csv", "a") as csvFile:
csvFile.write("{},{},{}\n".format(numberOfv2, numberOfNonv2,dt))
csvFile.write("{},{},{},{}\n".format(numberOfv2, numberOfNonv2, numberOfHSDir, dt))
#print("Num HSDir: {}".format(numberOfHSDir))
#print("< 0.4.6: {}".format(numberOfv2))

Loading…
Cancel
Save