69 assert(measurement_interval >= 0.0);
75 if (measurement == NULL)
81 EVEL_DEBUG(
"New measurement is at %lp", measurement);
126 const char *
const type)
133 assert(measurement != NULL);
151 int concurrent_sessions)
158 assert(measurement != NULL);
160 assert(concurrent_sessions >= 0);
164 "Concurrent Sessions");
179 int configured_entities)
186 assert(measurement != NULL);
188 assert(configured_entities >= 0);
192 "Configured Entities");
210 int receive_discards,
212 int transmit_discards,
221 assert(measurement != NULL);
223 assert(receive_discards >= 0);
224 assert(receive_errors >= 0);
225 assert(transmit_discards >= 0);
226 assert(transmit_errors >= 0);
228 if (measurement->
errors == NULL)
236 assert(errors != NULL);
242 measurement->
errors = errors;
246 errors = measurement->
errors;
247 EVEL_DEBUG(
"Ignoring attempt to add Errors: %d, %d; %d, %d\n" 248 "Errors already set: %d, %d; %d, %d",
273 double mean_request_latency)
280 assert(measurement != NULL);
282 assert(mean_request_latency >= 0.0);
285 mean_request_latency,
286 "Mean Request Latency");
301 double memory_configured)
308 assert(measurement != NULL);
310 assert(memory_configured >= 0.0);
314 "Memory Configured");
336 assert(measurement != NULL);
338 assert(memory_used >= 0.0);
364 assert(measurement != NULL);
366 assert(request_rate >= 0);
386 char *
id,
double usage)
394 assert(measurement != NULL);
397 assert(usage >= 0.0);
402 EVEL_DEBUG(
"Adding id=%s usage=%lf",
id, usage);
404 assert(cpu_use != NULL);
406 cpu_use->
id = strdup(
id);
407 cpu_use->
usage = usage;
408 assert(cpu_use->
id != NULL);
433 char * filesystem_name,
434 double block_configured,
437 double ephemeral_configured,
438 double ephemeral_used,
447 assert(measurement != NULL);
449 assert(filesystem_name != NULL);
450 assert(block_configured >= 0.0);
451 assert(block_used >= 0.0);
452 assert(block_iops >= 0);
453 assert(ephemeral_configured >= 0.0);
454 assert(ephemeral_used >= 0.0);
455 assert(ephemeral_iops >= 0);
460 EVEL_DEBUG(
"Adding filesystem_name=%s", filesystem_name);
462 assert(fsys_use != NULL);
498 assert(measurement != NULL);
500 assert(feature != NULL);
501 assert(utilization >= 0);
506 EVEL_DEBUG(
"Adding Feature=%s Use=%d", feature, utilization);
508 assert(feature_use != NULL);
532 const char *
const group,
533 const char *
const name,
534 const char *
const value)
544 assert(measurement != NULL);
546 assert(group != NULL);
547 assert(name != NULL);
548 assert(value != NULL);
553 EVEL_DEBUG(
"Adding Measurement Group=%s Name=%s Value=%s",
556 assert(custom_measurement != NULL);
558 custom_measurement->
name = strdup(name);
559 assert(custom_measurement->
name != NULL);
560 custom_measurement->
value = strdup(value);
561 assert(custom_measurement->
value != NULL);
570 assert(measurement_group != NULL);
573 if (strcmp(group, measurement_group->
name) == 0)
575 EVEL_DEBUG(
"Found existing Measurement Group");
588 assert(measurement_group != NULL);
590 measurement_group->
name = strdup(group);
591 assert(measurement_group->
name != NULL);
625 assert(measurement != NULL);
627 assert(codec != NULL);
628 assert(utilization >= 0.0);
633 EVEL_DEBUG(
"Adding Codec=%s Use=%d", codec, utilization);
635 assert(codec_use != NULL);
637 codec_use->
codec_id = strdup(codec);
638 assert(codec_use->
codec_id != NULL);
664 assert(measurement != NULL);
666 assert(cpu_use >= 0.0);
685 int media_ports_in_use)
692 assert(measurement != NULL);
694 assert(media_ports_in_use >= 0);
698 "Media Ports In Use");
713 double scaling_metric)
720 assert(measurement != NULL);
722 assert(scaling_metric >= 0.0);
726 "VNFC Scaling Metric");
759 EVEL_DEBUG(
"Creating bucket, count = %d", count);
761 assert(bucket != NULL);
766 bucket->
count = count;
791 const double high_end)
798 assert(high_end >= 0.0);
816 const double low_end)
823 assert(low_end >= 0.0);
842 assert(measurement != NULL);
844 assert(bucket != NULL);
861 const double low_end,
862 const double high_end,
901 const int packets_in,
902 const int packets_out,
913 assert(vnic_id != NULL);
914 assert(packets_in >= 0);
915 assert(packets_out >= 0);
916 assert(bytes_in >= 0);
917 assert(bytes_out >= 0);
924 assert(vnic_use != NULL);
925 vnic_use->
vnic_id = strdup(vnic_id);
962 assert(vnic_use != NULL);
963 assert(vnic_use->
vnic_id != NULL);
986 const int broadcast_packets_in)
993 assert(broadcast_packets_in >= 0);
996 broadcast_packets_in,
997 "Broadcast Packets Received");
1014 const int broadcast_packets_out)
1021 assert(broadcast_packets_out >= 0);
1024 broadcast_packets_out,
1025 "Broadcast Packets Transmitted");
1042 const int multicast_packets_in)
1049 assert(multicast_packets_in >= 0);
1052 multicast_packets_in,
1053 "Multicast Packets Received");
1070 const int multicast_packets_out)
1077 assert(multicast_packets_out >= 0);
1080 multicast_packets_out,
1081 "Multicast Packets Transmitted");
1098 const int unicast_packets_in)
1105 assert(unicast_packets_in >= 0);
1109 "Unicast Packets Received");
1126 const int unicast_packets_out)
1133 assert(unicast_packets_out >= 0);
1136 unicast_packets_out,
1137 "Unicast Packets Transmitted");
1156 assert(measurement != NULL);
1158 assert(vnic_use != NULL);
1187 char *
const vnic_id,
1188 const int packets_in,
1189 const int packets_out,
1190 const int broadcast_packets_in,
1191 const int broadcast_packets_out,
1193 const int bytes_out,
1194 const int multicast_packets_in,
1195 const int multicast_packets_out,
1196 const int unicast_packets_in,
1197 const int unicast_packets_out)
1245 assert(event != NULL);
1268 bool item_added =
false;
1271 while (item != NULL)
1274 assert(cpu_use != NULL);
1305 bool item_added =
false;
1308 while (item != NULL)
1311 assert(fsys_use != NULL);
1314 "filesystemUsageArray",
1347 if ((item != NULL) &&
1350 while (item != NULL)
1353 assert(bucket != NULL);
1357 jbuf,
"lowEndOfLatencyBucket", &bucket->
low_end);
1359 jbuf,
"highEndOfLatencyBucket", &bucket->
high_end);
1379 bool item_added =
false;
1382 while (item != NULL)
1385 assert(vnic_use != NULL);
1445 if ((event->
errors != NULL) &&
1448 errors =
event->errors;
1462 bool item_added =
false;
1465 while (item != NULL)
1468 assert(feature_use != NULL);
1471 "featureUsageArray",
1500 bool item_added =
false;
1503 while (item != NULL)
1506 assert(codec_use != NULL);
1537 bool item_added =
false;
1540 while (item != NULL)
1543 assert(measurement_group != NULL);
1546 "additionalMeasurements",
1547 measurement_group->
name))
1557 while (nested_item != NULL)
1560 assert(custom_measurement != NULL);
1590 "measurementsForVfScalingVersion",
1624 assert(event != NULL);
1631 while (cpu_use != NULL)
1640 while (fsys_use != NULL)
1649 while (bucket != NULL)
1657 while (vnic_use != NULL)
1666 while (codec_use != NULL)
1674 if (event->
errors != NULL)
1681 while (feature_use != NULL)
1690 while (measurement_group != NULL)
1692 EVEL_DEBUG(
"Freeing Measurement Group (%s)", measurement_group->
name);
1695 while (measurement != NULL)
1698 free(measurement->
name);
1699 free(measurement->
value);
1703 free(measurement_group->
name);
1704 free(measurement_group);
void evel_measurement_cpu_use_add(EVENT_MEASUREMENT *measurement, char *id, double usage)
Add an additional CPU usage value name/value pair to the Measurement.
void evel_init_option_int(EVEL_OPTION_INT *const option)
Initialize an EVEL_OPTION_INT to a not-set state.
#define EVEL_DEBUG(FMT,...)
EVEL_OPTION_INT request_rate
MEASUREMENT_LATENCY_BUCKET * evel_new_meas_latency_bucket(const int count)
Create a new Latency Bucket to be added to a Measurement event.
DLIST_ITEM * dlist_get_first(DLIST *list)
EVEL_OPTION_INT multicast_packets_in
void evel_set_option_int(EVEL_OPTION_INT *const option, const int value, const char *const description)
Set the value of an EVEL_OPTION_INT.
void evel_measurement_cfg_ents_set(EVENT_MEASUREMENT *measurement, int configured_entities)
Set the Configured Entities property of the Measurement.
EVEL_OPTION_INT configured_entities
EVEL_OPTION_DOUBLE mean_request_latency
void evel_measurement_feature_use_add(EVENT_MEASUREMENT *measurement, char *feature, int utilization)
Add a Feature usage value name/value pair to the Measurement.
#define EVEL_MEASUREMENT_MAJOR_VERSION
void dlist_initialize(DLIST *list)
List initialization.
void evel_vnic_use_mcast_pkt_out_set(MEASUREMENT_VNIC_USE *const vnic_use, const int multicast_packets_out)
Set the Multicast Packets Transmitted property of the vNIC Use.
MEASUREMENT_VNIC_USE * evel_new_measurement_vnic_use(char *const vnic_id, const int packets_in, const int packets_out, const int bytes_in, const int bytes_out)
Create a new vNIC Use to be added to a Measurement event.
bool evel_json_open_opt_named_object(EVEL_JSON_BUFFER *jbuf, const char *const key)
Add the opening bracket of an optional named object to a JSON buffer.
void evel_measurement_vnfc_scaling_metric_set(EVENT_MEASUREMENT *measurement, double scaling_metric)
Set the VNFC Scaling Metric property of the Measurement.
void evel_measurement_conc_sess_set(EVENT_MEASUREMENT *measurement, int concurrent_sessions)
Set the Concurrent Sessions property of the Measurement.
EVEL_OPTION_INT concurrent_sessions
EVEL_OPTION_DOUBLE high_end
EVEL_THROTTLE_SPEC * throttle_spec
void evel_meas_latency_bucket_high_end_set(MEASUREMENT_LATENCY_BUCKET *const bucket, const double high_end)
Set the High End property of the Measurement Latency Bucket.
void evel_measurement_agg_cpu_use_set(EVENT_MEASUREMENT *measurement, double cpu_use)
Set the Aggregate CPU Use property of the Measurement.
void evel_vnic_use_ucast_pkt_out_set(MEASUREMENT_VNIC_USE *const vnic_use, const int unicast_packets_out)
Set the Unicast Packets Transmitted property of the vNIC Use.
void evel_measurement_type_set(EVENT_MEASUREMENT *measurement, const char *const type)
Set the Event Type property of the Measurement.
void evel_meas_latency_bucket_add(EVENT_MEASUREMENT *const measurement, MEASUREMENT_LATENCY_BUCKET *const bucket)
Add an additional Measurement Latency Bucket to the specified event.
bool evel_enc_kv_opt_double(EVEL_JSON_BUFFER *jbuf, const char *const key, const EVEL_OPTION_DOUBLE *const option)
Encode a string key and double value to a EVEL_JSON_BUFFER.
EVEL_OPTION_INT unicast_packets_in
void evel_meas_latency_bucket_low_end_set(MEASUREMENT_LATENCY_BUCKET *const bucket, const double low_end)
Set the Low End property of the Measurement Latency Bucket.
EVEL_OPTION_DOUBLE aggregate_cpu_usage
void evel_json_close_list(EVEL_JSON_BUFFER *jbuf)
Add the closing bracket of a list to a JSON buffer.
void evel_measurement_media_port_use_set(EVENT_MEASUREMENT *measurement, int media_ports_in_use)
Set the Media Ports in Use property of the Measurement.
void evel_vnic_use_bcast_pkt_in_set(MEASUREMENT_VNIC_USE *const vnic_use, const int broadcast_packets_in)
Set the Broadcast Packets Received property of the vNIC Use.
void evel_set_option_double(EVEL_OPTION_DOUBLE *const option, const double value, const char *const description)
Set the value of an EVEL_OPTION_DOUBLE.
void evel_measurement_errors_set(EVENT_MEASUREMENT *measurement, int receive_discards, int receive_errors, int transmit_discards, int transmit_errors)
Add an additional set of Errors to the Measurement.
EVEL_OPTION_INT unicast_packets_out
void evel_measurement_mem_used_set(EVENT_MEASUREMENT *measurement, double memory_used)
Set the Memory Used property of the Measurement.
EVEL_OPTION_INT multicast_packets_out
double measurement_interval
EVEL_OPTION_DOUBLE vnfc_scaling_metric
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.
DLIST additional_measurements
void evel_json_close_object(EVEL_JSON_BUFFER *jbuf)
Add the closing bracket of an object to a JSON buffer.
void evel_init_option_double(EVEL_OPTION_DOUBLE *const option)
Initialize an EVEL_OPTION_DOUBLE to a not-set state.
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_measurement_vnic_use(MEASUREMENT_VNIC_USE *const vnic_use)
Free a vNIC Use.
DLIST latency_distribution
EVENT_MEASUREMENT * evel_new_measurement(double measurement_interval)
Create a new Measurement event.
EVEL_OPTION_DOUBLE memory_used
EVEL_OPTION_DOUBLE memory_configured
void evel_json_encode_measurement(EVEL_JSON_BUFFER *jbuf, EVENT_MEASUREMENT *event)
Encode the measurement as a JSON measurement.
void evel_measurement_fsys_use_add(EVENT_MEASUREMENT *measurement, char *filesystem_name, double block_configured, double block_used, int block_iops, double ephemeral_configured, double ephemeral_used, int ephemeral_iops)
Add an additional File System usage value name/value pair to the Measurement.
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_vnic_use_bcast_pkt_out_set(MEASUREMENT_VNIC_USE *const vnic_use, const int broadcast_packets_out)
Set the Broadcast Packets Transmitted property of the vNIC Use.
double ephemeral_configured
void evel_measurement_latency_add(EVENT_MEASUREMENT *const measurement, const double low_end, const double high_end, const int count)
Add an additional Latency Distribution bucket to the Measurement.
void evel_vnic_use_ucast_pkt_in_set(MEASUREMENT_VNIC_USE *const vnic_use, const int unicast_packets_in)
Set the Unicast Packets Received property of the vNIC Use.
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.
void evel_free_header(EVENT_HEADER *const event)
Free an event header.
EVEL_OPTION_INT broadcast_packets_out
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_measurement_vnic_use_add(EVENT_MEASUREMENT *const measurement, char *const vnic_id, const int packets_in, const int packets_out, const int broadcast_packets_in, const int broadcast_packets_out, const int bytes_in, const int bytes_out, const int multicast_packets_in, const int multicast_packets_out, const int unicast_packets_in, const int unicast_packets_out)
Add an additional vNIC usage record Measurement.
MEASUREMENT_ERRORS * errors
void evel_vnic_use_mcast_pkt_in_set(MEASUREMENT_VNIC_USE *const vnic_use, const int multicast_packets_in)
Set the Multicast Packets Received property of the vNIC Use.
DLIST_ITEM * dlist_get_next(DLIST_ITEM *item)
void evel_measurement_mean_req_lat_set(EVENT_MEASUREMENT *measurement, double mean_request_latency)
Set the Mean Request Latency property of the Measurement.
bool evel_enc_kv_opt_int(EVEL_JSON_BUFFER *jbuf, const char *const key, const EVEL_OPTION_INT *const option)
Encode a string key and integer value to a EVEL_JSON_BUFFER.
EVEL_OPTION_INT broadcast_packets_in
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.
void evel_measurement_mem_cfg_set(EVENT_MEASUREMENT *measurement, double memory_configured)
Set the Memory Configured property of the Measurement.
void evel_free_measurement(EVENT_MEASUREMENT *event)
Free a Measurement.
EVEL internal definitions.
#define EVEL_MEASUREMENT_MINOR_VERSION
EVEL_OPTION_INT media_ports_in_use
void evel_meas_vnic_use_add(EVENT_MEASUREMENT *const measurement, MEASUREMENT_VNIC_USE *const vnic_use)
Add an additional vNIC Use to the specified Measurement event.
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.
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).
void evel_measurement_custom_measurement_add(EVENT_MEASUREMENT *measurement, const char *const group, const char *const name, const char *const value)
Add a Additional Measurement value name/value pair to the Report.
void evel_measurement_codec_use_add(EVENT_MEASUREMENT *measurement, char *codec, int utilization)
Add a Codec usage value name/value pair to the Measurement.
void evel_measurement_request_rate_set(EVENT_MEASUREMENT *measurement, int request_rate)
Set the Request Rate property of the Measurement.
Custom Defined Measurement.
EVEL_OPTION_DOUBLE low_end