[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [onionperf/master] Adds a tgen model for transferring 5m files in oneshot mode
commit a8df444ac2a320e9bc3d905a817efa1b696e0212
Author: Ana Custura <ana@xxxxxxxxxxxxx>
Date: Mon Jan 28 12:06:41 2019 +0000
Adds a tgen model for transferring 5m files in oneshot mode
---
onionperf/model.py | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/onionperf/model.py b/onionperf/model.py
index 07fd238..3c057c5 100644
--- a/onionperf/model.py
+++ b/onionperf/model.py
@@ -94,6 +94,30 @@ class TorperfModel(GeneratableTGenModel):
return g
+class OneshotModel(GeneratableTGenModel):
+
+ def __init__(self, tgen_port="8889", tgen_servers=["127.0.0.1:8888"], socksproxy=None):
+ self.tgen_port = tgen_port
+ self.tgen_servers = tgen_servers
+ self.socksproxy = socksproxy
+ self.graph = self.generate()
+
+ def generate(self):
+ server_str = ','.join(self.tgen_servers)
+ g = DiGraph()
+
+ g.add_node("start", serverport=self.tgen_port, peers=server_str, loglevel="info", heartbeat="1 minute")
+ if self.socksproxy is not None:
+ g.node["start"]["socksproxy"] = self.socksproxy
+ g.add_node("transfer5m", type="get", protocol="tcp", size="5 MiB", timeout="15 seconds", stallout="10 seconds")
+
+ g.add_edge("start", "transfer5m")
+ g.add_edge("transfer5m", "start")
+
+ return g
+
+
+
def dump_example_tgen_torperf_model(domain_name, onion_name):
# the server listens on 8888, the client uses Tor to come back directly, and using a hidden serv
server = ListenModel(tgen_port="8888")
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits