Remove dead neighbor closeness benchmark

This commit is contained in:
Kevin F 2022-04-16 12:49:42 -05:00
parent a61cd273a8
commit 4caee50ce7

View File

@ -1,34 +0,0 @@
import sys, os
sys.path.append(".")
sys.path.append("src/")
import unittest, uuid
import subprocess
import time
TEST_DIR = 'testdata/%s-%s' % (uuid.uuid4(), os.path.basename(__file__)) + '/'
print("Test directory:", TEST_DIR)
os.environ["ONIONR_HOME"] = TEST_DIR
from utils import createdirs, identifyhome
from streamfill import identify_neighbors
onions = []
p = subprocess.Popen(["scripts/generate-onions.py", '50000'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
for line in iter(p.stdout.readline, b''):
line = line.decode()
onions.append(line.strip())
p.terminate()
p = subprocess.Popen(["scripts/generate-onions.py", '1'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
for line in iter(p.stdout.readline, b''):
us = line.decode().strip()
p.terminate()
start = time.time()
identify_neighbors(us, onions, 5)
print(time.time() - start)