RFR: 1552: Log relevant timer numbers
Magnus Ihse Bursie
ihse at openjdk.org
Tue Aug 30 14:59:52 UTC 2022
On Tue, 23 Aug 2022 23:20:26 GMT, Erik Joelsson <erikj at openjdk.org> wrote:
> This is a pretty big patch, but it shouldn't be too scary as it's only supposed to change logging, mainly by adding more logging (and also removing some now redundant log calls).
> The main focus here is to add structured timing data to some log messages. To do this, I'm using the optional `parameters` `Object` that you can supply to the logger from `java.util.logging`. If the LogstashHandler finds a `Duration` instance in that array, it will add it as a "duration" field in the logstash log document. In the BotRunner, we were already using parameters for a different purpose, so it got a little bit messy, but I think it's ok.
> There are two kinds of timings I'm adding logging for. The obvious one is timing external HTTP calls and running processes, as well as total running/pending/scheduled times for WorkItems and getPeriodicItems in the BotRunner. The other kind are more complex as I'm trying to measure the user perceived latency from when a PR or bug is updated to when the bot actually reacts with a response to that update. This is of course tricky to get right and needs to be carefully implemented for each instance, but I believe I have at least added some reasonably relevant approximations that will make sense to measure and track. To generate these, I had to introduce a new field in various WorkItems that stores the timestamp from the external change that triggered it (e.g. `prUpdatedAt`).
> In addition to this, there are a ton more regular log messages, mostly on info level, that detail actions performed by various WorkItems. This is something I have been missing a lot when browsing logs.
Overall looks good to me.
Marked as reviewed by ihse (Reviewer).
More information about the skara-dev