From 40f6d198fa2cf10c4e24d3a97e351417dd2184a2 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Sun, 20 Mar 2016 18:49:11 -0700 Subject: [PATCH] Even better precision on benchmarker concurrency --- testproject/benchmark.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/testproject/benchmark.py b/testproject/benchmark.py index dae3380..8ddc3d6 100644 --- a/testproject/benchmark.py +++ b/testproject/benchmark.py @@ -12,6 +12,11 @@ stats = {} class MyClientProtocol(WebSocketClientProtocol): + def __init__(self, *args, **kwargs): + WebSocketClientProtocol.__init__(self, *args, **kwargs) + self.fingerprint = "".join(random.choice("abcdefghijklmnopqrstuvwxyz") for i in range(16)) + stats[self.fingerprint] = {} + def onConnect(self, response): self.opened = time.time() self.sent = 0 @@ -20,8 +25,6 @@ class MyClientProtocol(WebSocketClientProtocol): self.corrupted = 0 self.out_of_order = 0 self.latencies = [] - self.fingerprint = "".join(random.choice("abcdefghijklmnopqrstuvwxyz") for i in range(16)) - stats[self.fingerprint] = {} def onOpen(self): def hello():