Code

src/common.c: rate_to_value: Update last_time and fix type of delta_gauge.
authorFlorian Forster <octo@collectd.org>
Mon, 2 Jul 2012 15:55:24 +0000 (11:55 -0400)
committerFlorian Forster <octo@collectd.org>
Mon, 2 Jul 2012 15:55:24 +0000 (11:55 -0400)
src/common.c

index 4ca58d5527b103e07f110300b273dacac153be3f..9098de5908db7bbb306915b8cc0480263774d1e1 100644 (file)
@@ -1236,7 +1236,7 @@ int rate_to_value (value_t *ret_value, gauge_t rate, /* {{{ */
                rate_to_value_state_t *state,
                int ds_type, cdtime_t t)
 {
-       derive_t delta_gauge;
+       gauge_t delta_gauge;
        cdtime_t delta_t;
 
        if (ds_type == DS_TYPE_GAUGE)
@@ -1322,6 +1322,7 @@ int rate_to_value (value_t *ret_value, gauge_t rate, /* {{{ */
                assert (23 == 42);
        }
 
+        state->last_time = t;
        *ret_value = state->last_value;
        return (0);
 } /* }}} value_t rate_to_value */