Fix: consumerd: consumed size miscomputed during statistics sampling
[lttng-tools.git] / src / common / consumer / consumer-timer.cpp
index 8c9371bae780191207c345e3a39184f4b24c97ab..70094ef4f98e30c5da46e9c8b087e3bd5dfdd7da 100644 (file)
@@ -530,7 +530,7 @@ int consumer_timer_monitor_stop(struct lttng_consumer_channel *channel)
 
        ret = consumer_channel_timer_stop(&channel->monitor_timer, LTTNG_CONSUMER_SIG_MONITOR);
        if (ret == -1) {
-               ERR("Failed to stop live timer");
+               ERR("Failed to stop monitor timer");
                goto end;
        }
 
@@ -687,7 +687,8 @@ void sample_and_send_channel_buffer_stats(struct lttng_consumer_channel *channel
 
        msg.highest = highest;
        msg.lowest = lowest;
-       msg.consumed_since_last_sample = total_consumed - channel->last_consumed_size_sample_sent;
+       msg.consumed_since_last_sample =
+               total_consumed - channel->consumed_size_as_of_last_sample_sent;
 
        /*
         * Writes performed here are assumed to be atomic which is only
@@ -712,7 +713,7 @@ void sample_and_send_channel_buffer_stats(struct lttng_consumer_channel *channel
                    channel->key,
                    msg.highest,
                    msg.lowest);
-               channel->last_consumed_size_sample_sent = msg.consumed_since_last_sample;
+               channel->consumed_size_as_of_last_sample_sent = total_consumed;
        }
 }
 
This page took 0.028056 seconds and 4 git commands to generate.