storaged: use correct accumulate variable for publishing disk stats

In the publish function, the variable mAccumulate_pub is used to log
disk performance. However, the variable mAccumulate is used to log disk
stats. The variable mAccumulate is only populated during a stall event.
The publish function is used to log disk stats on a periodic timer,
therefore, it should not rely on stall events to log stats. Instead,
it should rely on the appropriately named mAccumulate_pub variable.

Test: storaged unit tests

Change-Id: I30e00f2c69618705d3f308630b7e023bfc5e384e
Signed-off-by: David Munoz Constantine <dmunozc@squareup.com>
This commit is contained in:
David Munoz Constantine 2023-02-13 12:50:23 -08:00
parent 77f4cb4db0
commit 360a3f67c4

View file

@ -312,7 +312,7 @@ void disk_stats_monitor::publish(void)
{
struct disk_perf perf = get_disk_perf(&mAccumulate_pub);
log_debug_disk_perf(&perf, "regular");
log_event_disk_stats(&mAccumulate, "regular");
log_event_disk_stats(&mAccumulate_pub, "regular");
// Reset global structures
memset(&mAccumulate_pub, 0, sizeof(struct disk_stats));
}