case DS_TYPE_DERIVE:
ce->values_gauge = NAN;
- //ce->values_raw.derive = m->value.derive;
+ // ce->values_raw.derive = m->value.derive;
ce->distribution_increase = NULL;
/* TODO: METRIC_TYPE_DERIVE? */
break;
switch (m->family->type) {
case METRIC_TYPE_COUNTER: {
- counter_t diff = counter_diff(ce->values_raw.value.counter, m->value.counter);
+ counter_t diff =
+ counter_diff(ce->values_raw.value.counter, m->value.counter);
ce->values_gauge =
((double)diff) / (CDTIME_T_TO_DOUBLE(m->time - ce->last_time));
ce->values_raw.value.counter = m->value.counter;
return status;
}
distribution_destroy(ce->values_raw.value.distribution);
- ce->values_raw.value.distribution = distribution_clone(m->value.distribution);
+ ce->values_raw.value.distribution =
+ distribution_clone(m->value.distribution);
break;
}
#if 0
name);
status = -1;
} else {
- if (ce->distribution_increase == NULL &&
- ce->values_raw.value.distribution !=
- NULL) { /* check if the cache entry is not the distribution */
+ if (ce->values_raw.type !=
+ METRIC_TYPE_DISTRIBUTION) { /* check if the cache entry is not the
+ distribution */
pthread_mutex_unlock(&cache_lock);
ERROR("uc_get_percentile: Don't know how to handle data source type "
"that is not the distribution.");
status = -1;
} else {
- if (ce->distribution_increase == NULL &&
- ce->values_raw.value.distribution !=
- NULL) { /* check if the cache entry is not the distribution */
+ if (ce->values_raw.type !=
+ METRIC_TYPE_DISTRIBUTION) { /* check if the cache entry is not the
+ distribution */
*ret_values = ce->values_gauge;
} else { /* in case where metric is a distribution, we
assume that the rate is the middle value */