RFR: 1551: Improve logging and metrics for BotRunner

Erik Joelsson erikj at openjdk.org
Fri Aug 19 19:57:06 UTC 2022


I'm trying to better understand bot performance. I'm sure there are lots of things we could improve performance wise, but first we need to figure out how. We already have some logging and metrics gathering, but it's still not providing me with the information I need.

With this change, I'm aiming to gather better metrics and logging around the getPeriodicItems() call, as well as refining the metrics for running WorkItems.

The thread user time measurements from MX beans is useless to me, so I'm removing it. The cpu time is probably also useless, but I'm keeping it for now. What I really want is wall clock time for WorkItems, so I'm adding that. The gauges for measuring any kind of running time aren't useful at all. At least with counters, we can get some kind of idea how much time is spent on each kind of WorkItem over some time frame (using a rate function in the presentation layer).

To complement the timing counters, I'm adding simple WorkItem counters as well, to keep track how many are scheduled, added as pending, submitted and finished.

For the BotRunner.checkPeriodicItems() method, I'm adding two metrics. Since the whole method is running only one at a time, a gauge for tracking how long each round takes does make sense. Then for each sub call to Bot.getPeriodicItems there is a counter that basically gives the breakdown on how much of the time is spent in each kind of bot.

For logging, I'm adding some more log messages to better track which Bot.getPeriodic item is called when, and a LogContext, so that all log messages are tagged with the bot toString, just like WorkItems are already. To support this I had to add toString() methods to all Bot implementations that were missing it.

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

Commit messages:
 - Rename counter
 - More counters
 - Adding log context for each getPeriodicItems() call and toString() to all Bots
 - More metrics

Changes: https://git.openjdk.org/skara/pull/1359/files
 Webrev: https://webrevs.openjdk.org/?repo=skara&pr=1359&range=00
  Issue: https://bugs.openjdk.org/browse/SKARA-1551
  Stats: 117 lines in 12 files changed: 76 ins; 29 del; 12 mod
  Patch: https://git.openjdk.org/skara/pull/1359.diff
  Fetch: git fetch https://git.openjdk.org/skara pull/1359/head:pull/1359

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


More information about the skara-dev mailing list