print timestamps in table
parent
548e6159fb
commit
4e898fe88f
2
panda
2
panda
|
@ -1 +1 @@
|
|||
Subproject commit ba10911dbc0a6f2c5c04886ca793f6ac38400cd3
|
||||
Subproject commit e6722c7f99b8f7b9f81bb0216edb88cc2e5ad7c0
|
|
@ -37,7 +37,7 @@ def plannerd_thread(sm=None, pm=None):
|
|||
|
||||
if sm.updated['modelV2']:
|
||||
frame_id = sm['modelV2'].frameId
|
||||
cloudlog.timestamp("Model updated", frame_id)
|
||||
cloudlog.timestamp("ModelV2 recived", frame_id)
|
||||
lateral_planner.update(sm)
|
||||
cloudlog.timestamp("lateral planner updated", frame_id)
|
||||
lateral_planner.publish(sm, pm)
|
||||
|
|
|
@ -9,6 +9,19 @@ json_file = open('timestamps.json')
|
|||
timestamps = json.load(json_file)
|
||||
|
||||
|
||||
for frame_id, services in timestamps.items():
|
||||
t0 = min([min(events.values())for events in services.values()])
|
||||
print(frame_id)
|
||||
d = defaultdict( lambda: ("",""))
|
||||
for service, events in services.items():
|
||||
for event, time in events.items():
|
||||
time = (time-t0)/1e6
|
||||
d[time] = (service, event)
|
||||
s = sorted(d.items())
|
||||
print(tabulate([[item[1][0], item[1][1], item[0]] for item in s], headers=["service", "event", "time"]))
|
||||
print()
|
||||
|
||||
exit()
|
||||
fig, gnt = plt.subplots()
|
||||
maxx = max([max([max(events.values()) for events in services.values()]) for services in timestamps.values()])/1e6
|
||||
gnt.set_xlim(0, 150)
|
||||
|
@ -26,13 +39,13 @@ for frame_id, services in timestamps.items():
|
|||
for service, events in services.items():
|
||||
start = min(events.values())
|
||||
end = max(events.values())
|
||||
service_bars.append(((start-t0)/1e6, (end-start)/1e6))
|
||||
#service_bars.append(((start-t0)/1e6, (end-start)/1e6))
|
||||
for event, time in events.items():
|
||||
t = (time-t0)/1e6
|
||||
event_bars.append((t, 1))
|
||||
event_bars.append((t, 0.1))
|
||||
avg_times[service+"."+event].append(t)
|
||||
print(" ", service+"."+event, t)
|
||||
gnt.broken_barh(service_bars, (count, 0.9), facecolors=("blue"))
|
||||
#gnt.broken_barh(service_bars, (count, 0.9), facecolors=("blue"))
|
||||
gnt.broken_barh(event_bars, (count, 0.9), facecolors=("black"))
|
||||
count+=1
|
||||
print(tabulate([[event, sum(times)/len(times), max(times), len(times)] for event, times in avg_times.items()], headers=["event", "avg", "max", "len"]))
|
||||
|
|
|
@ -6,9 +6,9 @@ import json
|
|||
from collections import defaultdict
|
||||
|
||||
|
||||
timestamps = defaultdict(lambda: defaultdict(lambda: defaultdict(int)))
|
||||
timestamps = defaultdict(lambda: defaultdict(lambda: defaultdict(list)))
|
||||
|
||||
r = Route("9f583b1d93915c31|2022-03-21--19-26-32")
|
||||
r = Route("9f583b1d93915c31|2022-03-22--15-13-06")
|
||||
lr = LogReader(r.log_paths()[0])
|
||||
|
||||
for msg in lr:
|
||||
|
@ -21,8 +21,18 @@ for msg in lr:
|
|||
service = jmsg['ctx']['daemon']
|
||||
event = jmsg['msg']['timestamp']['event']
|
||||
time = jmsg['msg']['timestamp']['time']
|
||||
timestamps[frame_id][service][event] = time
|
||||
timestamps[frame_id][service][event].append(time)
|
||||
except :
|
||||
print( msg)
|
||||
|
||||
del timestamps[0]
|
||||
|
||||
timestampsshort = defaultdict(lambda: defaultdict(lambda: defaultdict(int)))
|
||||
for frame_id, services in timestamps.items():
|
||||
for service, events in services.items():
|
||||
for event, times in events.items():
|
||||
timestampsshort[frame_id][service][event] = min(times)
|
||||
|
||||
|
||||
with open('timestamps.json', 'w') as outfile:
|
||||
json.dump(timestamps, outfile)
|
||||
json.dump(timestampsshort, outfile)
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue