Hi Morten, Morten Brørup, Nov 23, 2022 at 12:52: > This patch is based on a "gauge" (i.e. the busyness percentage) and an > "interval" (i.e. the duration the gauge covers). I have to sample this > gauge exactly every interval to collect data for a busyness chart. If > the application's reporting interval is 1 second, I must sample the > gauge every second, or statistical information will be lost. > > Instead, I would prefer the callback to return two counters: > units_passed (e.g. number of cycles since application start) and > units_busy (e.g. number of busy cycles since application start). > > I can sample these at any interval, and calculate the busyness of that > interval as the difference: (units_busy - units_busy_before) > / (units_passed - units_passed_before). > > If needed, I can also sample them at multiple intervals, e.g. every 1, > 5 and 10 minutes, and expose in the "loadavg". > > I can also sample them every millisecond if I need to react quickly to > a sudden increase/drop in busyness.
Your proposal makes a lot of sense and it will even be easier to implement for applications. I'll do that for v2. Thanks for the feedback.