metrics.h — Metrics definitions header
Metrics
#include <metrics.h>
The <metrics.h> header shall include definitions for at least the following types:
metrics_metric_id_t: Used to identify a metric.
metrics_metricset_t: Used to identify a metric set.
The <metrics.h> header shall define the metrics_measurement_t structure that includes at least the following members:
metrics_metric_id_t metric_id; pthread_t thread_id; struct timespec duration; struct timespec begin; struct timespec end; int events_count; int id;
The <metrics.h> header shall define the following symbols:
Maximum length of a metric name. Minimum acceptable value: {_METRICS_NAME_MAX}
Maximum length of a metric description. Minimum acceptable value: {_METRICS_DESCRIPTION_MAX}
Value 64
Value 256
The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.
int metrics_metric_open (const char *metric_name, metrics_metric_id_t *metric_id); int metrics_metric_getname (metrics_metric_id_t metric_id, char *metric_name); int metrics_metric_getdescription (metrics_metric_id_t metric_id, char *metric_description); int metrics_metricset_empty (metrics_metricset_t *set); int metrics_metricset_fill (metrics_metricset_t *set); int metrics_metricset_add (metrics_metric_id_t metric_id, metrics_metricset_t *set); int metrics_metricset_del (metrics_metric_id_t metric_id, metrics_metricset_t *set); int metrics_metricset_ismember (metrics_metric_id_t metric_id, const metrics_metricset_t *set, int *ismember); int metrics_metricset_iterator_getnext (metrics_metricset_t *set, metrics_metric_id_t *metric_id, int *unavailable); int metrics_metricset_iterator_rewind (metrics_metricset_t *set); int metrics_init (trace_id_t trid, const metrics_metricset_t *set); int metrics_destroy (void); int metrics_getnext_measurement (metrics_measurement_t *result, int *unavailable); int metrics_trygetnext_measurement (metrics_measurement_t *result, int *unavailable); int metrics_timedgetnext_measurement (metrics_measurement_t *result, int *unavailable, const struct timespec *abs_timeout);
Agustin Espinosa <aespinos@dsic.upv.es>, Andrés Terrasa <aterrasa@dsic.upv.es>, Ana García <agarcia@dsic.upv.es>.