Lines Matching refs:metric

27 					 struct prometheus_metric *metric)  in prometheus_collector_register_metric()  argument
29 if (!collector || !metric) { in prometheus_collector_register_metric()
34 LOG_DBG("Registering metric type=%d name=\"%s\"", metric->type, metric->name); 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()
117 struct prometheus_metric *metric; in prometheus_collector_get_metric() local
126 SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&collector->metrics, metric, tmp, node) { in prometheus_collector_get_metric()
128 if (strncmp(metric->name, name, strlen(metric->name)) == 0) { in prometheus_collector_get_metric()
129 type = metric->type; in prometheus_collector_get_metric()
132 LOG_DBG("metric found: %s", metric->name); in prometheus_collector_get_metric()
146 return CONTAINER_OF(metric, struct prometheus_counter, base); in prometheus_collector_get_metric()
148 return CONTAINER_OF(metric, struct prometheus_gauge, base); in prometheus_collector_get_metric()
150 return CONTAINER_OF(metric, struct prometheus_histogram, base); in prometheus_collector_get_metric()
152 return CONTAINER_OF(metric, struct prometheus_summary, base); in prometheus_collector_get_metric()
181 ctx->metric = Z_GENLIST_PEEK_HEAD_CONTAINER(slist, in prometheus_collector_walk_metrics()
183 ctx->metric, in prometheus_collector_walk_metrics()
186 ctx->metric, in prometheus_collector_walk_metrics()
193 ctx->metric = ctx->tmp; in prometheus_collector_walk_metrics()
195 ctx->metric, in prometheus_collector_walk_metrics()
198 if (ctx->metric == NULL) { in prometheus_collector_walk_metrics()
205 ret = ctx->collector->user_cb(ctx->collector, ctx->metric, in prometheus_collector_walk_metrics()
218 ret = prometheus_format_one_metric(ctx->metric, buffer, buffer_size, &len); in prometheus_collector_walk_metrics()