Lines Matching refs:collector

26 int prometheus_collector_register_metric(struct prometheus_collector *collector,  in prometheus_collector_register_metric()  argument
29 if (!collector || !metric) { in prometheus_collector_register_metric()
36 k_mutex_lock(&collector->lock, K_FOREVER); in prometheus_collector_register_metric()
39 (void)sys_slist_find_and_remove(&collector->metrics, &metric->node); in prometheus_collector_register_metric()
41 sys_slist_prepend(&collector->metrics, &metric->node); in prometheus_collector_register_metric()
43 k_mutex_unlock(&collector->lock); in prometheus_collector_register_metric()
112 const void *prometheus_collector_get_metric(struct prometheus_collector *collector, in prometheus_collector_get_metric() argument
120 if (collector == NULL || name == NULL) { in prometheus_collector_get_metric()
124 k_mutex_lock(&collector->lock, K_FOREVER); in prometheus_collector_get_metric()
126 SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&collector->metrics, metric, tmp, node) { in prometheus_collector_get_metric()
137 k_mutex_unlock(&collector->lock); in prometheus_collector_get_metric()
167 if (ctx->collector == NULL) { in prometheus_collector_walk_metrics()
173 k_mutex_lock(&ctx->collector->lock, K_FOREVER); in prometheus_collector_walk_metrics()
182 &ctx->collector->metrics, in prometheus_collector_walk_metrics()
204 if (ctx->collector->user_cb) { in prometheus_collector_walk_metrics()
205 ret = ctx->collector->user_cb(ctx->collector, ctx->metric, in prometheus_collector_walk_metrics()
206 ctx->collector->user_data); in prometheus_collector_walk_metrics()
229 k_mutex_unlock(&ctx->collector->lock); in prometheus_collector_walk_metrics()