metrics_init , metrics_destroy — Initializes and destroy the metrics search engine
Metrics
#include <metrics.h>
int metrics_init ( | trid, | |
set) ; |
trace_id_t | trid; |
const metrics_metricset_t * | set; |
int metrics_destroy (
)
;
void ;
The metrics_init() function initializes the metrics search engine. Once the metrics search engine is initializated, subsequents call to the metrics_getnext_measurement, metrics_trygetnext_measurement and metrics_timedgetnext_measurement functions will use the trace stream identified by the argument trid to retrieve measurements for the metrics which are included in the metric set identified by the argument set.
If the trid argument identifies a trace stream created by a call to the posix_trace_create(), the metrics_getnext_measurement, metrics_trygetnext_measurement and metrics_timedgetnext_measurement functions can be used to retrieve measurements from the trace stream identified by trid.
If the trid argument identifies a trace stream created by a call to the posix_trace_create_withlog(), it is unespecified if the metrics_getnext_measurement, metrics_trygetnext_measurement and metrics_timedgetnext_measurement functions can be used to retrieve measurements from the trace stream identified by trid.
If the trid argument identifies a trace stream created by a call to the posix_trace_open(), only the metrics_getnext_measurement can be used to retrieve measurements from the trace stream identified by trid. The metrics_trygetnext_measurement and metrics_timedgetnext_measurement functions shall fail in this case.
Upon successful completion, these functions shall return a value of zero. Otherwise, they shall return the corresponding error number.
The metrics_init() function shall fail if:
[EINVAL]:
The trid argument was not a valid trace stream identifier.
The set argument was NULL.
The metrics_desroy() function shall fail if:
[EPERM]:
The search engine was not initialized.
Agustin Espinosa <aespinos@dsic.upv.es>, Andrés Terrasa <aterrasa@dsic.upv.es>, Ana García <agarcia@dsic.upv.es>.