Human-readable processing times in WorkerActivity stats
Closes #1273 (closed)
I added a new helper to parse timedeltas, another to return more than one unit at once to get higher precision, and found a bug in another helper where microseconds where multiplied by 10. The higher precision includes support for milliseconds because 31% of worker activities in prod and 10% in demo are below one second, so just displaying "0 seconds" all the time is not really useful.
I also updated the types for WorkerActivities to use the NullableProperties
helper I wrote for !1518 (merged), because the processing times are all either string
or null
but not a mix of both at the same time. They were typed as only string
, ignoring the null
case. Ideally, I would have typed them as always being null when there are zero processed activities and always strings otherwise, but TypeScript does not support numeric range types yet, so we can't say "strictly positive number".