/* simple name=tag stat create/update */ void stats_event(const char *source, const char *name, const char *value) { stats_event_t *event; event = build_event (source, name, value); if (event) queue_global_event (event); }
/* decrease the value in the provided stat by 1 */ void stats_event_dec(const char *source, const char *name) { /* ICECAST_LOG_DEBUG("%s on %s", name, source==NULL?"global":source); */ stats_event_t *event = build_event (source, name, NULL); if (event) { event->action = STATS_EVENT_DEC; queue_global_event (event); } }
/* increase the value in the provided stat by 1 */ void stats_event_inc(const char *source, const char *name) { stats_event_t *event = build_event (source, name, NULL); /* DEBUG2("%s on %s", name, source==NULL?"global":source); */ if (event) { event->action = STATS_EVENT_INC; queue_global_event (event); } }
void stats_event_sub(const char *source, const char *name, unsigned long value) { stats_event_t *event = build_event (source, name, NULL); if (event) { event->value = malloc (16); snprintf(event->value, 16, "%lu", value); event->action = STATS_EVENT_SUB; queue_global_event (event); } }
void stats_event_add(const char *source, const char *name, unsigned long value) { stats_event_t *event = build_event (source, name, NULL); /* ICECAST_LOG_DEBUG("%s on %s", name, source==NULL?"global":source); */ if (event) { event->value = malloc (16); snprintf(event->value, 16, "%lu", value); event->action = STATS_EVENT_ADD; queue_global_event (event); } }
/* simple name=tag stat create/update */ void stats_event(const char *source, const char *name, const char *value) { stats_event_t *event; if (value && xmlCheckUTF8 ((unsigned char *)value) == 0) { ICECAST_LOG_WARN("seen non-UTF8 data, probably incorrect metadata (%s, %s)", name, value); return; } event = build_event(source, name, value); if (event) queue_global_event(event); }
/* make stat hidden (non-zero). name can be NULL if it applies to a whole * source stats tree. */ void stats_event_hidden (const char *source, const char *name, int hidden) { stats_event_t *event; const char *str = NULL; if (hidden) str = ""; event = build_event (source, name, str); if (event) { event->action = STATS_EVENT_HIDDEN; queue_global_event (event); } }