RFR: 1552: Log relevant timer numbers [v2]

Erik Joelsson erikj at openjdk.org
Tue Aug 30 18:18:30 UTC 2022


> 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.

Erik Joelsson has updated the pull request incrementally with one additional commit since the last revision:

  Added comment, adjusted message, based on review

-------------

Changes:
  - all: https://git.openjdk.org/skara/pull/1361/files
  - new: https://git.openjdk.org/skara/pull/1361/files/2cb0aee7..c22000d0

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=skara&pr=1361&range=01
 - incr: https://webrevs.openjdk.org/?repo=skara&pr=1361&range=00-01

  Stats: 6 lines in 2 files changed: 5 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/skara/pull/1361.diff
  Fetch: git fetch https://git.openjdk.org/skara pull/1361/head:pull/1361

PR: https://git.openjdk.org/skara/pull/1361


More information about the skara-dev mailing list