RFR: 1551: Improve logging and metrics for BotRunner [v2]

Kevin Rushforth kcr at openjdk.org
Fri Aug 19 20:57:15 UTC 2022

On Fri, 19 Aug 2022 20:01:34 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

>> 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.
> Erik Joelsson has updated the pull request incrementally with one additional commit since the last revision:
>   Fix failing test

Changes looks reasonable.


Marked as reviewed by kcr (Reviewer).

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

More information about the skara-dev mailing list