Conversation
Codecov Report
@@ Coverage Diff @@
## master #63 +/- ##
==========================================
- Coverage 95.81% 95.69% -0.13%
==========================================
Files 30 31 +1
Lines 1243 1278 +35
Branches 196 204 +8
==========================================
+ Hits 1191 1223 +32
- Misses 23 24 +1
- Partials 29 31 +2
Continue to review full report at Codecov.
|
aw_transform/chunk_events_by_key.py
Outdated
| for event in events: | ||
| if key not in event.data: | ||
| pass | ||
| elif len(chunked_events) == 0 or chunked_events[-1].data[key] != event.data[key]: |
There was a problem hiding this comment.
One thing that always confused me about chunking before, and still does, is how it results in the timeline not showing any eventual gap between two events with the same chunk-key. Could we do anything about that?
Maybe add a pulsetime-like argument that doesn't chunk events if separated by a significant time?
There was a problem hiding this comment.
Good point, will fix
aw_transform/sort_by.py
Outdated
| def sum_durations(events) -> timedelta: | ||
| s = timedelta() | ||
| for event in events: | ||
| s += event.duration |
There was a problem hiding this comment.
Could be done simply like: return sum(event.duration for event in events) if events else timedelta()
There was a problem hiding this comment.
Since the function should always return a timedelta I wrote:
timedelta(seconds=(sum(event.duration.total_seconds() for event in events)))
With chunk_events_by_key we can finally remove the chunking in aw-webui for the timeline