void _stats_pool_set_val(struct context *ctx, struct server_pool *pool, stats_pool_field_t fidx, int64_t val) { struct stats_metric *stm; stm = stats_pool_to_metric(ctx, pool, fidx); stm->value.counter = val; log_debug(LOG_VVVERB, "set val field '%.*s' to %"PRId64"", stm->name.len, stm->name.data, stm->value.counter); }
void _stats_pool_set_ts(struct context *ctx, struct server_pool *pool, stats_pool_field_t fidx, int64_t val) { struct stats_metric *stm; stm = stats_pool_to_metric(ctx, pool, fidx); ASSERT(stm->type == STATS_TIMESTAMP); stm->value.timestamp = val; log_debug(LOG_VVVERB, "set ts field '%.*s' to %"PRId64"", stm->name.len, stm->name.data, stm->value.timestamp); }
void _stats_pool_decr_by(struct context *ctx, struct server_pool *pool, stats_pool_field_t fidx, int64_t val) { struct stats_metric *stm; stm = stats_pool_to_metric(ctx, pool, fidx); ASSERT(stm->type == STATS_GAUGE); stm->value.counter -= val; log_debug(LOG_VVVERB, "decr by field '%.*s' to %"PRId64"", stm->name.len, stm->name.data, stm->value.counter); }
void _stats_pool_incr(struct context *ctx, struct server_pool *pool, stats_pool_field_t fidx) { struct stats_metric *stm; stm = stats_pool_to_metric(ctx, pool, fidx); ASSERT(stm->type == STATS_COUNTER || stm->type == STATS_GAUGE); stm->value.counter++; log_debug(LOG_VVVERB, "incr field '%.*s' to %"PRId64"", stm->name.len, stm->name.data, stm->value.counter); }
void _stats_pool_set(struct context *ctx, struct server_pool *pool, stats_pool_field_t fidx, int64_t val) { struct stats_metric *stm; stm = stats_pool_to_metric(ctx, pool, fidx); ASSERT(stm->type == STATS_NUMERIC); stm->value.numeric = val; log_debug(LOG_VVVERB, "set field '%.*s' to %"PRId64"", stm->name.len, stm->name.data, stm->value.numeric); }