Skip to content
Commit d3efcbd3 authored by Jukka Rissanen's avatar Jukka Rissanen Committed by Anas Nashif
Browse files

net: prometheus: Remove need to have separate metric struct



Embed "struct prometheus_metric" to individual metric like
counter, gauge, histogram and summary. This way we avoid having
a separate base pointer in specific metrict struct. We also do
not need to search the specific metric from base metric as
we can simply use CONTAINER_OF() macro to get the base metric.

This embedding means that the counter, gauge, histogram and summary
metric define macros are changed as user does not need to create a
separate "struct prometheus_metric".

Convert the tests and sample to use the new macros.

Remove also the static from metric creation macros so that user
can decide whether it needs collector to be static or not.

Signed-off-by: default avatarJukka Rissanen <jukka.rissanen@nordicsemi.no>
parent 5282ccaa
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment