mirror of
https://github.com/django/daphne.git
synced 2025-07-11 08:22:17 +03:00
Even better precision on benchmarker concurrency
This commit is contained in:
parent
808231cdc5
commit
40f6d198fa
|
@ -12,6 +12,11 @@ stats = {}
|
||||||
|
|
||||||
class MyClientProtocol(WebSocketClientProtocol):
|
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):
|
def onConnect(self, response):
|
||||||
self.opened = time.time()
|
self.opened = time.time()
|
||||||
self.sent = 0
|
self.sent = 0
|
||||||
|
@ -20,8 +25,6 @@ class MyClientProtocol(WebSocketClientProtocol):
|
||||||
self.corrupted = 0
|
self.corrupted = 0
|
||||||
self.out_of_order = 0
|
self.out_of_order = 0
|
||||||
self.latencies = []
|
self.latencies = []
|
||||||
self.fingerprint = "".join(random.choice("abcdefghijklmnopqrstuvwxyz") for i in range(16))
|
|
||||||
stats[self.fingerprint] = {}
|
|
||||||
|
|
||||||
def onOpen(self):
|
def onOpen(self):
|
||||||
def hello():
|
def hello():
|
||||||
|
|
Loading…
Reference in New Issue
Block a user