con / duct

A helper to run a command, capture stdout/stderr and details about running
MIT License
1 stars 1 forks source link

Question regarding the intended behavior of `update_max_resources()` for "timestamp" fields #99

Open jwodder opened 2 weeks ago

jwodder commented 2 weeks ago

Currently, Report.update_max_resources() handles the "timestamp" fields in process stat dicts by just selecting the larger (i.e., later) of the two. However, this does not seem very useful or sensible; if any of a process's stats decrease between samplings, the timestamp will end up having no relation to one of more of the "max" stats. Just what is the desired behavior for timestamps here?

CC @asmacdo @yarikoptic

asmacdo commented 2 weeks ago

Its not useful, but I figured it doesn't do any harm, and it was simpler to just iterate over all fields. The timestamp in the intermediate sample is always the timestamp of the last sample collected, but these intermediate samples aren't reported until the is written, so effectively the report timestamp is the timestamp of the final sample collected.

We don't include timestamp in the maxes, so AFAICT its not incorrect even if it is a little clunky.