bug fixes

latency_logging_2
Lukas Petersson 2022-03-25 13:32:14 -07:00
parent 63ae6ef0d1
commit 5c4e1d4c80
5 changed files with 8 additions and 10 deletions

View File

@ -165,12 +165,12 @@ class SwagLogger(logging.Logger):
else:
self.info(evt)
def timestamp(self, event_name, frame_id, translate=False,*args, **kwargs):
def timestamp(self, event_name, frame_id, translate=False, time=0,*args, **kwargs):
tstp = NiceOrderedDict()
tstp['timestamp'] = NiceOrderedDict()
tstp['timestamp']["event"] = event_name
tstp['timestamp']["frameId"] = frame_id
tstp['timestamp']["time"] = sec_since_boot()*1e9
tstp['timestamp']["time"] = time if time else sec_since_boot()*1e9
tstp['timestamp']["translate"] = translate
if args:
tstp['timestamp']['args'] = args

View File

@ -36,13 +36,11 @@ def plannerd_thread(sm=None, pm=None):
sm.update()
if sm.updated['modelV2']:
frame_id = sm['modelV2'].frameId
cloudlog.timestamp("ModelV2 recived", frame_id)
lateral_planner.update(sm)
cloudlog.timestamp("lateral planner updated", frame_id)
cloudlog.timestamp("lateral planner updated", sm['modelV2'].frameId)
lateral_planner.publish(sm, pm)
longitudinal_planner.update(sm)
cloudlog.timestamp("longitudinal planner updated",frame_id)
cloudlog.timestamp("longitudinal planner updated",sm['modelV2'].frameId)
longitudinal_planner.publish(sm, pm)

View File

@ -178,8 +178,8 @@ def logTimestamps(sm, events):
pubTime = sm.logMonoTime[event]
recTime = sm.rcv_time[event] * 1e9
if event != "sendcan":
cloudlog.timestamp(event+": Published", sm[event].frameId, False time=pubTime)
cloudlog.timestamp(event+": Received", sm[event].frameId, False time=recTime)
cloudlog.timestamp(event+": Published", sm[event].frameId, False, time=pubTime)
cloudlog.timestamp(event+": Received", sm[event].frameId, False, time=recTime)
else:
cloudlog.timestamp(event+": Published", sm.logMonoTime[event], True, time=pubTime)
cloudlog.timestamp(event+": Published", sm.logMonoTime[event], True, time=recTime)

View File

@ -14,7 +14,7 @@ translationdict = {}
#r = Route("9f583b1d93915c31|2022-03-23--14-47-10") clean commit
#r = Route("9f583b1d93915c31|2022-03-24--19-31-10") current (no pub tlogs) update()
#r = Route("9f583b1d93915c31|2022-03-24--20-10-09") # current update(0)
r = Route("9f583b1d93915c31|2022-03-25--11-59-11") # rec and pub
r = Route("9f583b1d93915c31|2022-03-25--13-09-51") # rec and pub
lr = LogReader(r.log_paths()[0])
for msg in lr:

File diff suppressed because one or more lines are too long