75 assert(measurement_interval >= 0.0);
119 const char *
const type)
126 assert(report != NULL);
154 assert(report != NULL);
156 assert(feature != NULL);
157 assert(utilization >= 0);
162 EVEL_DEBUG(
"Adding Feature=%s Use=%d", feature, utilization);
164 assert(feature_use != NULL);
188 const char *
const group,
189 const char *
const name,
190 const char *
const value)
200 assert(report != NULL);
202 assert(group != NULL);
203 assert(name != NULL);
204 assert(value != NULL);
209 EVEL_DEBUG(
"Adding Measurement Group=%s Name=%s Value=%s",
212 assert(measurement != NULL);
214 measurement->
name = strdup(name);
215 assert(measurement->
name != NULL);
216 measurement->
value = strdup(value);
217 assert(measurement->
value != NULL);
226 assert(measurement_group != NULL);
229 if (strcmp(group, measurement_group->
name) == 0)
231 EVEL_DEBUG(
"Found existing Measurement Group");
244 assert(measurement_group != NULL);
246 measurement_group->
name = strdup(group);
247 assert(measurement_group->
name != NULL);
280 assert(event != NULL);
293 bool item_added =
false;
299 assert(feature_use != NULL);
331 bool item_added =
false;
337 assert(measurement_group != NULL);
340 "additionalMeasurements",
341 measurement_group->
name))
351 while (nested_item != NULL)
354 assert(custom_measurement != NULL);
384 "measurementFieldsVersion",
412 assert(event != NULL);
419 while (feature_use != NULL)
427 while (measurement_group != NULL)
429 EVEL_DEBUG(
"Freeing Measurement Group (%s)", measurement_group->
name);
432 while (custom_measurement != NULL)
436 free(custom_measurement->
name);
437 free(custom_measurement->
value);
438 free(custom_measurement);
442 free(measurement_group->
name);
443 free(measurement_group);
#define EVEL_DEBUG(FMT,...)
DLIST_ITEM * dlist_get_first(DLIST *list)
void evel_json_open_named_list(EVEL_JSON_BUFFER *jbuf, const char *const key)
Add the key and opening bracket of a named list to a JSON buffer.
void dlist_initialize(DLIST *list)
List initialization.
void evel_report_feature_use_add(EVENT_REPORT *report, char *feature, int utilization)
Add a Feature usage value name/value pair to the Report.
double measurement_interval
EVEL_THROTTLE_SPEC * throttle_spec
void evel_json_encode_report(EVEL_JSON_BUFFER *jbuf, EVENT_REPORT *event)
Encode the report as a JSON report.
EVENT_REPORT * evel_new_report(double measurement_interval)
Create a new Report event.
void evel_json_close_list(EVEL_JSON_BUFFER *jbuf)
Add the closing bracket of a list to a JSON buffer.
void evel_report_type_set(EVENT_REPORT *report, const char *const type)
Set the Event Type property of the Report.
void evel_enc_kv_string(EVEL_JSON_BUFFER *jbuf, const char *const key, const char *const value)
Encode a string key and string value to a EVEL_JSON_BUFFER.
void evel_json_close_object(EVEL_JSON_BUFFER *jbuf)
Add the closing bracket of an object to a JSON buffer.
void evel_enc_kv_int(EVEL_JSON_BUFFER *jbuf, const char *const key, const int value)
Encode a string key and integer value to a EVEL_JSON_BUFFER.
void evel_free_report(EVENT_REPORT *event)
Free a Report.
void evel_json_open_named_object(EVEL_JSON_BUFFER *jbuf, const char *const key)
Add the opening bracket of an object to a JSON buffer.
void evel_json_open_object(EVEL_JSON_BUFFER *jbuf)
Add the opening bracket of an object to a JSON buffer.
void evel_json_checkpoint(EVEL_JSON_BUFFER *jbuf)
Add a checkpoint - a stake in the ground to which we can rewind.
void evel_enc_kv_double(EVEL_JSON_BUFFER *jbuf, const char *const key, const double value)
Encode a string key and double value to a EVEL_JSON_BUFFER.
void evel_json_encode_header(EVEL_JSON_BUFFER *jbuf, EVENT_HEADER *event)
Encode the event as a JSON event object according to AT&T's schema.
#define EVEL_REPORT_MAJOR_VERSION
void evel_free_header(EVENT_HEADER *const event)
Free an event header.
void * dlist_pop_last(DLIST *list)
void dlist_push_last(DLIST *list, void *item)
bool evel_json_open_opt_named_list(EVEL_JSON_BUFFER *jbuf, const char *const key)
Add the key and opening bracket of an optional named list to a JSON buffer.
void log_error_state(char *format,...)
void evel_report_custom_measurement_add(EVENT_REPORT *report, const char *const group, const char *const name, const char *const value)
Add a Additional Measurement value name/value pair to the Report.
DLIST_ITEM * dlist_get_next(DLIST_ITEM *item)
void evel_json_rewind(EVEL_JSON_BUFFER *jbuf)
Rewind to the latest checkoint.
void evel_header_type_set(EVENT_HEADER *const header, const char *const type)
Set the Event Type property of the event header.
EVEL throttle definitions.
EVEL internal definitions.
void evel_enc_version(EVEL_JSON_BUFFER *jbuf, const char *const key, const int major_version, const int minor_version)
Encode a key and version.
void evel_init_header(EVENT_HEADER *const header)
Initialize a newly created event header.
#define EVEL_REPORT_MINOR_VERSION
bool evel_throttle_suppress_nv_pair(EVEL_THROTTLE_SPEC *throttle_spec, const char *const field_name, const char *const name)
Determine whether a name-value pair should be allowed (not suppressed).
Custom Defined Measurement.