add recvplotdiff
This commit is contained in:
parent
680ea99b6b
commit
d018e1cf1a
@ -233,12 +233,35 @@ def device_recvplot():
|
||||
last_ts = ts
|
||||
first = False
|
||||
continue
|
||||
print((ts - last_ts)/10**6,flush=True)
|
||||
print((ts - last_ts) / 10 ** 6, flush=True)
|
||||
last_ts = ts
|
||||
|
||||
|
||||
@device.command('recvplotdiff')
|
||||
def device_recvplotdiff():
|
||||
ctx = zmq.Context()
|
||||
pull = ctx.socket(zmq.PULL)
|
||||
pull.connect(C.live_push_socket)
|
||||
last_ts = 0
|
||||
max_interval = 0
|
||||
first = True
|
||||
while True:
|
||||
b = pull.recv()
|
||||
|
||||
ts, sequence_id, encoder, buffer = b2t(b)
|
||||
if first:
|
||||
last_ts = ts
|
||||
first = False
|
||||
continue
|
||||
max_interval = max(max_interval, ts - last_ts)
|
||||
print(max_interval / 10 ** 6, flush=True)
|
||||
last_ts = ts
|
||||
|
||||
|
||||
def b2b(b):
|
||||
return hashlib.blake2b(b, digest_size=4).hexdigest()
|
||||
|
||||
|
||||
@device.command('recvzero')
|
||||
def device_recvzero():
|
||||
ctx = zmq.Context()
|
||||
@ -251,12 +274,12 @@ def device_recvzero():
|
||||
while True:
|
||||
b = pull.recv()
|
||||
ts, sequence_id, encoder, buffer = b2t(b)
|
||||
if ts==last_ts:
|
||||
print('tszero', sequence_id, encoder, (ts - last_ts)/10**6,flush=True)
|
||||
print(b2b(b),b2b(last_b))
|
||||
if sequence_id==last_sequence_id:
|
||||
print('szero', sequence_id, encoder,flush=True)
|
||||
print(b2b(b),b2b(last_b))
|
||||
if ts == last_ts:
|
||||
print('tszero', sequence_id, encoder, (ts - last_ts) / 10 ** 6, flush=True)
|
||||
print(b2b(b), b2b(last_b))
|
||||
if sequence_id == last_sequence_id:
|
||||
print('szero', sequence_id, encoder, flush=True)
|
||||
print(b2b(b), b2b(last_b))
|
||||
last_ts = ts
|
||||
last_sequence_id = sequence_id
|
||||
last_b = b
|
||||
|
||||
Loading…
Reference in New Issue
Block a user