In to_string.h we have a operator<<(std::ostream& o, const ss::lowres_clock::duration& d) overload which casts down to milliseconds and prints the value without units.
This was bad but mostly not awful when lowres_clock was measured in ms, but now that it's in ns, it just produces totally unexpected and wrong results.
Time should be printed without down-casting and with units (among other possible options).
How to reproduce the issue?
Examine the code.
Additional information
This occurred in part because lowres_clock switched its definition from a coarse definition (ms-resolution) to a fine-grained unit of nanoseconds quite some time ago.
This issue hasn't seen activity in 3 months. If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in two weeks.
Version & Environment
Redpanda version: 23.2
What went wrong?
In
to_string.h
we have aoperator<<(std::ostream& o, const ss::lowres_clock::duration& d)
overload which casts down to milliseconds and prints the value without units.This was bad but mostly not awful when lowres_clock was measured in ms, but now that it's in ns, it just produces totally unexpected and wrong results.
See:
https://redpandadata.slack.com/archives/C044RD18NMV/p1668035746200669
What should have happened instead?
Time should be printed without down-casting and with units (among other possible options).
How to reproduce the issue?
Additional information
This occurred in part because lowres_clock switched its definition from a coarse definition (ms-resolution) to a fine-grained unit of nanoseconds quite some time ago.
JIRA Link: CORE-1369