1 /*************************************************************************//**
3 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
5 * Unless otherwise specified, all software contained herein is
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
17 ****************************************************************************/
18 /**************************************************************************//**
20 * Implementation of EVEL functions relating to the Measurement.
22 ****************************************************************************/
29 #include "evel_internal.h"
30 #include "evel_throttle.h"
32 /**************************************************************************//**
33 * Create a new Measurement event.
35 * @note The mandatory fields on the Measurement must be supplied to this
36 * factory function and are immutable once set. Optional fields have
37 * explicit setter functions, but again values may only be set once so
38 * that the Measurement has immutable properties.
40 * @param measurement_interval
41 * @param event_name Unique Event Name confirming Domain AsdcModel Description
42 * @param event_id A universal identifier of the event for: troubleshooting correlation, analysis, etc
44 * @returns pointer to the newly manufactured ::EVENT_MEASUREMENT. If the
45 * event is not used (i.e. posted) it must be released using
47 * @retval NULL Failed to create the event.
48 *****************************************************************************/
49 EVENT_MEASUREMENT * evel_new_measurement(double measurement_interval, const char* ev_name, const char *ev_id)
51 EVENT_MEASUREMENT * measurement = NULL;
55 /***************************************************************************/
56 /* Check preconditions. */
57 /***************************************************************************/
58 assert(measurement_interval >= 0.0);
60 /***************************************************************************/
61 /* Allocate the measurement. */
62 /***************************************************************************/
63 measurement = malloc(sizeof(EVENT_MEASUREMENT));
64 if (measurement == NULL)
66 log_error_state("Out of memory for Measurement");
69 memset(measurement, 0, sizeof(EVENT_MEASUREMENT));
70 EVEL_DEBUG("New measurement is at %lp", measurement);
72 /***************************************************************************/
73 /* Initialize the header & the measurement fields. */
74 /***************************************************************************/
75 evel_init_header_nameid(&measurement->header,ev_name,ev_id);
76 measurement->header.event_domain = EVEL_DOMAIN_MEASUREMENT;
77 measurement->measurement_interval = measurement_interval;
78 dlist_initialize(&measurement->additional_info);
79 dlist_initialize(&measurement->additional_measurements);
80 dlist_initialize(&measurement->additional_objects);
81 dlist_initialize(&measurement->cpu_usage);
82 dlist_initialize(&measurement->disk_usage);
83 dlist_initialize(&measurement->mem_usage);
84 dlist_initialize(&measurement->filesystem_usage);
85 dlist_initialize(&measurement->latency_distribution);
86 dlist_initialize(&measurement->vnic_usage);
87 dlist_initialize(&measurement->codec_usage);
88 dlist_initialize(&measurement->feature_usage);
89 evel_init_option_double(&measurement->mean_request_latency);
90 evel_init_option_int(&measurement->vnfc_scaling_metric);
91 evel_init_option_int(&measurement->concurrent_sessions);
92 evel_init_option_int(&measurement->configured_entities);
93 evel_init_option_int(&measurement->media_ports_in_use);
94 evel_init_option_int(&measurement->request_rate);
95 measurement->major_version = EVEL_MEASUREMENT_MAJOR_VERSION;
96 measurement->minor_version = EVEL_MEASUREMENT_MINOR_VERSION;
103 /**************************************************************************//**
104 * Set the Event Type property of the Measurement.
106 * @note The property is treated as immutable: it is only valid to call
107 * the setter once. However, we don't assert if the caller tries to
108 * overwrite, just ignoring the update instead.
110 * @param measurement Pointer to the Measurement.
111 * @param type The Event Type to be set. ASCIIZ string. The caller
112 * does not need to preserve the value once the function
114 *****************************************************************************/
115 void evel_measurement_type_set(EVENT_MEASUREMENT * measurement,
116 const char * const type)
120 /***************************************************************************/
121 /* Check preconditions and call evel_header_type_set. */
122 /***************************************************************************/
123 assert(measurement != NULL);
124 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
125 evel_header_type_set(&measurement->header, type);
130 /**************************************************************************//**
131 * Add an additional value name/value pair to the Measurement.
133 * The name and value are null delimited ASCII strings. The library takes
134 * a copy so the caller does not have to preserve values after the function
137 * @param measurement Pointer to the measurement.
138 * @param name ASCIIZ string with the attribute's name. The caller
139 * does not need to preserve the value once the function
141 * @param value ASCIIZ string with the attribute's value. The caller
142 * does not need to preserve the value once the function
144 *****************************************************************************/
145 void evel_measurement_addl_info_add(EVENT_MEASUREMENT * measurement, char * name, char * value)
147 OTHER_FIELD * addl_info = NULL;
150 /***************************************************************************/
151 /* Check preconditions. */
152 /***************************************************************************/
153 assert(measurement != NULL);
154 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
155 assert(name != NULL);
156 assert(value != NULL);
158 EVEL_DEBUG("Adding name=%s value=%s", name, value);
159 addl_info = malloc(sizeof(OTHER_FIELD));
160 assert(addl_info != NULL);
161 memset(addl_info, 0, sizeof(OTHER_FIELD));
162 addl_info->name = strdup(name);
163 addl_info->value = strdup(value);
164 assert(addl_info->name != NULL);
165 assert(addl_info->value != NULL);
167 dlist_push_last(&measurement->additional_info, addl_info);
172 /**************************************************************************//**
173 * Add a json object to jsonObject list.
175 * The name and value are null delimited ASCII strings. The library takes
176 * a copy so the caller does not have to preserve values after the function
179 * @param measurement Pointer to the ScalingMeasurement
180 * @param jsonobj Pointer to json object
181 *****************************************************************************/
182 void evel_measurement_addl_object_add(EVENT_MEASUREMENT * measurement, EVEL_JSON_OBJECT *jsonobj)
186 /***************************************************************************/
187 /* Check preconditions. */
188 /***************************************************************************/
189 assert(measurement != NULL);
190 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
191 assert(jsonobj != NULL);
193 EVEL_DEBUG("Adding jsonObject %p",jsonobj);
195 dlist_push_last(&measurement->additional_objects, jsonobj);
201 /**************************************************************************//**
202 * Set the Concurrent Sessions property of the Measurement.
204 * @note The property is treated as immutable: it is only valid to call
205 * the setter once. However, we don't assert if the caller tries to
206 * overwrite, just ignoring the update instead.
208 * @param measurement Pointer to the Measurement.
209 * @param concurrent_sessions The Concurrent Sessions to be set.
210 *****************************************************************************/
211 void evel_measurement_conc_sess_set(EVENT_MEASUREMENT * measurement,
212 int concurrent_sessions)
216 /***************************************************************************/
217 /* Check preconditions. */
218 /***************************************************************************/
219 assert(measurement != NULL);
220 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
221 assert(concurrent_sessions >= 0);
223 evel_set_option_int(&measurement->concurrent_sessions,
225 "Concurrent Sessions");
229 /**************************************************************************//**
230 * Set the Configured Entities property of the Measurement.
232 * @note The property is treated as immutable: it is only valid to call
233 * the setter once. However, we don't assert if the caller tries to
234 * overwrite, just ignoring the update instead.
236 * @param measurement Pointer to the Measurement.
237 * @param configured_entities The Configured Entities to be set.
238 *****************************************************************************/
239 void evel_measurement_cfg_ents_set(EVENT_MEASUREMENT * measurement,
240 int configured_entities)
244 /***************************************************************************/
245 /* Check preconditions. */
246 /***************************************************************************/
247 assert(measurement != NULL);
248 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
249 assert(configured_entities >= 0);
251 evel_set_option_int(&measurement->configured_entities,
253 "Configured Entities");
257 /**************************************************************************//**
258 * Add an additional set of Errors to the Measurement.
260 * @note The property is treated as immutable: it is only valid to call
261 * the setter once. However, we don't assert if the caller tries to
262 * overwrite, just ignoring the update instead.
264 * @param measurement Pointer to the measurement.
265 * @param receive_discards The number of receive discards.
266 * @param receive_errors The number of receive errors.
267 * @param transmit_discards The number of transmit discards.
268 * @param transmit_errors The number of transmit errors.
269 *****************************************************************************/
270 void evel_measurement_errors_set(EVENT_MEASUREMENT * measurement,
271 int receive_discards,
273 int transmit_discards,
276 MEASUREMENT_ERRORS * errors = NULL;
279 /***************************************************************************/
280 /* Check preconditions. */
281 /***************************************************************************/
282 assert(measurement != NULL);
283 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
284 assert(receive_discards >= 0);
285 assert(receive_errors >= 0);
286 assert(transmit_discards >= 0);
287 assert(transmit_errors >= 0);
289 if (measurement->errors == NULL)
291 EVEL_DEBUG("Adding Errors: %d, %d; %d, %d",
296 errors = malloc(sizeof(MEASUREMENT_ERRORS));
297 assert(errors != NULL);
298 memset(errors, 0, sizeof(MEASUREMENT_ERRORS));
299 errors->receive_discards = receive_discards;
300 errors->receive_errors = receive_errors;
301 errors->transmit_discards = transmit_discards;
302 errors->transmit_errors = transmit_errors;
303 measurement->errors = errors;
307 errors = measurement->errors;
308 EVEL_DEBUG("Ignoring attempt to add Errors: %d, %d; %d, %d\n"
309 "Errors already set: %d, %d; %d, %d",
314 errors->receive_discards,
315 errors->receive_errors,
316 errors->transmit_discards,
317 errors->transmit_errors);
323 /**************************************************************************//**
324 * Set the Mean Request Latency property of the Measurement.
326 * @note The property is treated as immutable: it is only valid to call
327 * the setter once. However, we don't assert if the caller tries to
328 * overwrite, just ignoring the update instead.
330 * @param measurement Pointer to the Measurement.
331 * @param mean_request_latency The Mean Request Latency to be set.
332 *****************************************************************************/
333 void evel_measurement_mean_req_lat_set(EVENT_MEASUREMENT * measurement,
334 double mean_request_latency)
338 /***************************************************************************/
339 /* Check preconditions. */
340 /***************************************************************************/
341 assert(measurement != NULL);
342 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
343 assert(mean_request_latency >= 0.0);
345 evel_set_option_double(&measurement->mean_request_latency,
346 mean_request_latency,
347 "Mean Request Latency");
352 /**************************************************************************//**
353 * Set the Request Rate property of the Measurement.
355 * @note The property is treated as immutable: it is only valid to call
356 * the setter once. However, we don't assert if the caller tries to
357 * overwrite, just ignoring the update instead.
359 * @param measurement Pointer to the Measurement.
360 * @param request_rate The Request Rate to be set.
361 *****************************************************************************/
362 void evel_measurement_request_rate_set(EVENT_MEASUREMENT * measurement,
367 /***************************************************************************/
368 /* Check preconditions. */
369 /***************************************************************************/
370 assert(measurement != NULL);
371 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
372 assert(request_rate >= 0);
374 evel_set_option_int(&measurement->request_rate,
380 /**************************************************************************//**
381 * Add an additional CPU usage value name/value pair to the Measurement.
383 * The name and value are null delimited ASCII strings. The library takes
384 * a copy so the caller does not have to preserve values after the function
387 * @param measurement Pointer to the measurement.
388 * @param id ASCIIZ string with the CPU's identifier.
389 * @param usage CPU utilization.
390 *****************************************************************************/
391 MEASUREMENT_CPU_USE *evel_measurement_new_cpu_use_add(EVENT_MEASUREMENT * measurement,
392 char * id, double usage)
394 MEASUREMENT_CPU_USE * cpu_use = NULL;
397 /***************************************************************************/
398 /* Check assumptions. */
399 /***************************************************************************/
400 assert(measurement != NULL);
401 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
403 assert(usage >= 0.0);
405 /***************************************************************************/
406 /* Allocate a container for the value and push onto the list. */
407 /***************************************************************************/
408 EVEL_DEBUG("Adding id=%s usage=%lf", id, usage);
409 cpu_use = malloc(sizeof(MEASUREMENT_CPU_USE));
410 assert(cpu_use != NULL);
411 memset(cpu_use, 0, sizeof(MEASUREMENT_CPU_USE));
412 cpu_use->id = strdup(id);
413 cpu_use->usage = usage;
414 evel_init_option_double(&cpu_use->idle);
415 evel_init_option_double(&cpu_use->intrpt);
416 evel_init_option_double(&cpu_use->nice);
417 evel_init_option_double(&cpu_use->softirq);
418 evel_init_option_double(&cpu_use->steal);
419 evel_init_option_double(&cpu_use->sys);
420 evel_init_option_double(&cpu_use->user);
421 evel_init_option_double(&cpu_use->wait);
423 dlist_push_last(&measurement->cpu_usage, cpu_use);
429 /**************************************************************************//**
430 * Set the CPU Idle value in measurement interval
431 * percentage of CPU time spent in the idle task
433 * @note The property is treated as immutable: it is only valid to call
434 * the setter once. However, we don't assert if the caller tries to
435 * overwrite, just ignoring the update instead.
437 * @param cpu_use Pointer to the CPU Use.
439 *****************************************************************************/
440 void evel_measurement_cpu_use_idle_set(MEASUREMENT_CPU_USE *const cpu_use,
444 evel_set_option_double(&cpu_use->idle, val, "CPU idle time");
448 /**************************************************************************//**
449 * Set the percentage of time spent servicing interrupts
451 * @note The property is treated as immutable: it is only valid to call
452 * the setter once. However, we don't assert if the caller tries to
453 * overwrite, just ignoring the update instead.
455 * @param cpu_use Pointer to the CPU Use.
457 *****************************************************************************/
458 void evel_measurement_cpu_use_interrupt_set(MEASUREMENT_CPU_USE * const cpu_use,
462 evel_set_option_double(&cpu_use->intrpt, val, "CPU interrupt value");
467 /**************************************************************************//**
468 * Set the percentage of time spent running user space processes that have been niced
470 * @note The property is treated as immutable: it is only valid to call
471 * the setter once. However, we don't assert if the caller tries to
472 * overwrite, just ignoring the update instead.
474 * @param cpu_use Pointer to the CPU Use.
476 *****************************************************************************/
477 void evel_measurement_cpu_use_nice_set(MEASUREMENT_CPU_USE * const cpu_use,
481 evel_set_option_double(&cpu_use->nice, val, "CPU nice value");
486 /**************************************************************************//**
487 * Set the percentage of time spent handling soft irq interrupts
489 * @note The property is treated as immutable: it is only valid to call
490 * the setter once. However, we don't assert if the caller tries to
491 * overwrite, just ignoring the update instead.
493 * @param cpu_use Pointer to the CPU Use.
495 *****************************************************************************/
496 void evel_measurement_cpu_use_softirq_set(MEASUREMENT_CPU_USE * const cpu_use,
500 evel_set_option_double(&cpu_use->softirq, val, "CPU Soft IRQ value");
504 /**************************************************************************//**
505 * Set the percentage of time spent in involuntary wait
507 * @note The property is treated as immutable: it is only valid to call
508 * the setter once. However, we don't assert if the caller tries to
509 * overwrite, just ignoring the update instead.
511 * @param cpu_use Pointer to the CPU Use.
513 *****************************************************************************/
514 void evel_measurement_cpu_use_steal_set(MEASUREMENT_CPU_USE * const cpu_use,
518 evel_set_option_double(&cpu_use->steal, val, "CPU involuntary wait");
522 /**************************************************************************//**
523 * Set the percentage of time spent on system tasks running the kernel
525 * @note The property is treated as immutable: it is only valid to call
526 * the setter once. However, we don't assert if the caller tries to
527 * overwrite, just ignoring the update instead.
529 * @param cpu_use Pointer to the CPU Use.
531 *****************************************************************************/
532 void evel_measurement_cpu_use_system_set(MEASUREMENT_CPU_USE * const cpu_use,
536 evel_set_option_double(&cpu_use->sys, val, "CPU System load");
541 /**************************************************************************//**
542 * Set the percentage of time spent running un-niced user space processes
544 * @note The property is treated as immutable: it is only valid to call
545 * the setter once. However, we don't assert if the caller tries to
546 * overwrite, just ignoring the update instead.
548 * @param cpu_use Pointer to the CPU Use.
550 *****************************************************************************/
551 void evel_measurement_cpu_use_usageuser_set(MEASUREMENT_CPU_USE * const cpu_use,
555 evel_set_option_double(&cpu_use->user, val, "CPU User load value");
559 /**************************************************************************//**
560 * Set the percentage of CPU time spent waiting for I/O operations to complete
562 * @note The property is treated as immutable: it is only valid to call
563 * the setter once. However, we don't assert if the caller tries to
564 * overwrite, just ignoring the update instead.
566 * @param cpu_use Pointer to the CPU Use.
568 *****************************************************************************/
569 void evel_measurement_cpu_use_wait_set(MEASUREMENT_CPU_USE * const cpu_use,
573 evel_set_option_double(&cpu_use->wait, val, "CPU Wait IO value");
578 /**************************************************************************//**
579 * Add an additional Memory usage value name/value pair to the Measurement.
581 * The name and value are null delimited ASCII strings. The library takes
582 * a copy so the caller does not have to preserve values after the function
585 * @param measurement Pointer to the measurement.
586 * @param id ASCIIZ string with the Memory identifier.
587 * @param vmidentifier ASCIIZ string with the VM's identifier.
588 * @param membuffsz Memory Size.
590 * @return Returns pointer to memory use structure in measurements
591 *****************************************************************************/
592 MEASUREMENT_MEM_USE * evel_measurement_new_mem_use_add(EVENT_MEASUREMENT * measurement,
593 char * id, char *vmidentifier, double membuffsz)
595 MEASUREMENT_MEM_USE * mem_use = NULL;
598 /***************************************************************************/
599 /* Check assumptions. */
600 /***************************************************************************/
601 assert(measurement != NULL);
602 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
604 assert(membuffsz >= 0.0);
606 /***************************************************************************/
607 /* Allocate a container for the value and push onto the list. */
608 /***************************************************************************/
609 EVEL_DEBUG("Adding id=%s buffer size=%lf", id, membuffsz);
610 mem_use = malloc(sizeof(MEASUREMENT_MEM_USE));
611 assert(mem_use != NULL);
612 memset(mem_use, 0, sizeof(MEASUREMENT_MEM_USE));
613 mem_use->id = strdup(id);
614 mem_use->vmid = strdup(vmidentifier);
615 mem_use->membuffsz = membuffsz;
616 evel_init_option_double(&mem_use->memcache);
617 evel_init_option_double(&mem_use->memconfig);
618 evel_init_option_double(&mem_use->memfree);
619 evel_init_option_double(&mem_use->slabrecl);
620 evel_init_option_double(&mem_use->slabunrecl);
621 evel_init_option_double(&mem_use->memused);
623 assert(mem_use->id != NULL);
625 dlist_push_last(&measurement->mem_usage, mem_use);
631 /**************************************************************************//**
632 * Set kilobytes of memory used for cache
634 * @note The property is treated as immutable: it is only valid to call
635 * the setter once. However, we don't assert if the caller tries to
636 * overwrite, just ignoring the update instead.
638 * @param mem_use Pointer to the Memory Use.
640 *****************************************************************************/
641 void evel_measurement_mem_use_memcache_set(MEASUREMENT_MEM_USE * const mem_use,
645 evel_set_option_double(&mem_use->memcache, val, "Memory cache value");
649 /**************************************************************************//**
650 * Set kilobytes of memory configured in the virtual machine on which the VNFC reporting
652 * @note The property is treated as immutable: it is only valid to call
653 * the setter once. However, we don't assert if the caller tries to
654 * overwrite, just ignoring the update instead.
656 * @param mem_use Pointer to the Memory Use.
658 *****************************************************************************/
659 void evel_measurement_mem_use_memconfig_set(MEASUREMENT_MEM_USE * const mem_use,
663 evel_set_option_double(&mem_use->memconfig, val, "Memory configured value");
667 /**************************************************************************//**
668 * Set kilobytes of physical RAM left unused by the system
670 * @note The property is treated as immutable: it is only valid to call
671 * the setter once. However, we don't assert if the caller tries to
672 * overwrite, just ignoring the update instead.
674 * @param mem_use Pointer to the Memory Use.
676 *****************************************************************************/
677 void evel_measurement_mem_use_memfree_set(MEASUREMENT_MEM_USE * const mem_use,
681 evel_set_option_double(&mem_use->memfree, val, "Memory freely available value");
685 /**************************************************************************//**
686 * Set the part of the slab that can be reclaimed such as caches measured in kilobytes
688 * @note The property is treated as immutable: it is only valid to call
689 * the setter once. However, we don't assert if the caller tries to
690 * overwrite, just ignoring the update instead.
692 * @param mem_use Pointer to the Memory Use.
694 *****************************************************************************/
695 void evel_measurement_mem_use_slab_reclaimed_set(MEASUREMENT_MEM_USE * const mem_use,
699 evel_set_option_double(&mem_use->slabrecl, val, "Memory reclaimable slab set");
703 /**************************************************************************//**
704 * Set the part of the slab that cannot be reclaimed such as caches measured in kilobytes
706 * @note The property is treated as immutable: it is only valid to call
707 * the setter once. However, we don't assert if the caller tries to
708 * overwrite, just ignoring the update instead.
710 * @param mem_use Pointer to the Memory Use.
712 *****************************************************************************/
713 void evel_measurement_mem_use_slab_unreclaimable_set(MEASUREMENT_MEM_USE * const mem_use,
717 evel_set_option_double(&mem_use->slabunrecl, val, "Memory unreclaimable slab set");
721 /**************************************************************************//**
722 * Set the total memory minus the sum of free, buffered, cached and slab memory in kilobytes
724 * @note The property is treated as immutable: it is only valid to call
725 * the setter once. However, we don't assert if the caller tries to
726 * overwrite, just ignoring the update instead.
728 * @param mem_use Pointer to the Memory Use.
730 *****************************************************************************/
731 void evel_measurement_mem_use_usedup_set(MEASUREMENT_MEM_USE * const mem_use,
735 evel_set_option_double(&mem_use->memused, val, "Memory usedup total set");
739 /**************************************************************************//**
740 * Add an additional Disk usage value name/value pair to the Measurement.
742 * The name and value are null delimited ASCII strings. The library takes
743 * a copy so the caller does not have to preserve values after the function
746 * @param measurement Pointer to the measurement.
747 * @param id ASCIIZ string with the CPU's identifier.
748 * @param usage Disk utilization.
749 *****************************************************************************/
750 MEASUREMENT_DISK_USE * evel_measurement_new_disk_use_add(EVENT_MEASUREMENT * measurement, char * id)
752 MEASUREMENT_DISK_USE * disk_use = NULL;
755 /***************************************************************************/
756 /* Check assumptions. */
757 /***************************************************************************/
758 assert(measurement != NULL);
759 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
762 /***************************************************************************/
763 /* Allocate a container for the value and push onto the list. */
764 /***************************************************************************/
765 EVEL_DEBUG("Adding id=%s disk usage", id);
766 disk_use = malloc(sizeof(MEASUREMENT_DISK_USE));
767 assert(disk_use != NULL);
768 memset(disk_use, 0, sizeof(MEASUREMENT_DISK_USE));
769 disk_use->id = strdup(id);
770 assert(disk_use->id != NULL);
771 dlist_push_last(&measurement->disk_usage, disk_use);
773 evel_init_option_double(&disk_use->iotimeavg );
774 evel_init_option_double(&disk_use->iotimelast );
775 evel_init_option_double(&disk_use->iotimemax );
776 evel_init_option_double(&disk_use->iotimemin );
777 evel_init_option_double(&disk_use->mergereadavg );
778 evel_init_option_double(&disk_use->mergereadlast );
779 evel_init_option_double(&disk_use->mergereadmax );
780 evel_init_option_double(&disk_use->mergereadmin );
781 evel_init_option_double(&disk_use->mergewriteavg );
782 evel_init_option_double(&disk_use->mergewritelast );
783 evel_init_option_double(&disk_use->mergewritemax );
784 evel_init_option_double(&disk_use->mergewritemin );
785 evel_init_option_double(&disk_use->octetsreadavg );
786 evel_init_option_double(&disk_use->octetsreadlast );
787 evel_init_option_double(&disk_use->octetsreadmax );
788 evel_init_option_double(&disk_use->octetsreadmin );
789 evel_init_option_double(&disk_use->octetswriteavg );
790 evel_init_option_double(&disk_use->octetswritelast );
791 evel_init_option_double(&disk_use->octetswritemax );
792 evel_init_option_double(&disk_use->octetswritemin );
793 evel_init_option_double(&disk_use->opsreadavg );
794 evel_init_option_double(&disk_use->opsreadlast );
795 evel_init_option_double(&disk_use->opsreadmax );
796 evel_init_option_double(&disk_use->opsreadmin );
797 evel_init_option_double(&disk_use->opswriteavg );
798 evel_init_option_double(&disk_use->opswritelast );
799 evel_init_option_double(&disk_use->opswritemax );
800 evel_init_option_double(&disk_use->opswritemin );
801 evel_init_option_double(&disk_use->pendingopsavg );
802 evel_init_option_double(&disk_use->pendingopslast );
803 evel_init_option_double(&disk_use->pendingopsmax );
804 evel_init_option_double(&disk_use->pendingopsmin );
805 evel_init_option_double(&disk_use->timereadavg );
806 evel_init_option_double(&disk_use->timereadlast );
807 evel_init_option_double(&disk_use->timereadmax );
808 evel_init_option_double(&disk_use->timereadmin );
809 evel_init_option_double(&disk_use->timewriteavg );
810 evel_init_option_double(&disk_use->timewritelast );
811 evel_init_option_double(&disk_use->timewritemax );
812 evel_init_option_double(&disk_use->timewritemin );
818 /**************************************************************************//**
819 * Set milliseconds spent doing input/output operations over 1 sec; treat
820 * this metric as a device load percentage where 1000ms matches 100% load;
821 * provide the average over the measurement interval
823 * @note The property is treated as immutable: it is only valid to call
824 * the setter once. However, we don't assert if the caller tries to
825 * overwrite, just ignoring the update instead.
827 * @param disk_use Pointer to the Disk Use.
829 *****************************************************************************/
830 void evel_measurement_disk_use_iotimeavg_set(MEASUREMENT_DISK_USE * const disk_use,
834 evel_set_option_double(&disk_use->iotimeavg, val, "Disk ioload set");
838 /**************************************************************************//**
839 * Set milliseconds spent doing input/output operations over 1 sec; treat
840 * this metric as a device load percentage where 1000ms matches 100% load;
841 * provide the last value within the measurement interval
843 * @note The property is treated as immutable: it is only valid to call
844 * the setter once. However, we don't assert if the caller tries to
845 * overwrite, just ignoring the update instead.
847 * @param disk_use Pointer to the Disk Use.
849 *****************************************************************************/
850 void evel_measurement_disk_use_iotimelast_set(MEASUREMENT_DISK_USE * const disk_use,
854 evel_set_option_double(&disk_use->iotimelast, val, "Disk ioloadlast set");
858 /**************************************************************************//**
859 * Set milliseconds spent doing input/output operations over 1 sec; treat
860 * this metric as a device load percentage where 1000ms matches 100% load;
861 * provide the maximum value within the measurement interval
863 * @note The property is treated as immutable: it is only valid to call
864 * the setter once. However, we don't assert if the caller tries to
865 * overwrite, just ignoring the update instead.
867 * @param disk_use Pointer to the Disk Use.
869 *****************************************************************************/
870 void evel_measurement_disk_use_iotimemax_set(MEASUREMENT_DISK_USE * const disk_use,
874 evel_set_option_double(&disk_use->iotimemax, val, "Disk ioloadmax set");
878 /**************************************************************************//**
879 * Set milliseconds spent doing input/output operations over 1 sec; treat
880 * this metric as a device load percentage where 1000ms matches 100% load;
881 * provide the minimum value within the measurement interval
883 * @note The property is treated as immutable: it is only valid to call
884 * the setter once. However, we don't assert if the caller tries to
885 * overwrite, just ignoring the update instead.
887 * @param disk_use Pointer to the Disk Use.
889 *****************************************************************************/
890 void evel_measurement_disk_use_iotimemin_set(MEASUREMENT_DISK_USE * const disk_use,
894 evel_set_option_double(&disk_use->iotimemin, val, "Disk ioloadmin set");
898 /**************************************************************************//**
899 * Set number of logical read operations that were merged into physical read
900 * operations, e.g., two logical reads were served by one physical disk access;
901 * provide the average measurement within the measurement interval
903 * @note The property is treated as immutable: it is only valid to call
904 * the setter once. However, we don't assert if the caller tries to
905 * overwrite, just ignoring the update instead.
907 * @param disk_use Pointer to the Disk Use.
909 *****************************************************************************/
910 void evel_measurement_disk_use_mergereadavg_set(MEASUREMENT_DISK_USE * const disk_use,
914 evel_set_option_double(&disk_use->mergereadavg, val, "Disk Merged read average set");
917 /**************************************************************************//**
918 * Set number of logical read operations that were merged into physical read
919 * operations, e.g., two logical reads were served by one physical disk access;
920 * provide the last measurement within the measurement interval
922 * @note The property is treated as immutable: it is only valid to call
923 * the setter once. However, we don't assert if the caller tries to
924 * overwrite, just ignoring the update instead.
926 * @param disk_use Pointer to the Disk Use.
928 *****************************************************************************/
929 void evel_measurement_disk_use_mergereadlast_set(MEASUREMENT_DISK_USE * const disk_use,
933 evel_set_option_double(&disk_use->mergereadlast, val, "Disk mergedload last set");
936 /**************************************************************************//**
937 * Set number of logical read operations that were merged into physical read
938 * operations, e.g., two logical reads were served by one physical disk access;
939 * provide the maximum measurement within the measurement interval
941 * @note The property is treated as immutable: it is only valid to call
942 * the setter once. However, we don't assert if the caller tries to
943 * overwrite, just ignoring the update instead.
945 * @param disk_use Pointer to the Disk Use.
947 *****************************************************************************/
948 void evel_measurement_disk_use_mergereadmax_set(MEASUREMENT_DISK_USE * const disk_use,
952 evel_set_option_double(&disk_use->mergereadmax, val, "Disk merged loadmax set");
956 /**************************************************************************//**
957 * Set number of logical read operations that were merged into physical read
958 * operations, e.g., two logical reads were served by one physical disk access;
959 * provide the minimum measurement within the measurement interval
961 * @note The property is treated as immutable: it is only valid to call
962 * the setter once. However, we don't assert if the caller tries to
963 * overwrite, just ignoring the update instead.
965 * @param disk_use Pointer to the Disk Use.
967 *****************************************************************************/
968 void evel_measurement_disk_use_mergereadmin_set(MEASUREMENT_DISK_USE * const disk_use,
972 evel_set_option_double(&disk_use->mergereadmin, val, "Disk merged loadmin set");
975 /**************************************************************************//**
976 * Set number of logical write operations that were merged into physical read
977 * operations, e.g., two logical writes were served by one physical disk access;
978 * provide the last measurement within the measurement interval
980 * @note The property is treated as immutable: it is only valid to call
981 * the setter once. However, we don't assert if the caller tries to
982 * overwrite, just ignoring the update instead.
984 * @param disk_use Pointer to the Disk Use.
986 *****************************************************************************/
987 void evel_measurement_disk_use_mergewritelast_set(MEASUREMENT_DISK_USE * const disk_use,
991 evel_set_option_double(&disk_use->mergewritelast, val, "Disk merged writelast set");
994 /**************************************************************************//**
995 * Set number of logical write operations that were merged into physical read
996 * operations, e.g., two logical writes were served by one physical disk access;
997 * provide the maximum measurement within the measurement interval
999 * @note The property is treated as immutable: it is only valid to call
1000 * the setter once. However, we don't assert if the caller tries to
1001 * overwrite, just ignoring the update instead.
1003 * @param disk_use Pointer to the Disk Use.
1005 *****************************************************************************/
1006 void evel_measurement_disk_use_mergewritemax_set(MEASUREMENT_DISK_USE * const disk_use,
1010 evel_set_option_double(&disk_use->mergewritemax, val, "Disk writemax set");
1013 /**************************************************************************//**
1014 * Set number of logical write operations that were merged into physical read
1015 * operations, e.g., two logical writes were served by one physical disk access;
1016 * provide the average measurement within the measurement interval
1018 * @note The property is treated as immutable: it is only valid to call
1019 * the setter once. However, we don't assert if the caller tries to
1020 * overwrite, just ignoring the update instead.
1022 * @param disk_use Pointer to the Disk Use.
1024 *****************************************************************************/
1025 void evel_measurement_disk_use_mergewriteavg_set(MEASUREMENT_DISK_USE * const disk_use,
1029 evel_set_option_double(&disk_use->mergewriteavg, val, "Disk writeavg set");
1032 /**************************************************************************//**
1033 * Set number of logical write operations that were merged into physical read
1034 * operations, e.g., two logical writes were served by one physical disk access;
1035 * provide the maximum measurement within the measurement interval
1037 * @note The property is treated as immutable: it is only valid to call
1038 * the setter once. However, we don't assert if the caller tries to
1039 * overwrite, just ignoring the update instead.
1041 * @param disk_use Pointer to the Disk Use.
1043 *****************************************************************************/
1044 void evel_measurement_disk_use_mergewritemin_set(MEASUREMENT_DISK_USE * const disk_use,
1048 evel_set_option_double(&disk_use->mergewritemin, val, "Disk writemin set");
1052 /**************************************************************************//**
1053 * Set number of octets per second read from a disk or partition;
1054 * provide the average measurement within the measurement interval
1056 * @note The property is treated as immutable: it is only valid to call
1057 * the setter once. However, we don't assert if the caller tries to
1058 * overwrite, just ignoring the update instead.
1060 * @param disk_use Pointer to the Disk Use.
1062 *****************************************************************************/
1063 void evel_measurement_disk_use_octetsreadavg_set(MEASUREMENT_DISK_USE * const disk_use,
1067 evel_set_option_double(&disk_use->octetsreadavg, val, "Octets readavg set");
1071 /**************************************************************************//**
1072 * Set number of octets per second read from a disk or partition;
1073 * provide the last measurement within the measurement interval
1075 * @note The property is treated as immutable: it is only valid to call
1076 * the setter once. However, we don't assert if the caller tries to
1077 * overwrite, just ignoring the update instead.
1079 * @param disk_use Pointer to the Disk Use.
1081 *****************************************************************************/
1082 void evel_measurement_disk_use_octetsreadlast_set(MEASUREMENT_DISK_USE * const disk_use,
1086 evel_set_option_double(&disk_use->octetsreadlast, val, "Octets readlast set");
1090 /**************************************************************************//**
1091 * Set number of octets per second read from a disk or partition;
1092 * provide the maximum measurement within the measurement interval
1094 * @note The property is treated as immutable: it is only valid to call
1095 * the setter once. However, we don't assert if the caller tries to
1096 * overwrite, just ignoring the update instead.
1098 * @param disk_use Pointer to the Disk Use.
1100 *****************************************************************************/
1101 void evel_measurement_disk_use_octetsreadmax_set(MEASUREMENT_DISK_USE * const disk_use,
1105 evel_set_option_double(&disk_use->octetsreadmax, val, "Octets readmax set");
1108 /**************************************************************************//**
1109 * Set number of octets per second read from a disk or partition;
1110 * provide the minimum measurement within the measurement interval
1112 * @note The property is treated as immutable: it is only valid to call
1113 * the setter once. However, we don't assert if the caller tries to
1114 * overwrite, just ignoring the update instead.
1116 * @param disk_use Pointer to the Disk Use.
1118 *****************************************************************************/
1119 void evel_measurement_disk_use_octetsreadmin_set(MEASUREMENT_DISK_USE * const disk_use,
1123 evel_set_option_double(&disk_use->octetsreadmin, val, "Octets readmin set");
1126 /**************************************************************************//**
1127 * Set number of octets per second written to a disk or partition;
1128 * provide the average measurement within the measurement interval
1130 * @note The property is treated as immutable: it is only valid to call
1131 * the setter once. However, we don't assert if the caller tries to
1132 * overwrite, just ignoring the update instead.
1134 * @param disk_use Pointer to the Disk Use.
1136 *****************************************************************************/
1137 void evel_measurement_disk_use_octetswriteavg_set(MEASUREMENT_DISK_USE * const disk_use,
1141 evel_set_option_double(&disk_use->octetswriteavg, val, "Octets writeavg set");
1144 /**************************************************************************//**
1145 * Set number of octets per second written to a disk or partition;
1146 * provide the last measurement within the measurement interval
1148 * @note The property is treated as immutable: it is only valid to call
1149 * the setter once. However, we don't assert if the caller tries to
1150 * overwrite, just ignoring the update instead.
1152 * @param disk_use Pointer to the Disk Use.
1154 *****************************************************************************/
1155 void evel_measurement_disk_use_octetswritelast_set(MEASUREMENT_DISK_USE * const disk_use,
1159 evel_set_option_double(&disk_use->octetswritelast, val, "Octets writelast set");
1162 /**************************************************************************//**
1163 * Set number of octets per second written to a disk or partition;
1164 * provide the maximum measurement within the measurement interval
1166 * @note The property is treated as immutable: it is only valid to call
1167 * the setter once. However, we don't assert if the caller tries to
1168 * overwrite, just ignoring the update instead.
1170 * @param disk_use Pointer to the Disk Use.
1172 *****************************************************************************/
1173 void evel_measurement_disk_use_octetswritemax_set(MEASUREMENT_DISK_USE * const disk_use,
1177 evel_set_option_double(&disk_use->octetswritemax, val, "Octets writemax set");
1180 /**************************************************************************//**
1181 * Set number of octets per second written to a disk or partition;
1182 * provide the minimum measurement within the measurement interval
1184 * @note The property is treated as immutable: it is only valid to call
1185 * the setter once. However, we don't assert if the caller tries to
1186 * overwrite, just ignoring the update instead.
1188 * @param disk_use Pointer to the Disk Use.
1190 *****************************************************************************/
1191 void evel_measurement_disk_use_octetswritemin_set(MEASUREMENT_DISK_USE * const disk_use,
1195 evel_set_option_double(&disk_use->octetswritemin, val, "Octets writemin set");
1199 /**************************************************************************//**
1200 * Set number of read operations per second issued to the disk;
1201 * provide the average measurement within the measurement interval
1203 * @note The property is treated as immutable: it is only valid to call
1204 * the setter once. However, we don't assert if the caller tries to
1205 * overwrite, just ignoring the update instead.
1207 * @param disk_use Pointer to the Disk Use.
1209 *****************************************************************************/
1210 void evel_measurement_disk_use_opsreadavg_set(MEASUREMENT_DISK_USE * const disk_use,
1214 evel_set_option_double(&disk_use->opsreadavg, val, "Disk read operation average set");
1217 /**************************************************************************//**
1218 * Set number of read operations per second issued to the disk;
1219 * provide the last measurement within the measurement interval
1221 * @note The property is treated as immutable: it is only valid to call
1222 * the setter once. However, we don't assert if the caller tries to
1223 * overwrite, just ignoring the update instead.
1225 * @param disk_use Pointer to the Disk Use.
1227 *****************************************************************************/
1228 void evel_measurement_disk_use_opsreadlast_set(MEASUREMENT_DISK_USE * const disk_use,
1232 evel_set_option_double(&disk_use->opsreadlast, val, "Disk read operation last set");
1235 /**************************************************************************//**
1236 * Set number of read operations per second issued to the disk;
1237 * provide the maximum measurement within the measurement interval
1239 * @note The property is treated as immutable: it is only valid to call
1240 * the setter once. However, we don't assert if the caller tries to
1241 * overwrite, just ignoring the update instead.
1243 * @param disk_use Pointer to the Disk Use.
1245 *****************************************************************************/
1246 void evel_measurement_disk_use_opsreadmax_set(MEASUREMENT_DISK_USE * const disk_use,
1250 evel_set_option_double(&disk_use->opsreadmax, val, "Disk read operation maximum set");
1253 /**************************************************************************//**
1254 * Set number of read operations per second issued to the disk;
1255 * provide the minimum measurement within the measurement interval
1257 * @note The property is treated as immutable: it is only valid to call
1258 * the setter once. However, we don't assert if the caller tries to
1259 * overwrite, just ignoring the update instead.
1261 * @param disk_use Pointer to the Disk Use.
1263 *****************************************************************************/
1264 void evel_measurement_disk_use_opsreadmin_set(MEASUREMENT_DISK_USE * const disk_use,
1268 evel_set_option_double(&disk_use->opsreadmin, val, "Disk read operation minimum set");
1271 /**************************************************************************//**
1272 * Set number of write operations per second issued to the disk;
1273 * provide the average measurement within the measurement interval
1275 * @note The property is treated as immutable: it is only valid to call
1276 * the setter once. However, we don't assert if the caller tries to
1277 * overwrite, just ignoring the update instead.
1279 * @param disk_use Pointer to the Disk Use.
1281 *****************************************************************************/
1282 void evel_measurement_disk_use_opswriteavg_set(MEASUREMENT_DISK_USE * const disk_use,
1286 evel_set_option_double(&disk_use->opswriteavg, val, "Disk write operation average set");
1289 /**************************************************************************//**
1290 * Set number of write operations per second issued to the disk;
1291 * provide the last measurement within the measurement interval
1293 * @note The property is treated as immutable: it is only valid to call
1294 * the setter once. However, we don't assert if the caller tries to
1295 * overwrite, just ignoring the update instead.
1297 * @param disk_use Pointer to the Disk Use.
1299 *****************************************************************************/
1300 void evel_measurement_disk_use_opswritelast_set(MEASUREMENT_DISK_USE * const disk_use,
1304 evel_set_option_double(&disk_use->opswritelast, val, "Disk write operation last set");
1308 /**************************************************************************//**
1309 * Set number of write operations per second issued to the disk;
1310 * provide the maximum measurement within the measurement interval
1312 * @note The property is treated as immutable: it is only valid to call
1313 * the setter once. However, we don't assert if the caller tries to
1314 * overwrite, just ignoring the update instead.
1316 * @param disk_use Pointer to the Disk Use.
1318 *****************************************************************************/
1319 void evel_measurement_disk_use_opswritemax_set(MEASUREMENT_DISK_USE * const disk_use,
1323 evel_set_option_double(&disk_use->opswritemax, val, "Disk write operation maximum set");
1326 /**************************************************************************//**
1327 * Set number of write operations per second issued to the disk;
1328 * provide the average measurement within the measurement interval
1330 * @note The property is treated as immutable: it is only valid to call
1331 * the setter once. However, we don't assert if the caller tries to
1332 * overwrite, just ignoring the update instead.
1334 * @param disk_use Pointer to the Disk Use.
1336 *****************************************************************************/
1337 void evel_measurement_disk_use_opswritemin_set(MEASUREMENT_DISK_USE * const disk_use,
1341 evel_set_option_double(&disk_use->opswritemin, val, "Disk write operation minimum set");
1345 /**************************************************************************//**
1346 * Set queue size of pending I/O operations per second;
1347 * provide the average measurement within the measurement interval
1349 * @note The property is treated as immutable: it is only valid to call
1350 * the setter once. However, we don't assert if the caller tries to
1351 * overwrite, just ignoring the update instead.
1353 * @param disk_use Pointer to the Disk Use.
1355 *****************************************************************************/
1356 void evel_measurement_disk_use_pendingopsavg_set(MEASUREMENT_DISK_USE * const disk_use,
1360 evel_set_option_double(&disk_use->pendingopsavg, val, "Disk pending operation average set");
1363 /**************************************************************************//**
1364 * Set queue size of pending I/O operations per second;
1365 * provide the last measurement within the measurement interval
1367 * @note The property is treated as immutable: it is only valid to call
1368 * the setter once. However, we don't assert if the caller tries to
1369 * overwrite, just ignoring the update instead.
1371 * @param disk_use Pointer to the Disk Use.
1373 *****************************************************************************/
1374 void evel_measurement_disk_use_pendingopslast_set(MEASUREMENT_DISK_USE * const disk_use,
1378 evel_set_option_double(&disk_use->pendingopslast, val, "Disk pending operation last set");
1381 /**************************************************************************//**
1382 * Set queue size of pending I/O operations per second;
1383 * provide the maximum measurement within the measurement interval
1385 * @note The property is treated as immutable: it is only valid to call
1386 * the setter once. However, we don't assert if the caller tries to
1387 * overwrite, just ignoring the update instead.
1389 * @param disk_use Pointer to the Disk Use.
1391 *****************************************************************************/
1392 void evel_measurement_disk_use_pendingopsmax_set(MEASUREMENT_DISK_USE * const disk_use,
1396 evel_set_option_double(&disk_use->pendingopsmax, val, "Disk pending operation maximum set");
1399 /**************************************************************************//**
1400 * Set queue size of pending I/O operations per second;
1401 * provide the minimum measurement within the measurement interval
1403 * @note The property is treated as immutable: it is only valid to call
1404 * the setter once. However, we don't assert if the caller tries to
1405 * overwrite, just ignoring the update instead.
1407 * @param disk_use Pointer to the Disk Use.
1409 *****************************************************************************/
1410 void evel_measurement_disk_use_pendingopsmin_set(MEASUREMENT_DISK_USE * const disk_use,
1414 evel_set_option_double(&disk_use->pendingopsmin, val, "Disk pending operation min set");
1418 /**************************************************************************//**
1419 * Set milliseconds a read operation took to complete;
1420 * provide the average measurement within the measurement interval
1422 * @note The property is treated as immutable: it is only valid to call
1423 * the setter once. However, we don't assert if the caller tries to
1424 * overwrite, just ignoring the update instead.
1426 * @param disk_use Pointer to the Disk Use.
1428 *****************************************************************************/
1429 void evel_measurement_disk_use_timereadavg_set(MEASUREMENT_DISK_USE * const disk_use,
1433 evel_set_option_double(&disk_use->timereadavg, val, "Disk read time average set");
1436 /**************************************************************************//**
1437 * Set milliseconds a read operation took to complete;
1438 * provide the last measurement within the measurement interval
1440 * @note The property is treated as immutable: it is only valid to call
1441 * the setter once. However, we don't assert if the caller tries to
1442 * overwrite, just ignoring the update instead.
1444 * @param disk_use Pointer to the Disk Use.
1446 *****************************************************************************/
1447 void evel_measurement_disk_use_timereadlast_set(MEASUREMENT_DISK_USE * const disk_use,
1451 evel_set_option_double(&disk_use->timereadlast, val, "Disk read time last set");
1454 /**************************************************************************//**
1455 * Set milliseconds a read operation took to complete;
1456 * provide the maximum measurement within the measurement interval
1458 * @note The property is treated as immutable: it is only valid to call
1459 * the setter once. However, we don't assert if the caller tries to
1460 * overwrite, just ignoring the update instead.
1462 * @param disk_use Pointer to the Disk Use.
1464 *****************************************************************************/
1465 void evel_measurement_disk_use_timereadmax_set(MEASUREMENT_DISK_USE * const disk_use,
1469 evel_set_option_double(&disk_use->timereadmax, val, "Disk read time maximum set");
1472 /**************************************************************************//**
1473 * Set milliseconds a read operation took to complete;
1474 * provide the minimum measurement within the measurement interval
1476 * @note The property is treated as immutable: it is only valid to call
1477 * the setter once. However, we don't assert if the caller tries to
1478 * overwrite, just ignoring the update instead.
1480 * @param disk_use Pointer to the Disk Use.
1482 *****************************************************************************/
1483 void evel_measurement_disk_use_timereadmin_set(MEASUREMENT_DISK_USE * const disk_use,
1487 evel_set_option_double(&disk_use->timereadmin, val, "Disk read time minimum set");
1490 /**************************************************************************//**
1491 * Set milliseconds a write operation took to complete;
1492 * provide the average measurement within the measurement interval
1494 * @note The property is treated as immutable: it is only valid to call
1495 * the setter once. However, we don't assert if the caller tries to
1496 * overwrite, just ignoring the update instead.
1498 * @param disk_use Pointer to the Disk Use.
1500 *****************************************************************************/
1501 void evel_measurement_disk_use_timewriteavg_set(MEASUREMENT_DISK_USE * const disk_use,
1505 evel_set_option_double(&disk_use->timewriteavg, val, "Disk write time average set");
1509 /**************************************************************************//**
1510 * Set milliseconds a write operation took to complete;
1511 * provide the last measurement within the measurement interval
1513 * @note The property is treated as immutable: it is only valid to call
1514 * the setter once. However, we don't assert if the caller tries to
1515 * overwrite, just ignoring the update instead.
1517 * @param disk_use Pointer to the Disk Use.
1519 *****************************************************************************/
1520 void evel_measurement_disk_use_timewritelast_set(MEASUREMENT_DISK_USE * const disk_use,
1524 evel_set_option_double(&disk_use->timewritelast, val, "Disk write time last set");
1527 /**************************************************************************//**
1528 * Set milliseconds a write operation took to complete;
1529 * provide the maximum measurement within the measurement interval
1531 * @note The property is treated as immutable: it is only valid to call
1532 * the setter once. However, we don't assert if the caller tries to
1533 * overwrite, just ignoring the update instead.
1535 * @param disk_use Pointer to the Disk Use.
1537 *****************************************************************************/
1538 void evel_measurement_disk_use_timewritemax_set(MEASUREMENT_DISK_USE * const disk_use,
1542 evel_set_option_double(&disk_use->timewritemax, val, "Disk write time max set");
1545 /**************************************************************************//**
1546 * Set milliseconds a write operation took to complete;
1547 * provide the average measurement within the measurement interval
1549 * @note The property is treated as immutable: it is only valid to call
1550 * the setter once. However, we don't assert if the caller tries to
1551 * overwrite, just ignoring the update instead.
1553 * @param disk_use Pointer to the Disk Use.
1555 *****************************************************************************/
1556 void evel_measurement_disk_use_timewritemin_set(MEASUREMENT_DISK_USE * const disk_use,
1560 evel_set_option_double(&disk_use->timewritemin, val, "Disk write time min set");
1564 /**************************************************************************//**
1565 * Add an additional File System usage value name/value pair to the
1568 * The filesystem_name is null delimited ASCII string. The library takes a
1569 * copy so the caller does not have to preserve values after the function
1572 * @param measurement Pointer to the measurement.
1573 * @param filesystem_name ASCIIZ string with the file-system's UUID.
1574 * @param block_configured Block storage configured.
1575 * @param block_used Block storage in use.
1576 * @param block_iops Block storage IOPS.
1577 * @param ephemeral_configured Ephemeral storage configured.
1578 * @param ephemeral_used Ephemeral storage in use.
1579 * @param ephemeral_iops Ephemeral storage IOPS.
1580 *****************************************************************************/
1581 void evel_measurement_fsys_use_add(EVENT_MEASUREMENT * measurement,
1582 char * filesystem_name,
1583 double block_configured,
1586 double ephemeral_configured,
1587 double ephemeral_used,
1588 double ephemeral_iops)
1590 MEASUREMENT_FSYS_USE * fsys_use = NULL;
1593 /***************************************************************************/
1594 /* Check assumptions. */
1595 /***************************************************************************/
1596 assert(measurement != NULL);
1597 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1598 assert(filesystem_name != NULL);
1599 assert(block_configured >= 0.0);
1600 assert(block_used >= 0.0);
1601 assert(block_iops >= 0.0);
1602 assert(ephemeral_configured >= 0.0);
1603 assert(ephemeral_used >= 0.0);
1604 assert(ephemeral_iops >= 0.0);
1606 /***************************************************************************/
1607 /* Allocate a container for the value and push onto the list. */
1608 /***************************************************************************/
1609 EVEL_DEBUG("Adding filesystem_name=%s", filesystem_name);
1610 fsys_use = malloc(sizeof(MEASUREMENT_FSYS_USE));
1611 assert(fsys_use != NULL);
1612 memset(fsys_use, 0, sizeof(MEASUREMENT_FSYS_USE));
1613 fsys_use->filesystem_name = strdup(filesystem_name);
1614 fsys_use->block_configured = block_configured;
1615 fsys_use->block_used = block_used;
1616 fsys_use->block_iops = block_iops;
1617 fsys_use->ephemeral_configured = ephemeral_configured;
1618 fsys_use->ephemeral_used = ephemeral_used;
1619 fsys_use->ephemeral_iops = ephemeral_iops;
1621 dlist_push_last(&measurement->filesystem_usage, fsys_use);
1626 /**************************************************************************//**
1627 * Add a Feature usage value name/value pair to the Measurement.
1629 * The name is null delimited ASCII string. The library takes
1630 * a copy so the caller does not have to preserve values after the function
1633 * @param measurement Pointer to the measurement.
1634 * @param feature ASCIIZ string with the feature's name.
1635 * @param utilization Utilization of the feature.
1636 *****************************************************************************/
1637 void evel_measurement_feature_use_add(EVENT_MEASUREMENT * measurement,
1641 MEASUREMENT_FEATURE_USE * feature_use = NULL;
1644 /***************************************************************************/
1645 /* Check assumptions. */
1646 /***************************************************************************/
1647 assert(measurement != NULL);
1648 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1649 assert(feature != NULL);
1650 assert(utilization >= 0);
1652 /***************************************************************************/
1653 /* Allocate a container for the value and push onto the list. */
1654 /***************************************************************************/
1655 EVEL_DEBUG("Adding Feature=%s Use=%d", feature, utilization);
1656 feature_use = malloc(sizeof(MEASUREMENT_FEATURE_USE));
1657 assert(feature_use != NULL);
1658 memset(feature_use, 0, sizeof(MEASUREMENT_FEATURE_USE));
1659 feature_use->feature_id = strdup(feature);
1660 assert(feature_use->feature_id != NULL);
1661 feature_use->feature_utilization = utilization;
1663 dlist_push_last(&measurement->feature_usage, feature_use);
1668 /**************************************************************************//**
1669 * Add a Additional Measurement value name/value pair to the Report.
1671 * The name is null delimited ASCII string. The library takes
1672 * a copy so the caller does not have to preserve values after the function
1675 * @param measurement Pointer to the Measaurement.
1676 * @param group ASCIIZ string with the measurement group's name.
1677 * @param name ASCIIZ string containing the measurement's name.
1678 * @param value ASCIIZ string containing the measurement's value.
1679 *****************************************************************************/
1680 void evel_measurement_custom_measurement_add(EVENT_MEASUREMENT * measurement,
1681 const char * const group,
1682 const char * const name,
1683 const char * const value)
1685 MEASUREMENT_GROUP * measurement_group = NULL;
1686 CUSTOM_MEASUREMENT * custom_measurement = NULL;
1687 DLIST_ITEM * item = NULL;
1690 /***************************************************************************/
1691 /* Check assumptions. */
1692 /***************************************************************************/
1693 assert(measurement != NULL);
1694 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1695 assert(group != NULL);
1696 assert(name != NULL);
1697 assert(value != NULL);
1699 /***************************************************************************/
1700 /* Allocate a container for the name/value pair. */
1701 /***************************************************************************/
1702 EVEL_DEBUG("Adding Measurement Group=%s Name=%s Value=%s",
1703 group, name, value);
1704 custom_measurement = malloc(sizeof(CUSTOM_MEASUREMENT));
1705 assert(custom_measurement != NULL);
1706 memset(custom_measurement, 0, sizeof(CUSTOM_MEASUREMENT));
1707 custom_measurement->name = strdup(name);
1708 assert(custom_measurement->name != NULL);
1709 custom_measurement->value = strdup(value);
1710 assert(custom_measurement->value != NULL);
1712 /***************************************************************************/
1713 /* See if we have that group already. */
1714 /***************************************************************************/
1715 item = dlist_get_first(&measurement->additional_measurements);
1716 while (item != NULL)
1718 measurement_group = (MEASUREMENT_GROUP *) item->item;
1719 assert(measurement_group != NULL);
1721 EVEL_DEBUG("Got measurement group %s", measurement_group->name);
1722 if (strcmp(group, measurement_group->name) == 0)
1724 EVEL_DEBUG("Found existing Measurement Group");
1727 item = dlist_get_next(item);
1730 /***************************************************************************/
1731 /* If we didn't have the group already, create it. */
1732 /***************************************************************************/
1735 EVEL_DEBUG("Creating new Measurement Group");
1736 measurement_group = malloc(sizeof(MEASUREMENT_GROUP));
1737 assert(measurement_group != NULL);
1738 memset(measurement_group, 0, sizeof(MEASUREMENT_GROUP));
1739 measurement_group->name = strdup(group);
1740 assert(measurement_group->name != NULL);
1741 dlist_initialize(&measurement_group->measurements);
1742 dlist_push_last(&measurement->additional_measurements, measurement_group);
1745 /***************************************************************************/
1746 /* If we didn't have the group already, create it. */
1747 /***************************************************************************/
1748 dlist_push_last(&measurement_group->measurements, custom_measurement);
1753 /**************************************************************************//**
1754 * Add a Codec usage value name/value pair to the Measurement.
1756 * The name is null delimited ASCII string. The library takes
1757 * a copy so the caller does not have to preserve values after the function
1760 * @param measurement Pointer to the measurement.
1761 * @param codec ASCIIZ string with the codec's name.
1762 * @param utilization Number of codecs in use.
1763 *****************************************************************************/
1764 void evel_measurement_codec_use_add(EVENT_MEASUREMENT * measurement,
1768 MEASUREMENT_CODEC_USE * codec_use = NULL;
1771 /***************************************************************************/
1772 /* Check assumptions. */
1773 /***************************************************************************/
1774 assert(measurement != NULL);
1775 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1776 assert(codec != NULL);
1777 assert(utilization >= 0.0);
1779 /***************************************************************************/
1780 /* Allocate a container for the value and push onto the list. */
1781 /***************************************************************************/
1782 EVEL_DEBUG("Adding Codec=%s Use=%d", codec, utilization);
1783 codec_use = malloc(sizeof(MEASUREMENT_CODEC_USE));
1784 assert(codec_use != NULL);
1785 memset(codec_use, 0, sizeof(MEASUREMENT_CODEC_USE));
1786 codec_use->codec_id = strdup(codec);
1787 assert(codec_use->codec_id != NULL);
1788 codec_use->number_in_use = utilization;
1790 dlist_push_last(&measurement->codec_usage, codec_use);
1796 /**************************************************************************//**
1797 * Set the Media Ports in Use property of the Measurement.
1799 * @note The property is treated as immutable: it is only valid to call
1800 * the setter once. However, we don't assert if the caller tries to
1801 * overwrite, just ignoring the update instead.
1803 * @param measurement Pointer to the measurement.
1804 * @param media_ports_in_use The media port usage to set.
1805 *****************************************************************************/
1806 void evel_measurement_media_port_use_set(EVENT_MEASUREMENT * measurement,
1807 int media_ports_in_use)
1811 /***************************************************************************/
1812 /* Check preconditions. */
1813 /***************************************************************************/
1814 assert(measurement != NULL);
1815 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1816 assert(media_ports_in_use >= 0);
1818 evel_set_option_int(&measurement->media_ports_in_use,
1820 "Media Ports In Use");
1824 /**************************************************************************//**
1825 * Set the VNFC Scaling Metric property of the Measurement.
1827 * @note The property is treated as immutable: it is only valid to call
1828 * the setter once. However, we don't assert if the caller tries to
1829 * overwrite, just ignoring the update instead.
1831 * @param measurement Pointer to the measurement.
1832 * @param scaling_metric The scaling metric to set.
1833 *****************************************************************************/
1834 void evel_measurement_vnfc_scaling_metric_set(EVENT_MEASUREMENT * measurement,
1839 /***************************************************************************/
1840 /* Check preconditions. */
1841 /***************************************************************************/
1842 assert(measurement != NULL);
1843 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1844 assert(scaling_metric >= 0.0);
1846 evel_set_option_int(&measurement->vnfc_scaling_metric,
1848 "VNFC Scaling Metric");
1852 /**************************************************************************//**
1853 * Create a new Latency Bucket to be added to a Measurement event.
1855 * @note The mandatory fields on the ::MEASUREMENT_LATENCY_BUCKET must be
1856 * supplied to this factory function and are immutable once set.
1857 * Optional fields have explicit setter functions, but again values
1858 * may only be set once so that the ::MEASUREMENT_LATENCY_BUCKET has
1859 * immutable properties.
1861 * @param count Count of events in this bucket.
1863 * @returns pointer to the newly manufactured ::MEASUREMENT_LATENCY_BUCKET.
1864 * If the structure is not used it must be released using free.
1865 * @retval NULL Failed to create the Latency Bucket.
1866 *****************************************************************************/
1867 MEASUREMENT_LATENCY_BUCKET * evel_new_meas_latency_bucket(const int count)
1869 MEASUREMENT_LATENCY_BUCKET * bucket;
1873 /***************************************************************************/
1874 /* Check preconditions. */
1875 /***************************************************************************/
1878 /***************************************************************************/
1879 /* Allocate, then set Mandatory Parameters. */
1880 /***************************************************************************/
1881 EVEL_DEBUG("Creating bucket, count = %d", count);
1882 bucket = malloc(sizeof(MEASUREMENT_LATENCY_BUCKET));
1883 assert(bucket != NULL);
1885 /***************************************************************************/
1886 /* Set Mandatory Parameters. */
1887 /***************************************************************************/
1888 bucket->count = count;
1890 /***************************************************************************/
1891 /* Initialize Optional Parameters. */
1892 /***************************************************************************/
1893 evel_init_option_double(&bucket->high_end);
1894 evel_init_option_double(&bucket->low_end);
1901 /**************************************************************************//**
1902 * Set the High End property of the Measurement Latency Bucket.
1904 * @note The property is treated as immutable: it is only valid to call
1905 * the setter once. However, we don't assert if the caller tries to
1906 * overwrite, just ignoring the update instead.
1908 * @param bucket Pointer to the Measurement Latency Bucket.
1909 * @param high_end High end of the bucket's range.
1910 *****************************************************************************/
1911 void evel_meas_latency_bucket_high_end_set(
1912 MEASUREMENT_LATENCY_BUCKET * const bucket,
1913 const double high_end)
1917 /***************************************************************************/
1918 /* Check preconditions. */
1919 /***************************************************************************/
1920 assert(high_end >= 0.0);
1921 evel_set_option_double(&bucket->high_end, high_end, "High End");
1926 /**************************************************************************//**
1927 * Set the Low End property of the Measurement Latency Bucket.
1929 * @note The property is treated as immutable: it is only valid to call
1930 * the setter once. However, we don't assert if the caller tries to
1931 * overwrite, just ignoring the update instead.
1933 * @param bucket Pointer to the Measurement Latency Bucket.
1934 * @param low_end Low end of the bucket's range.
1935 *****************************************************************************/
1936 void evel_meas_latency_bucket_low_end_set(
1937 MEASUREMENT_LATENCY_BUCKET * const bucket,
1938 const double low_end)
1942 /***************************************************************************/
1943 /* Check preconditions. */
1944 /***************************************************************************/
1945 assert(low_end >= 0.0);
1946 evel_set_option_double(&bucket->low_end, low_end, "Low End");
1950 /**************************************************************************//**
1951 * Add an additional Measurement Latency Bucket to the specified event.
1953 * @param measurement Pointer to the Measurement event.
1954 * @param bucket Pointer to the Measurement Latency Bucket to add.
1955 *****************************************************************************/
1956 void evel_meas_latency_bucket_add(EVENT_MEASUREMENT * const measurement,
1957 MEASUREMENT_LATENCY_BUCKET * const bucket)
1961 /***************************************************************************/
1962 /* Check preconditions. */
1963 /***************************************************************************/
1964 assert(measurement != NULL);
1965 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1966 assert(bucket != NULL);
1967 dlist_push_last(&measurement->latency_distribution, bucket);
1972 /**************************************************************************//**
1973 * Add an additional Latency Distribution bucket to the Measurement.
1975 * This function implements the previous API, purely for convenience.
1977 * @param measurement Pointer to the measurement.
1978 * @param low_end Low end of the bucket's range.
1979 * @param high_end High end of the bucket's range.
1980 * @param count Count of events in this bucket.
1981 *****************************************************************************/
1982 void evel_measurement_latency_add(EVENT_MEASUREMENT * const measurement,
1983 const double low_end,
1984 const double high_end,
1987 MEASUREMENT_LATENCY_BUCKET * bucket = NULL;
1991 /***************************************************************************/
1992 /* Trust the assertions in the underlying methods. */
1993 /***************************************************************************/
1994 bucket = evel_new_meas_latency_bucket(count);
1995 evel_meas_latency_bucket_low_end_set(bucket, low_end);
1996 evel_meas_latency_bucket_high_end_set(bucket, high_end);
1997 evel_meas_latency_bucket_add(measurement, bucket);
2002 /**************************************************************************//**
2003 * Create a new vNIC Use to be added to a Measurement event.
2005 * @note The mandatory fields on the ::MEASUREMENT_VNIC_PERFORMANCE must be supplied
2006 * to this factory function and are immutable once set. Optional
2007 * fields have explicit setter functions, but again values may only be
2008 * set once so that the ::MEASUREMENT_VNIC_PERFORMANCE has immutable
2011 * @param vnic_id ASCIIZ string with the vNIC's ID.
2012 * @param val_suspect True or false confidence in data.
2014 * @returns pointer to the newly manufactured ::MEASUREMENT_VNIC_PERFORMANCE.
2015 * If the structure is not used it must be released using
2016 * ::evel_measurement_free_vnic_performance.
2017 * @retval NULL Failed to create the vNIC Use.
2018 *****************************************************************************/
2019 MEASUREMENT_VNIC_PERFORMANCE * evel_measurement_new_vnic_performance(char * const vnic_id,
2020 char * const val_suspect)
2022 MEASUREMENT_VNIC_PERFORMANCE * vnic_performance;
2026 /***************************************************************************/
2027 /* Check preconditions. */
2028 /***************************************************************************/
2029 assert(vnic_id != NULL);
2030 assert(!strcmp(val_suspect,"true") || !strcmp(val_suspect,"false"));
2032 /***************************************************************************/
2033 /* Allocate, then set Mandatory Parameters. */
2034 /***************************************************************************/
2035 EVEL_DEBUG("Adding VNIC ID=%s", vnic_id);
2036 vnic_performance = malloc(sizeof(MEASUREMENT_VNIC_PERFORMANCE));
2037 assert(vnic_performance != NULL);
2038 vnic_performance->vnic_id = strdup(vnic_id);
2039 vnic_performance->valuesaresuspect = strdup(val_suspect);
2041 /***************************************************************************/
2042 /* Initialize Optional Parameters. */
2043 /***************************************************************************/
2044 evel_init_option_double(&vnic_performance-> recvd_bcast_packets_acc);
2045 evel_init_option_double(&vnic_performance-> recvd_bcast_packets_delta);
2046 evel_init_option_double(&vnic_performance-> recvd_discarded_packets_acc);
2047 evel_init_option_double(&vnic_performance-> recvd_discarded_packets_delta);
2048 evel_init_option_double(&vnic_performance-> recvd_error_packets_acc);
2049 evel_init_option_double(&vnic_performance-> recvd_error_packets_delta);
2050 evel_init_option_double(&vnic_performance-> recvd_mcast_packets_acc);
2051 evel_init_option_double(&vnic_performance-> recvd_mcast_packets_delta);
2052 evel_init_option_double(&vnic_performance-> recvd_octets_acc);
2053 evel_init_option_double(&vnic_performance-> recvd_octets_delta);
2054 evel_init_option_double(&vnic_performance-> recvd_total_packets_acc);
2055 evel_init_option_double(&vnic_performance-> recvd_total_packets_delta);
2056 evel_init_option_double(&vnic_performance-> recvd_ucast_packets_acc);
2057 evel_init_option_double(&vnic_performance-> recvd_ucast_packets_delta);
2058 evel_init_option_double(&vnic_performance-> tx_bcast_packets_acc);
2059 evel_init_option_double(&vnic_performance-> tx_bcast_packets_delta);
2060 evel_init_option_double(&vnic_performance-> tx_discarded_packets_acc);
2061 evel_init_option_double(&vnic_performance-> tx_discarded_packets_delta);
2062 evel_init_option_double(&vnic_performance-> tx_error_packets_acc);
2063 evel_init_option_double(&vnic_performance-> tx_error_packets_delta);
2064 evel_init_option_double(&vnic_performance-> tx_mcast_packets_acc);
2065 evel_init_option_double(&vnic_performance-> tx_mcast_packets_delta);
2066 evel_init_option_double(&vnic_performance-> tx_octets_acc);
2067 evel_init_option_double(&vnic_performance-> tx_octets_delta);
2068 evel_init_option_double(&vnic_performance-> tx_total_packets_acc);
2069 evel_init_option_double(&vnic_performance-> tx_total_packets_delta);
2070 evel_init_option_double(&vnic_performance-> tx_ucast_packets_acc);
2071 evel_init_option_double(&vnic_performance-> tx_ucast_packets_delta);
2075 return vnic_performance;
2078 /**************************************************************************//**
2081 * Free off the ::MEASUREMENT_VNIC_PERFORMANCE supplied. Will free all the contained
2084 * @note It does not free the vNIC Use itself, since that may be part of a
2086 *****************************************************************************/
2087 void evel_measurement_free_vnic_performance(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance)
2091 /***************************************************************************/
2092 /* Check preconditions. */
2093 /***************************************************************************/
2094 assert(vnic_performance != NULL);
2095 assert(vnic_performance->vnic_id != NULL);
2096 assert(vnic_performance->valuesaresuspect != NULL);
2098 /***************************************************************************/
2099 /* Free the duplicated string. */
2100 /***************************************************************************/
2101 free(vnic_performance->vnic_id);
2102 free(vnic_performance->valuesaresuspect);
2103 vnic_performance->vnic_id = NULL;
2108 /**************************************************************************//**
2109 * Set the Accumulated Broadcast Packets Received in measurement interval
2110 * property of the vNIC performance.
2112 * @note The property is treated as immutable: it is only valid to call
2113 * the setter once. However, we don't assert if the caller tries to
2114 * overwrite, just ignoring the update instead.
2116 * @param vnic_performance Pointer to the vNIC Use.
2117 * @param recvd_bcast_packets_acc
2118 *****************************************************************************/
2119 void evel_vnic_performance_rx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2120 const double recvd_bcast_packets_acc)
2124 /***************************************************************************/
2125 /* Check preconditions. */
2126 /***************************************************************************/
2127 assert(recvd_bcast_packets_acc >= 0.0);
2129 evel_set_option_double(&vnic_performance->recvd_bcast_packets_acc,
2130 recvd_bcast_packets_acc,
2131 "Broadcast Packets accumulated");
2136 /**************************************************************************//**
2137 * Set the Delta Broadcast Packets Received in measurement interval
2138 * property of the vNIC performance.
2140 * @note The property is treated as immutable: it is only valid to call
2141 * the setter once. However, we don't assert if the caller tries to
2142 * overwrite, just ignoring the update instead.
2144 * @param vnic_performance Pointer to the vNIC Use.
2145 * @param recvd_bcast_packets_delta
2146 *****************************************************************************/
2147 void evel_vnic_performance_rx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2148 const double recvd_bcast_packets_delta)
2152 /***************************************************************************/
2153 /* Check preconditions. */
2154 /***************************************************************************/
2155 assert(recvd_bcast_packets_delta >= 0.0);
2157 evel_set_option_double(&vnic_performance->recvd_bcast_packets_delta,
2158 recvd_bcast_packets_delta,
2159 "Delta Broadcast Packets recieved");
2165 /**************************************************************************//**
2166 * Set the Discarded Packets Received in measurement interval
2167 * property of the vNIC performance.
2169 * @note The property is treated as immutable: it is only valid to call
2170 * the setter once. However, we don't assert if the caller tries to
2171 * overwrite, just ignoring the update instead.
2173 * @param vnic_performance Pointer to the vNIC Use.
2174 * @param recvd_discard_packets_acc
2175 *****************************************************************************/
2176 void evel_vnic_performance_rx_discard_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2177 const double recvd_discard_packets_acc)
2181 /***************************************************************************/
2182 /* Check preconditions. */
2183 /***************************************************************************/
2184 assert(recvd_discard_packets_acc >= 0.0);
2186 evel_set_option_double(&vnic_performance->recvd_discarded_packets_acc,
2187 recvd_discard_packets_acc,
2188 "Discarded Packets accumulated");
2193 /**************************************************************************//**
2194 * Set the Delta Discarded Packets Received in measurement interval
2195 * property of the vNIC performance.
2197 * @note The property is treated as immutable: it is only valid to call
2198 * the setter once. However, we don't assert if the caller tries to
2199 * overwrite, just ignoring the update instead.
2201 * @param vnic_performance Pointer to the vNIC Use.
2202 * @param recvd_discard_packets_delta
2203 *****************************************************************************/
2204 void evel_vnic_performance_rx_discard_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2205 const double recvd_discard_packets_delta)
2209 /***************************************************************************/
2210 /* Check preconditions. */
2211 /***************************************************************************/
2212 assert(recvd_discard_packets_delta >= 0.0);
2214 evel_set_option_double(&vnic_performance->recvd_discarded_packets_delta,
2215 recvd_discard_packets_delta,
2216 "Delta Discarded Packets recieved");
2222 /**************************************************************************//**
2223 * Set the Error Packets Received in measurement interval
2224 * property of the vNIC performance.
2226 * @note The property is treated as immutable: it is only valid to call
2227 * the setter once. However, we don't assert if the caller tries to
2228 * overwrite, just ignoring the update instead.
2230 * @param vnic_performance Pointer to the vNIC Use.
2231 * @param recvd_error_packets_acc
2232 *****************************************************************************/
2233 void evel_vnic_performance_rx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2234 const double recvd_error_packets_acc)
2238 /***************************************************************************/
2239 /* Check preconditions. */
2240 /***************************************************************************/
2241 assert(recvd_error_packets_acc >= 0.0);
2243 evel_set_option_double(&vnic_performance->recvd_error_packets_acc,
2244 recvd_error_packets_acc,
2245 "Error Packets received accumulated");
2250 /**************************************************************************//**
2251 * Set the Delta Error Packets Received in measurement interval
2252 * property of the vNIC performance.
2254 * @note The property is treated as immutable: it is only valid to call
2255 * the setter once. However, we don't assert if the caller tries to
2256 * overwrite, just ignoring the update instead.
2258 * @param vnic_performance Pointer to the vNIC Use.
2259 * @param recvd_error_packets_delta
2260 *****************************************************************************/
2261 void evel_vnic_performance_rx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2262 const double recvd_error_packets_delta)
2266 /***************************************************************************/
2267 /* Check preconditions. */
2268 /***************************************************************************/
2269 assert(recvd_error_packets_delta >= 0.0);
2271 evel_set_option_double(&vnic_performance->recvd_error_packets_delta,
2272 recvd_error_packets_delta,
2273 "Delta Error Packets recieved");
2278 /**************************************************************************//**
2279 * Set the Accumulated Multicast Packets Received in measurement interval
2280 * property of the vNIC performance.
2282 * @note The property is treated as immutable: it is only valid to call
2283 * the setter once. However, we don't assert if the caller tries to
2284 * overwrite, just ignoring the update instead.
2286 * @param vnic_performance Pointer to the vNIC Use.
2287 * @param recvd_mcast_packets_acc
2288 *****************************************************************************/
2289 void evel_vnic_performance_rx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2290 const double recvd_mcast_packets_acc)
2294 /***************************************************************************/
2295 /* Check preconditions. */
2296 /***************************************************************************/
2297 assert(recvd_mcast_packets_acc >= 0.0);
2299 evel_set_option_double(&vnic_performance->recvd_mcast_packets_acc,
2300 recvd_mcast_packets_acc,
2301 "Multicast Packets accumulated");
2306 /**************************************************************************//**
2307 * Set the Delta Multicast Packets Received in measurement interval
2308 * property of the vNIC performance.
2310 * @note The property is treated as immutable: it is only valid to call
2311 * the setter once. However, we don't assert if the caller tries to
2312 * overwrite, just ignoring the update instead.
2314 * @param vnic_performance Pointer to the vNIC Use.
2315 * @param recvd_mcast_packets_delta
2316 *****************************************************************************/
2317 void evel_vnic_performance_rx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2318 const double recvd_mcast_packets_delta)
2322 /***************************************************************************/
2323 /* Check preconditions. */
2324 /***************************************************************************/
2325 assert(recvd_mcast_packets_delta >= 0.0);
2327 evel_set_option_double(&vnic_performance->recvd_mcast_packets_delta,
2328 recvd_mcast_packets_delta,
2329 "Delta Multicast Packets recieved");
2334 /**************************************************************************//**
2335 * Set the Accumulated Octets Received in measurement interval
2336 * property of the vNIC performance.
2338 * @note The property is treated as immutable: it is only valid to call
2339 * the setter once. However, we don't assert if the caller tries to
2340 * overwrite, just ignoring the update instead.
2342 * @param vnic_performance Pointer to the vNIC Use.
2343 * @param recvd_octets_acc
2344 *****************************************************************************/
2345 void evel_vnic_performance_rx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2346 const double recvd_octets_acc)
2350 /***************************************************************************/
2351 /* Check preconditions. */
2352 /***************************************************************************/
2353 assert(recvd_octets_acc >= 0.0);
2355 evel_set_option_double(&vnic_performance->recvd_octets_acc,
2357 "Octets received accumulated");
2362 /**************************************************************************//**
2363 * Set the Delta Octets Received in measurement interval
2364 * property of the vNIC performance.
2366 * @note The property is treated as immutable: it is only valid to call
2367 * the setter once. However, we don't assert if the caller tries to
2368 * overwrite, just ignoring the update instead.
2370 * @param vnic_performance Pointer to the vNIC Use.
2371 * @param recvd_octets_delta
2372 *****************************************************************************/
2373 void evel_vnic_performance_rx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2374 const double recvd_octets_delta)
2378 /***************************************************************************/
2379 /* Check preconditions. */
2380 /***************************************************************************/
2381 assert(recvd_octets_delta >= 0.0);
2383 evel_set_option_double(&vnic_performance->recvd_octets_delta,
2385 "Delta Octets recieved");
2390 /**************************************************************************//**
2391 * Set the Accumulated Total Packets Received in measurement interval
2392 * property of the vNIC performance.
2394 * @note The property is treated as immutable: it is only valid to call
2395 * the setter once. However, we don't assert if the caller tries to
2396 * overwrite, just ignoring the update instead.
2398 * @param vnic_performance Pointer to the vNIC Use.
2399 * @param recvd_total_packets_acc
2400 *****************************************************************************/
2401 void evel_vnic_performance_rx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2402 const double recvd_total_packets_acc)
2406 /***************************************************************************/
2407 /* Check preconditions. */
2408 /***************************************************************************/
2409 assert(recvd_total_packets_acc >= 0.0);
2411 evel_set_option_double(&vnic_performance->recvd_total_packets_acc,
2412 recvd_total_packets_acc,
2413 "Total Packets accumulated");
2418 /**************************************************************************//**
2419 * Set the Delta Total Packets Received in measurement interval
2420 * property of the vNIC performance.
2422 * @note The property is treated as immutable: it is only valid to call
2423 * the setter once. However, we don't assert if the caller tries to
2424 * overwrite, just ignoring the update instead.
2426 * @param vnic_performance Pointer to the vNIC Use.
2427 * @param recvd_total_packets_delta
2428 *****************************************************************************/
2429 void evel_vnic_performance_rx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2430 const double recvd_total_packets_delta)
2434 /***************************************************************************/
2435 /* Check preconditions. */
2436 /***************************************************************************/
2437 assert(recvd_total_packets_delta >= 0.0);
2439 evel_set_option_double(&vnic_performance->recvd_total_packets_delta,
2440 recvd_total_packets_delta,
2441 "Delta Total Packets recieved");
2446 /**************************************************************************//**
2447 * Set the Accumulated Unicast Packets Received in measurement interval
2448 * property of the vNIC performance.
2450 * @note The property is treated as immutable: it is only valid to call
2451 * the setter once. However, we don't assert if the caller tries to
2452 * overwrite, just ignoring the update instead.
2454 * @param vnic_performance Pointer to the vNIC Use.
2455 * @param recvd_ucast_packets_acc
2456 *****************************************************************************/
2457 void evel_vnic_performance_rx_ucast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2458 const double recvd_ucast_packets_acc)
2462 /***************************************************************************/
2463 /* Check preconditions. */
2464 /***************************************************************************/
2465 assert(recvd_ucast_packets_acc >= 0.0);
2467 evel_set_option_double(&vnic_performance->recvd_ucast_packets_acc,
2468 recvd_ucast_packets_acc,
2469 "Unicast Packets received accumulated");
2474 /**************************************************************************//**
2475 * Set the Delta Unicast packets Received in measurement interval
2476 * property of the vNIC performance.
2478 * @note The property is treated as immutable: it is only valid to call
2479 * the setter once. However, we don't assert if the caller tries to
2480 * overwrite, just ignoring the update instead.
2482 * @param vnic_performance Pointer to the vNIC Use.
2483 * @param recvd_ucast_packets_delta
2484 *****************************************************************************/
2485 void evel_vnic_performance_rx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2486 const double recvd_ucast_packets_delta)
2490 /***************************************************************************/
2491 /* Check preconditions. */
2492 /***************************************************************************/
2493 assert(recvd_ucast_packets_delta >= 0.0);
2495 evel_set_option_double(&vnic_performance->recvd_ucast_packets_delta,
2496 recvd_ucast_packets_delta,
2497 "Delta Unicast packets recieved");
2502 /**************************************************************************//**
2503 * Set the Transmitted Broadcast Packets in measurement interval
2504 * property of the vNIC performance.
2506 * @note The property is treated as immutable: it is only valid to call
2507 * the setter once. However, we don't assert if the caller tries to
2508 * overwrite, just ignoring the update instead.
2510 * @param vnic_performance Pointer to the vNIC Use.
2511 * @param tx_bcast_packets_acc
2512 *****************************************************************************/
2513 void evel_vnic_performance_tx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2514 const double tx_bcast_packets_acc)
2518 /***************************************************************************/
2519 /* Check preconditions. */
2520 /***************************************************************************/
2521 assert(tx_bcast_packets_acc >= 0.0);
2523 evel_set_option_double(&vnic_performance->tx_bcast_packets_acc,
2524 tx_bcast_packets_acc,
2525 "Transmitted Broadcast Packets accumulated");
2530 /**************************************************************************//**
2531 * Set the Delta Broadcast packets Transmitted in measurement interval
2532 * property of the vNIC performance.
2534 * @note The property is treated as immutable: it is only valid to call
2535 * the setter once. However, we don't assert if the caller tries to
2536 * overwrite, just ignoring the update instead.
2538 * @param vnic_performance Pointer to the vNIC Use.
2539 * @param tx_bcast_packets_delta
2540 *****************************************************************************/
2541 void evel_vnic_performance_tx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2542 const double tx_bcast_packets_delta)
2546 /***************************************************************************/
2547 /* Check preconditions. */
2548 /***************************************************************************/
2549 assert(tx_bcast_packets_delta >= 0.0);
2551 evel_set_option_double(&vnic_performance->tx_bcast_packets_delta,
2552 tx_bcast_packets_delta,
2553 "Delta Transmitted Broadcast packets ");
2558 /**************************************************************************//**
2559 * Set the Transmitted Discarded Packets in measurement interval
2560 * property of the vNIC performance.
2562 * @note The property is treated as immutable: it is only valid to call
2563 * the setter once. However, we don't assert if the caller tries to
2564 * overwrite, just ignoring the update instead.
2566 * @param vnic_performance Pointer to the vNIC Use.
2567 * @param tx_discarded_packets_acc
2568 *****************************************************************************/
2569 void evel_vnic_performance_tx_discarded_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2570 const double tx_discarded_packets_acc)
2574 /***************************************************************************/
2575 /* Check preconditions. */
2576 /***************************************************************************/
2577 assert(tx_discarded_packets_acc >= 0.0);
2579 evel_set_option_double(&vnic_performance->tx_discarded_packets_acc,
2580 tx_discarded_packets_acc,
2581 "Transmitted Discarded Packets accumulated");
2586 /**************************************************************************//**
2587 * Set the Delta Discarded packets Transmitted in measurement interval
2588 * property of the vNIC performance.
2590 * @note The property is treated as immutable: it is only valid to call
2591 * the setter once. However, we don't assert if the caller tries to
2592 * overwrite, just ignoring the update instead.
2594 * @param vnic_performance Pointer to the vNIC Use.
2595 * @param tx_discarded_packets_delta
2596 *****************************************************************************/
2597 void evel_vnic_performance_tx_discarded_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2598 const double tx_discarded_packets_delta)
2602 /***************************************************************************/
2603 /* Check preconditions. */
2604 /***************************************************************************/
2605 assert(tx_discarded_packets_delta >= 0.0);
2607 evel_set_option_double(&vnic_performance->tx_discarded_packets_delta,
2608 tx_discarded_packets_delta,
2609 "Delta Transmitted Discarded packets ");
2614 /**************************************************************************//**
2615 * Set the Transmitted Errored Packets in measurement interval
2616 * property of the vNIC performance.
2618 * @note The property is treated as immutable: it is only valid to call
2619 * the setter once. However, we don't assert if the caller tries to
2620 * overwrite, just ignoring the update instead.
2622 * @param vnic_performance Pointer to the vNIC Use.
2623 * @param tx_error_packets_acc
2624 *****************************************************************************/
2625 void evel_vnic_performance_tx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2626 const double tx_error_packets_acc)
2630 /***************************************************************************/
2631 /* Check preconditions. */
2632 /***************************************************************************/
2633 assert(tx_error_packets_acc >= 0.0);
2635 evel_set_option_double(&vnic_performance->tx_error_packets_acc,
2636 tx_error_packets_acc,
2637 "Transmitted Error Packets accumulated");
2642 /**************************************************************************//**
2643 * Set the Delta Errored packets Transmitted in measurement interval
2644 * property of the vNIC performance.
2646 * @note The property is treated as immutable: it is only valid to call
2647 * the setter once. However, we don't assert if the caller tries to
2648 * overwrite, just ignoring the update instead.
2650 * @param vnic_performance Pointer to the vNIC Use.
2651 * @param tx_error_packets_delta
2652 *****************************************************************************/
2653 void evel_vnic_performance_tx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2654 const double tx_error_packets_delta)
2658 /***************************************************************************/
2659 /* Check preconditions. */
2660 /***************************************************************************/
2661 assert(tx_error_packets_delta >= 0.0);
2663 evel_set_option_double(&vnic_performance->tx_error_packets_delta,
2664 tx_error_packets_delta,
2665 "Delta Transmitted Error packets ");
2670 /**************************************************************************//**
2671 * Set the Transmitted Multicast Packets in measurement interval
2672 * property of the vNIC performance.
2674 * @note The property is treated as immutable: it is only valid to call
2675 * the setter once. However, we don't assert if the caller tries to
2676 * overwrite, just ignoring the update instead.
2678 * @param vnic_performance Pointer to the vNIC Use.
2679 * @param tx_mcast_packets_acc
2680 *****************************************************************************/
2681 void evel_vnic_performance_tx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2682 const double tx_mcast_packets_acc)
2686 /***************************************************************************/
2687 /* Check preconditions. */
2688 /***************************************************************************/
2689 assert(tx_mcast_packets_acc >= 0.0);
2691 evel_set_option_double(&vnic_performance->tx_mcast_packets_acc,
2692 tx_mcast_packets_acc,
2693 "Transmitted Multicast Packets accumulated");
2698 /**************************************************************************//**
2699 * Set the Delta Multicast packets Transmitted in measurement interval
2700 * property of the vNIC performance.
2702 * @note The property is treated as immutable: it is only valid to call
2703 * the setter once. However, we don't assert if the caller tries to
2704 * overwrite, just ignoring the update instead.
2706 * @param vnic_performance Pointer to the vNIC Use.
2707 * @param tx_mcast_packets_delta
2708 *****************************************************************************/
2709 void evel_vnic_performance_tx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2710 const double tx_mcast_packets_delta)
2714 /***************************************************************************/
2715 /* Check preconditions. */
2716 /***************************************************************************/
2717 assert(tx_mcast_packets_delta >= 0.0);
2719 evel_set_option_double(&vnic_performance->tx_mcast_packets_delta,
2720 tx_mcast_packets_delta,
2721 "Delta Transmitted Multicast packets ");
2726 /**************************************************************************//**
2727 * Set the Transmitted Octets in measurement interval
2728 * property of the vNIC performance.
2730 * @note The property is treated as immutable: it is only valid to call
2731 * the setter once. However, we don't assert if the caller tries to
2732 * overwrite, just ignoring the update instead.
2734 * @param vnic_performance Pointer to the vNIC Use.
2735 * @param tx_octets_acc
2736 *****************************************************************************/
2737 void evel_vnic_performance_tx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2738 const double tx_octets_acc)
2742 /***************************************************************************/
2743 /* Check preconditions. */
2744 /***************************************************************************/
2745 assert(tx_octets_acc >= 0.0);
2747 evel_set_option_double(&vnic_performance->tx_octets_acc,
2749 "Transmitted Octets accumulated");
2754 /**************************************************************************//**
2755 * Set the Delta Octets Transmitted in measurement interval
2756 * property of the vNIC performance.
2758 * @note The property is treated as immutable: it is only valid to call
2759 * the setter once. However, we don't assert if the caller tries to
2760 * overwrite, just ignoring the update instead.
2762 * @param vnic_performance Pointer to the vNIC Use.
2763 * @param tx_octets_delta
2764 *****************************************************************************/
2765 void evel_vnic_performance_tx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2766 const double tx_octets_delta)
2770 /***************************************************************************/
2771 /* Check preconditions. */
2772 /***************************************************************************/
2773 assert(tx_octets_delta >= 0.0);
2775 evel_set_option_double(&vnic_performance->tx_octets_delta,
2777 "Delta Transmitted Octets ");
2783 /**************************************************************************//**
2784 * Set the Transmitted Total Packets in measurement interval
2785 * property of the vNIC performance.
2787 * @note The property is treated as immutable: it is only valid to call
2788 * the setter once. However, we don't assert if the caller tries to
2789 * overwrite, just ignoring the update instead.
2791 * @param vnic_performance Pointer to the vNIC Use.
2792 * @param tx_total_packets_acc
2793 *****************************************************************************/
2794 void evel_vnic_performance_tx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2795 const double tx_total_packets_acc)
2799 /***************************************************************************/
2800 /* Check preconditions. */
2801 /***************************************************************************/
2802 assert(tx_total_packets_acc >= 0.0);
2804 evel_set_option_double(&vnic_performance->tx_total_packets_acc,
2805 tx_total_packets_acc,
2806 "Transmitted Total Packets accumulated");
2811 /**************************************************************************//**
2812 * Set the Delta Total Packets Transmitted in measurement interval
2813 * property of the vNIC performance.
2815 * @note The property is treated as immutable: it is only valid to call
2816 * the setter once. However, we don't assert if the caller tries to
2817 * overwrite, just ignoring the update instead.
2819 * @param vnic_performance Pointer to the vNIC Use.
2820 * @param tx_total_packets_delta
2821 *****************************************************************************/
2822 void evel_vnic_performance_tx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2823 const double tx_total_packets_delta)
2827 /***************************************************************************/
2828 /* Check preconditions. */
2829 /***************************************************************************/
2830 assert(tx_total_packets_delta >= 0.0);
2832 evel_set_option_double(&vnic_performance->tx_total_packets_delta,
2833 tx_total_packets_delta,
2834 "Delta Transmitted Total Packets ");
2840 /**************************************************************************//**
2841 * Set the Transmitted Unicast Packets in measurement interval
2842 * property of the vNIC performance.
2844 * @note The property is treated as immutable: it is only valid to call
2845 * the setter once. However, we don't assert if the caller tries to
2846 * overwrite, just ignoring the update instead.
2848 * @param vnic_performance Pointer to the vNIC Use.
2849 * @param tx_ucast_packets_acc
2850 *****************************************************************************/
2851 void evel_vnic_performance_tx_ucast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2852 const double mtx_ucast_packets_acc)
2856 /***************************************************************************/
2857 /* Check preconditions. */
2858 /***************************************************************************/
2859 assert(mtx_ucast_packets_acc >= 0.0);
2861 evel_set_option_double(&vnic_performance->tx_ucast_packets_acc,
2862 mtx_ucast_packets_acc,
2863 "Transmitted Unicast Packets accumulated");
2868 /**************************************************************************//**
2869 * Set the Delta Octets Transmitted in measurement interval
2870 * property of the vNIC performance.
2872 * @note The property is treated as immutable: it is only valid to call
2873 * the setter once. However, we don't assert if the caller tries to
2874 * overwrite, just ignoring the update instead.
2876 * @param vnic_performance Pointer to the vNIC Use.
2877 * @param tx_ucast_packets_delta
2878 *****************************************************************************/
2879 void evel_vnic_performance_tx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2880 const double tx_ucast_packets_delta)
2884 /***************************************************************************/
2885 /* Check preconditions. */
2886 /***************************************************************************/
2887 assert(tx_ucast_packets_delta >= 0.0);
2889 evel_set_option_double(&vnic_performance->tx_ucast_packets_delta,
2890 tx_ucast_packets_delta,
2891 "Delta Transmitted Unicast Packets ");
2897 /**************************************************************************//**
2898 * Add an additional vNIC Use to the specified Measurement event.
2900 * @param measurement Pointer to the measurement.
2901 * @param vnic_performance Pointer to the vNIC Use to add.
2902 *****************************************************************************/
2903 void evel_meas_vnic_performance_add(EVENT_MEASUREMENT * const measurement,
2904 MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance)
2908 /***************************************************************************/
2909 /* Check preconditions. */
2910 /***************************************************************************/
2911 assert(measurement != NULL);
2912 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
2913 assert(vnic_performance != NULL);
2915 dlist_push_last(&measurement->vnic_usage, vnic_performance);
2920 /**************************************************************************//**
2921 * Add an additional vNIC usage record Measurement.
2923 * This function implements the previous API, purely for convenience.
2925 * The ID is null delimited ASCII string. The library takes a copy so the
2926 * caller does not have to preserve values after the function returns.
2928 * @param measurement Pointer to the measurement.
2929 * @param vnic_id ASCIIZ string with the vNIC's ID.
2930 * @param valset true or false confidence level
2931 * @param recvd_bcast_packets_acc Recieved broadcast packets
2932 * @param recvd_bcast_packets_delta Received delta broadcast packets
2933 * @param recvd_discarded_packets_acc Recieved discarded packets
2934 * @param recvd_discarded_packets_delta Received discarded delta packets
2935 * @param recvd_error_packets_acc Received error packets
2936 * @param recvd_error_packets_delta, Received delta error packets
2937 * @param recvd_mcast_packets_acc Received multicast packets
2938 * @param recvd_mcast_packets_delta Received delta multicast packets
2939 * @param recvd_octets_acc Received octets
2940 * @param recvd_octets_delta Received delta octets
2941 * @param recvd_total_packets_acc Received total packets
2942 * @param recvd_total_packets_delta Received delta total packets
2943 * @param recvd_ucast_packets_acc Received Unicast packets
2944 * @param recvd_ucast_packets_delta Received delta unicast packets
2945 * @param tx_bcast_packets_acc Transmitted broadcast packets
2946 * @param tx_bcast_packets_delta Transmitted delta broadcast packets
2947 * @param tx_discarded_packets_acc Transmitted packets discarded
2948 * @param tx_discarded_packets_delta Transmitted delta discarded packets
2949 * @param tx_error_packets_acc Transmitted error packets
2950 * @param tx_error_packets_delta Transmitted delta error packets
2951 * @param tx_mcast_packets_acc Transmitted multicast packets accumulated
2952 * @param tx_mcast_packets_delta Transmitted delta multicast packets
2953 * @param tx_octets_acc Transmitted octets
2954 * @param tx_octets_delta Transmitted delta octets
2955 * @param tx_total_packets_acc Transmitted total packets
2956 * @param tx_total_packets_delta Transmitted delta total packets
2957 * @param tx_ucast_packets_acc Transmitted Unicast packets
2958 * @param tx_ucast_packets_delta Transmitted delta Unicast packets
2959 *****************************************************************************/
2960 void evel_measurement_vnic_performance_add(EVENT_MEASUREMENT * const measurement,
2961 char * const vnic_id,
2963 double recvd_bcast_packets_acc,
2964 double recvd_bcast_packets_delta,
2965 double recvd_discarded_packets_acc,
2966 double recvd_discarded_packets_delta,
2967 double recvd_error_packets_acc,
2968 double recvd_error_packets_delta,
2969 double recvd_mcast_packets_acc,
2970 double recvd_mcast_packets_delta,
2971 double recvd_octets_acc,
2972 double recvd_octets_delta,
2973 double recvd_total_packets_acc,
2974 double recvd_total_packets_delta,
2975 double recvd_ucast_packets_acc,
2976 double recvd_ucast_packets_delta,
2977 double tx_bcast_packets_acc,
2978 double tx_bcast_packets_delta,
2979 double tx_discarded_packets_acc,
2980 double tx_discarded_packets_delta,
2981 double tx_error_packets_acc,
2982 double tx_error_packets_delta,
2983 double tx_mcast_packets_acc,
2984 double tx_mcast_packets_delta,
2985 double tx_octets_acc,
2986 double tx_octets_delta,
2987 double tx_total_packets_acc,
2988 double tx_total_packets_delta,
2989 double tx_ucast_packets_acc,
2990 double tx_ucast_packets_delta)
2992 MEASUREMENT_VNIC_PERFORMANCE * vnic_performance = NULL;
2995 /***************************************************************************/
2996 /* Trust the assertions in the underlying methods. */
2997 /***************************************************************************/
2998 vnic_performance = evel_measurement_new_vnic_performance(vnic_id, valset);
3000 evel_vnic_performance_rx_bcast_pkt_acc_set(vnic_performance, recvd_bcast_packets_acc);
3001 evel_vnic_performance_rx_bcast_pkt_delta_set(vnic_performance, recvd_bcast_packets_delta);
3002 evel_vnic_performance_rx_discard_pkt_acc_set(vnic_performance, recvd_discarded_packets_acc);
3003 evel_vnic_performance_rx_discard_pkt_delta_set(vnic_performance, recvd_discarded_packets_delta);
3004 evel_vnic_performance_rx_error_pkt_acc_set(vnic_performance, recvd_error_packets_acc);
3005 evel_vnic_performance_rx_error_pkt_delta_set(vnic_performance, recvd_error_packets_delta);
3006 evel_vnic_performance_rx_mcast_pkt_acc_set(vnic_performance, recvd_mcast_packets_acc);
3007 evel_vnic_performance_rx_mcast_pkt_delta_set(vnic_performance, recvd_mcast_packets_delta);
3008 evel_vnic_performance_rx_octets_acc_set(vnic_performance, recvd_octets_acc);
3009 evel_vnic_performance_rx_octets_delta_set(vnic_performance, recvd_octets_delta);
3010 evel_vnic_performance_rx_total_pkt_acc_set(vnic_performance, recvd_total_packets_acc);
3011 evel_vnic_performance_rx_total_pkt_delta_set(vnic_performance, recvd_total_packets_delta);
3012 evel_vnic_performance_rx_ucast_pkt_acc_set(vnic_performance, recvd_ucast_packets_acc);
3013 evel_vnic_performance_rx_ucast_pkt_delta_set(vnic_performance, recvd_ucast_packets_delta);
3014 evel_vnic_performance_tx_bcast_pkt_acc_set(vnic_performance, tx_bcast_packets_acc);
3015 evel_vnic_performance_tx_bcast_pkt_delta_set(vnic_performance, tx_bcast_packets_delta);
3016 evel_vnic_performance_tx_discarded_pkt_acc_set(vnic_performance, tx_discarded_packets_acc);
3017 evel_vnic_performance_tx_discarded_pkt_delta_set(vnic_performance, tx_discarded_packets_delta);
3018 evel_vnic_performance_tx_error_pkt_acc_set(vnic_performance, tx_error_packets_acc);
3019 evel_vnic_performance_tx_error_pkt_delta_set(vnic_performance, tx_error_packets_delta);
3020 evel_vnic_performance_tx_mcast_pkt_acc_set(vnic_performance, tx_mcast_packets_acc);
3021 evel_vnic_performance_tx_mcast_pkt_delta_set(vnic_performance, tx_mcast_packets_delta);
3022 evel_vnic_performance_tx_octets_acc_set(vnic_performance, tx_octets_acc);
3023 evel_vnic_performance_tx_octets_delta_set(vnic_performance, tx_octets_delta);
3024 evel_vnic_performance_tx_total_pkt_acc_set(vnic_performance, tx_total_packets_acc);
3025 evel_vnic_performance_tx_total_pkt_delta_set(vnic_performance, tx_total_packets_delta);
3026 evel_vnic_performance_tx_ucast_pkt_acc_set(vnic_performance, tx_ucast_packets_acc);
3027 evel_vnic_performance_tx_ucast_pkt_delta_set(vnic_performance, tx_ucast_packets_delta);
3028 evel_meas_vnic_performance_add(measurement, vnic_performance);
3031 /**************************************************************************//**
3032 * Encode the measurement as a JSON measurement.
3034 * @param jbuf Pointer to the ::EVEL_JSON_BUFFER to encode into.
3035 * @param event Pointer to the ::EVENT_HEADER to encode.
3036 *****************************************************************************/
3037 void evel_json_encode_measurement(EVEL_JSON_BUFFER * jbuf,
3038 EVENT_MEASUREMENT * event)
3040 MEASUREMENT_CPU_USE * cpu_use = NULL;
3041 MEASUREMENT_MEM_USE * mem_use = NULL;
3042 MEASUREMENT_DISK_USE * disk_use = NULL;
3043 MEASUREMENT_FSYS_USE * fsys_use = NULL;
3044 MEASUREMENT_LATENCY_BUCKET * bucket = NULL;
3045 MEASUREMENT_VNIC_PERFORMANCE * vnic_performance = NULL;
3046 MEASUREMENT_ERRORS * errors = NULL;
3047 MEASUREMENT_FEATURE_USE * feature_use = NULL;
3048 MEASUREMENT_CODEC_USE * codec_use = NULL;
3049 MEASUREMENT_GROUP * measurement_group = NULL;
3050 CUSTOM_MEASUREMENT * custom_measurement = NULL;
3051 DLIST_ITEM * item = NULL;
3052 DLIST_ITEM * nested_item = NULL;
3053 DLIST_ITEM * addl_info_item = NULL;
3054 OTHER_FIELD *addl_info = NULL;
3055 DLIST_ITEM * other_field_item = NULL;
3056 EVEL_JSON_OBJECT_INSTANCE * jsonobjinst = NULL;
3057 EVEL_JSON_OBJECT * jsonobjp = NULL;
3058 DLIST_ITEM * jsobj_field_item = NULL;
3059 EVEL_INTERNAL_KEY * keyinst = NULL;
3060 DLIST_ITEM * keyinst_field_item = NULL;
3065 /***************************************************************************/
3066 /* Check preconditions. */
3067 /***************************************************************************/
3068 assert(event != NULL);
3069 assert(event->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
3071 evel_json_encode_header(jbuf, &event->header);
3072 evel_json_open_named_object(jbuf, "measurementsForVfScalingFields");
3074 /***************************************************************************/
3075 /* Mandatory fields. */
3076 /***************************************************************************/
3077 evel_enc_kv_int(jbuf, "measurementInterval", event->measurement_interval);
3079 /***************************************************************************/
3080 /* Optional fields. */
3081 /***************************************************************************/
3082 // additional fields
3083 evel_json_checkpoint(jbuf);
3084 if (evel_json_open_opt_named_list(jbuf, "additionalFields"))
3086 bool item_added = false;
3088 addl_info_item = dlist_get_first(&event->additional_info);
3089 while (addl_info_item != NULL)
3091 addl_info = (OTHER_FIELD*) addl_info_item->item;
3092 assert(addl_info != NULL);
3094 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3098 evel_json_open_object(jbuf);
3099 evel_enc_kv_string(jbuf, "name", addl_info->name);
3100 evel_enc_kv_string(jbuf, "value", addl_info->value);
3101 evel_json_close_object(jbuf);
3104 addl_info_item = dlist_get_next(addl_info_item);
3106 evel_json_close_list(jbuf);
3108 /*************************************************************************/
3109 /* If we've not written anything, rewind to before we opened the list. */
3110 /*************************************************************************/
3113 evel_json_rewind(jbuf);
3118 evel_json_checkpoint(jbuf);
3119 if(evel_json_open_opt_named_list(jbuf, "additionalObjects"))
3121 bool item_added = false;
3122 other_field_item = dlist_get_first(&event->additional_objects);
3123 while (other_field_item != NULL)
3125 jsonobjp = (EVEL_JSON_OBJECT *) other_field_item->item;
3126 if(jsonobjp != NULL)
3128 evel_json_open_object(jbuf);
3130 if( evel_json_open_opt_named_list(jbuf, "objectInstances"))
3132 bool item_added2 = false;
3133 jsobj_field_item = dlist_get_first(&jsonobjp->jsonobjectinstances);
3134 while (jsobj_field_item != NULL)
3136 jsonobjinst = (EVEL_JSON_OBJECT_INSTANCE *) jsobj_field_item->item;
3137 if( jsonobjinst != NULL )
3139 evel_json_open_object(jbuf);
3140 evel_enc_kv_object(jbuf, "objectInstance", jsonobjinst->jsonstring);
3141 evel_enc_kv_opt_ull(jbuf, "objectInstanceEpochMicrosec", &jsonobjinst->objinst_epoch_microsec);
3142 //evel_json_checkpoint(jbuf);
3143 if (evel_json_open_opt_named_list(jbuf, "objectKeys"))
3145 bool item_added3 = false;
3147 keyinst_field_item = dlist_get_first(&jsonobjinst->object_keys);
3148 while (keyinst_field_item != NULL)
3150 keyinst = (EVEL_INTERNAL_KEY *)keyinst_field_item->item;
3153 evel_json_open_object(jbuf);
3154 evel_enc_kv_string(jbuf, "keyName", keyinst->keyname);
3155 evel_enc_kv_opt_int(jbuf, "keyOrder", &keyinst->keyorder);
3156 evel_enc_kv_opt_string(jbuf, "keyValue", &keyinst->keyvalue);
3157 evel_json_close_object(jbuf);
3160 keyinst_field_item = dlist_get_next(keyinst_field_item);
3162 evel_json_close_list(jbuf);
3164 /*************************************************************************/
3165 /* If we've not written anything, rewind to before we opened the list. */
3166 /*************************************************************************/
3169 // evel_json_rewind(jbuf);
3172 evel_json_close_object(jbuf);
3175 jsobj_field_item = dlist_get_next(jsobj_field_item);
3177 evel_json_close_list(jbuf);
3180 evel_json_rewind(jbuf);
3184 evel_enc_kv_string(jbuf, "objectName", jsonobjp->object_name);
3185 evel_enc_kv_opt_string(jbuf, "objectSchema", &jsonobjp->objectschema);
3186 evel_enc_kv_opt_string(jbuf, "objectSchemaUrl", &jsonobjp->objectschemaurl);
3187 evel_enc_kv_opt_string(jbuf, "nfSubscribedObjectName", &jsonobjp->nfsubscribedobjname);
3188 evel_enc_kv_opt_string(jbuf, "nfSubscriptionId", &jsonobjp->nfsubscriptionid);
3189 evel_json_close_object(jbuf);
3192 other_field_item = dlist_get_next(other_field_item);
3194 evel_json_close_list(jbuf);
3198 evel_json_rewind(jbuf);
3203 // TBD additional json objects
3204 evel_enc_kv_opt_int(jbuf, "concurrentSessions", &event->concurrent_sessions);
3205 evel_enc_kv_opt_int(jbuf, "configuredEntities", &event->configured_entities);
3207 /***************************************************************************/
3209 /***************************************************************************/
3210 evel_json_checkpoint(jbuf);
3211 if (evel_json_open_opt_named_list(jbuf, "cpuUsageArray"))
3213 bool item_added = false;
3215 item = dlist_get_first(&event->cpu_usage);
3216 while (item != NULL)
3218 cpu_use = (MEASUREMENT_CPU_USE*) item->item;
3219 assert(cpu_use != NULL);
3221 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3225 evel_json_open_object(jbuf);
3226 evel_enc_kv_string(jbuf, "cpuIdentifier", cpu_use->id);
3227 evel_enc_kv_opt_double(jbuf, "cpuIdle", &cpu_use->idle);
3228 evel_enc_kv_opt_double(jbuf, "cpuUsageInterrupt", &cpu_use->intrpt);
3229 evel_enc_kv_opt_double(jbuf, "cpuUsageNice", &cpu_use->nice);
3230 evel_enc_kv_opt_double(jbuf, "cpuUsageSoftIrq", &cpu_use->softirq);
3231 evel_enc_kv_opt_double(jbuf, "cpuUsageSteal", &cpu_use->steal);
3232 evel_enc_kv_opt_double(jbuf, "cpuUsageSystem", &cpu_use->sys);
3233 evel_enc_kv_opt_double(jbuf, "cpuUsageUser", &cpu_use->user);
3234 evel_enc_kv_opt_double(jbuf, "cpuWait", &cpu_use->wait);
3235 evel_enc_kv_double(jbuf, "percentUsage",cpu_use->usage);
3236 evel_json_close_object(jbuf);
3239 item = dlist_get_next(item);
3241 evel_json_close_list(jbuf);
3243 /*************************************************************************/
3244 /* If we've not written anything, rewind to before we opened the list. */
3245 /*************************************************************************/
3248 evel_json_rewind(jbuf);
3253 /***************************************************************************/
3254 /* Disk Use list. */
3255 /***************************************************************************/
3256 evel_json_checkpoint(jbuf);
3257 if (evel_json_open_opt_named_list(jbuf, "diskUsageArray"))
3259 bool item_added = false;
3261 item = dlist_get_first(&event->disk_usage);
3262 while (item != NULL)
3264 disk_use = (MEASUREMENT_DISK_USE*) item->item;
3265 assert(disk_use != NULL);
3267 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3271 evel_json_open_object(jbuf);
3272 evel_enc_kv_string(jbuf, "diskIdentifier", disk_use->id);
3273 evel_enc_kv_opt_double(jbuf, "diskIoTimeAvg", &disk_use->iotimeavg);
3274 evel_enc_kv_opt_double(jbuf, "diskIoTimeLast", &disk_use->iotimelast);
3275 evel_enc_kv_opt_double(jbuf, "diskIoTimeMax", &disk_use->iotimemax);
3276 evel_enc_kv_opt_double(jbuf, "diskIoTimeMin", &disk_use->iotimemin);
3277 evel_enc_kv_opt_double(jbuf, "diskMergedReadAvg", &disk_use->mergereadavg);
3278 evel_enc_kv_opt_double(jbuf, "diskMergedReadLast", &disk_use->mergereadlast);
3279 evel_enc_kv_opt_double(jbuf, "diskMergedReadMax", &disk_use->mergereadmax);
3280 evel_enc_kv_opt_double(jbuf, "diskMergedReadMin", &disk_use->mergereadmin);
3281 evel_enc_kv_opt_double(jbuf, "diskMergedWriteAvg", &disk_use->mergewriteavg);
3282 evel_enc_kv_opt_double(jbuf, "diskMergedWriteLast", &disk_use->mergewritelast);
3283 evel_enc_kv_opt_double(jbuf, "diskMergedWriteMax", &disk_use->mergewritemax);
3284 evel_enc_kv_opt_double(jbuf, "diskMergedWriteMin", &disk_use->mergewritemin);
3285 evel_enc_kv_opt_double(jbuf, "diskOctetsReadAvg", &disk_use->octetsreadavg);
3286 evel_enc_kv_opt_double(jbuf, "diskOctetsReadLast", &disk_use->octetsreadlast);
3287 evel_enc_kv_opt_double(jbuf, "diskOctetsReadMax", &disk_use->octetsreadmax);
3288 evel_enc_kv_opt_double(jbuf, "diskOctetsReadMin", &disk_use->octetsreadmin);
3289 evel_enc_kv_opt_double(jbuf, "diskOctetsWriteAvg", &disk_use->octetswriteavg);
3290 evel_enc_kv_opt_double(jbuf, "diskOctetsWriteLast", &disk_use->octetswritelast);
3291 evel_enc_kv_opt_double(jbuf, "diskOctetsWriteMax", &disk_use->octetswritemax);
3292 evel_enc_kv_opt_double(jbuf, "diskOctetsWriteMin", &disk_use->octetswritemin);
3293 evel_enc_kv_opt_double(jbuf, "diskOpsReadAvg", &disk_use->opsreadavg);
3294 evel_enc_kv_opt_double(jbuf, "diskOpsReadLast", &disk_use->opsreadlast);
3295 evel_enc_kv_opt_double(jbuf, "diskOpsReadMax", &disk_use->opsreadmax);
3296 evel_enc_kv_opt_double(jbuf, "diskOpsReadMin", &disk_use->opsreadmin);
3297 evel_enc_kv_opt_double(jbuf, "diskOpsWriteAvg", &disk_use->opswriteavg);
3298 evel_enc_kv_opt_double(jbuf, "diskOpsWriteLast", &disk_use->opswritelast);
3299 evel_enc_kv_opt_double(jbuf, "diskOpsWriteMax", &disk_use->opswritemax);
3300 evel_enc_kv_opt_double(jbuf, "diskOpsWriteMin", &disk_use->opswritemin);
3301 evel_enc_kv_opt_double(jbuf, "diskPendingOperationsAvg", &disk_use->pendingopsavg);
3302 evel_enc_kv_opt_double(jbuf, "diskPendingOperationsLast", &disk_use->pendingopslast);
3303 evel_enc_kv_opt_double(jbuf, "diskPendingOperationsMax", &disk_use->pendingopsmax);
3304 evel_enc_kv_opt_double(jbuf, "diskPendingOperationsMin", &disk_use->pendingopsmin);
3305 evel_enc_kv_opt_double(jbuf, "diskTimeReadAvg", &disk_use->timereadavg);
3306 evel_enc_kv_opt_double(jbuf, "diskTimeReadLast", &disk_use->timereadlast);
3307 evel_enc_kv_opt_double(jbuf, "diskTimeReadMax", &disk_use->timereadmax);
3308 evel_enc_kv_opt_double(jbuf, "diskTimeReadMin", &disk_use->timereadmin);
3309 evel_enc_kv_opt_double(jbuf, "diskTimeWriteAvg", &disk_use->timewriteavg);
3310 evel_enc_kv_opt_double(jbuf, "diskTimeWriteLast", &disk_use->timewritelast);
3311 evel_enc_kv_opt_double(jbuf, "diskTimeWriteMax", &disk_use->timewritemax);
3312 evel_enc_kv_opt_double(jbuf, "diskTimeWriteMin", &disk_use->timewritemin);
3313 evel_json_close_object(jbuf);
3316 item = dlist_get_next(item);
3318 evel_json_close_list(jbuf);
3320 /*************************************************************************/
3321 /* If we've not written anything, rewind to before we opened the list. */
3322 /*************************************************************************/
3325 evel_json_rewind(jbuf);
3329 /***************************************************************************/
3330 /* Filesystem Usage list. */
3331 /***************************************************************************/
3332 evel_json_checkpoint(jbuf);
3333 if (evel_json_open_opt_named_list(jbuf, "filesystemUsageArray"))
3335 bool item_added = false;
3337 item = dlist_get_first(&event->filesystem_usage);
3338 while (item != NULL)
3340 fsys_use = (MEASUREMENT_FSYS_USE *) item->item;
3341 assert(fsys_use != NULL);
3343 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3344 "filesystemUsageArray",
3345 fsys_use->filesystem_name))
3347 evel_json_open_object(jbuf);
3348 evel_enc_kv_string(jbuf, "filesystemName", fsys_use->filesystem_name);
3350 jbuf, "blockConfigured", fsys_use->block_configured);
3351 evel_enc_kv_double(jbuf, "blockIops", fsys_use->block_iops);
3352 evel_enc_kv_double(jbuf, "blockUsed", fsys_use->block_used);
3354 jbuf, "ephemeralConfigured", fsys_use->ephemeral_configured);
3355 evel_enc_kv_double(jbuf, "ephemeralIops", fsys_use->ephemeral_iops);
3356 evel_enc_kv_double(jbuf, "ephemeralUsed", fsys_use->ephemeral_used);
3357 evel_json_close_object(jbuf);
3360 item = dlist_get_next(item);
3362 evel_json_close_list(jbuf);
3364 /*************************************************************************/
3365 /* If we've not written anything, rewind to before we opened the list. */
3366 /*************************************************************************/
3369 evel_json_rewind(jbuf);
3373 /***************************************************************************/
3374 /* Latency distribution. */
3375 /***************************************************************************/
3376 item = dlist_get_first(&event->latency_distribution);
3377 if ((item != NULL) &&
3378 evel_json_open_opt_named_list(jbuf, "latencyDistribution"))
3380 while (item != NULL)
3382 bucket = (MEASUREMENT_LATENCY_BUCKET*) item->item;
3383 assert(bucket != NULL);
3385 evel_json_open_object(jbuf);
3386 evel_enc_kv_opt_double(
3387 jbuf, "lowEndOfLatencyBucket", &bucket->low_end);
3388 evel_enc_kv_opt_double(
3389 jbuf, "highEndOfLatencyBucket", &bucket->high_end);
3390 evel_enc_kv_int(jbuf, "countsInTheBucket", bucket->count);
3391 evel_json_close_object(jbuf);
3392 item = dlist_get_next(item);
3394 evel_json_close_list(jbuf);
3397 evel_enc_kv_opt_double(
3398 jbuf, "meanRequestLatency", &event->mean_request_latency);
3399 evel_enc_kv_opt_int(jbuf, "requestRate", &event->request_rate);
3401 /***************************************************************************/
3402 /* vNIC Usage TBD Performance array */
3403 /***************************************************************************/
3404 evel_json_checkpoint(jbuf);
3405 if (evel_json_open_opt_named_list(jbuf, "vNicPerformanceArray"))
3407 bool item_added = false;
3409 item = dlist_get_first(&event->vnic_usage);
3410 while (item != NULL)
3412 vnic_performance = (MEASUREMENT_VNIC_PERFORMANCE *) item->item;
3413 assert(vnic_performance != NULL);
3415 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3416 "vNicPerformanceArray",
3417 vnic_performance->vnic_id))
3419 evel_json_open_object(jbuf);
3421 /*********************************************************************/
3422 /* Optional fields. */
3423 /*********************************************************************/
3424 evel_enc_kv_opt_double( jbuf,
3425 "receivedBroadcastPacketsAccumulated", &vnic_performance->recvd_bcast_packets_acc);
3426 evel_enc_kv_opt_double( jbuf,
3427 "receivedBroadcastPacketsDelta", &vnic_performance->recvd_bcast_packets_delta);
3428 evel_enc_kv_opt_double( jbuf,
3429 "receivedDiscardedPacketsAccumulated", &vnic_performance->recvd_discarded_packets_acc);
3430 evel_enc_kv_opt_double( jbuf,
3431 "receivedDiscardedPacketsDelta", &vnic_performance->recvd_discarded_packets_delta);
3432 evel_enc_kv_opt_double( jbuf,
3433 "receivedErrorPacketsAccumulated", &vnic_performance->recvd_error_packets_acc);
3434 evel_enc_kv_opt_double( jbuf,
3435 "receivedErrorPacketsDelta", &vnic_performance->recvd_error_packets_delta);
3436 evel_enc_kv_opt_double( jbuf,
3437 "receivedMulticastPacketsAccumulated", &vnic_performance->recvd_mcast_packets_acc);
3438 evel_enc_kv_opt_double( jbuf,
3439 "receivedMulticastPacketsDelta", &vnic_performance->recvd_mcast_packets_delta);
3440 evel_enc_kv_opt_double( jbuf,
3441 "receivedOctetsAccumulated", &vnic_performance->recvd_octets_acc);
3442 evel_enc_kv_opt_double( jbuf,
3443 "receivedOctetsDelta", &vnic_performance->recvd_octets_delta);
3444 evel_enc_kv_opt_double( jbuf,
3445 "receivedTotalPacketsAccumulated", &vnic_performance->recvd_total_packets_acc);
3446 evel_enc_kv_opt_double( jbuf,
3447 "receivedTotalPacketsDelta", &vnic_performance->recvd_total_packets_delta);
3448 evel_enc_kv_opt_double( jbuf,
3449 "receivedUnicastPacketsAccumulated", &vnic_performance->recvd_ucast_packets_acc);
3450 evel_enc_kv_opt_double( jbuf,
3451 "receivedUnicastPacketsDelta", &vnic_performance->recvd_ucast_packets_delta);
3452 evel_enc_kv_opt_double( jbuf,
3453 "transmittedBroadcastPacketsAccumulated", &vnic_performance->tx_bcast_packets_acc);
3454 evel_enc_kv_opt_double( jbuf,
3455 "transmittedBroadcastPacketsDelta", &vnic_performance->tx_bcast_packets_delta);
3456 evel_enc_kv_opt_double( jbuf,
3457 "transmittedDiscardedPacketsAccumulated", &vnic_performance->tx_discarded_packets_acc);
3458 evel_enc_kv_opt_double( jbuf,
3459 "transmittedDiscardedPacketsDelta", &vnic_performance->tx_discarded_packets_delta);
3460 evel_enc_kv_opt_double( jbuf,
3461 "transmittedErrorPacketsAccumulated", &vnic_performance->tx_error_packets_acc);
3462 evel_enc_kv_opt_double( jbuf,
3463 "transmittedErrorPacketsDelta", &vnic_performance->tx_error_packets_delta);
3464 evel_enc_kv_opt_double( jbuf,
3465 "transmittedMulticastPacketsAccumulated", &vnic_performance->tx_mcast_packets_acc);
3466 evel_enc_kv_opt_double( jbuf,
3467 "transmittedMulticastPacketsDelta", &vnic_performance->tx_mcast_packets_delta);
3468 evel_enc_kv_opt_double( jbuf,
3469 "transmittedOctetsAccumulated", &vnic_performance->tx_octets_acc);
3470 evel_enc_kv_opt_double( jbuf,
3471 "transmittedOctetsDelta", &vnic_performance->tx_octets_delta);
3472 evel_enc_kv_opt_double( jbuf,
3473 "transmittedTotalPacketsAccumulated", &vnic_performance->tx_total_packets_acc);
3474 evel_enc_kv_opt_double( jbuf,
3475 "transmittedTotalPacketsDelta", &vnic_performance->tx_total_packets_delta);
3476 evel_enc_kv_opt_double( jbuf,
3477 "transmittedUnicastPacketsAccumulated", &vnic_performance->tx_ucast_packets_acc);
3478 evel_enc_kv_opt_double( jbuf,
3479 "transmittedUnicastPacketsDelta", &vnic_performance->tx_ucast_packets_delta);
3481 /*********************************************************************/
3482 /* Mandatory fields. */
3483 /*********************************************************************/
3484 evel_enc_kv_string(jbuf, "valuesAreSuspect", vnic_performance->valuesaresuspect);
3485 evel_enc_kv_string(jbuf, "vNicIdentifier", vnic_performance->vnic_id);
3487 evel_json_close_object(jbuf);
3490 item = dlist_get_next(item);
3493 evel_json_close_list(jbuf);
3495 /*************************************************************************/
3496 /* If we've not written anything, rewind to before we opened the list. */
3497 /*************************************************************************/
3500 evel_json_rewind(jbuf);
3505 /***************************************************************************/
3506 /* Memory Use list. */
3507 /***************************************************************************/
3508 evel_json_checkpoint(jbuf);
3509 if (evel_json_open_opt_named_list(jbuf, "memoryUsageArray"))
3511 bool item_added = false;
3513 item = dlist_get_first(&event->mem_usage);
3514 while (item != NULL)
3516 mem_use = (MEASUREMENT_MEM_USE*) item->item;
3517 assert(mem_use != NULL);
3519 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3523 evel_json_open_object(jbuf);
3524 evel_enc_kv_double(jbuf, "memoryBuffered", mem_use->membuffsz);
3525 evel_enc_kv_opt_double(jbuf, "memoryCached", &mem_use->memcache);
3526 evel_enc_kv_opt_double(jbuf, "memoryConfigured", &mem_use->memconfig);
3527 evel_enc_kv_opt_double(jbuf, "memoryFree", &mem_use->memfree);
3528 evel_enc_kv_opt_double(jbuf, "memorySlabRecl", &mem_use->slabrecl);
3529 evel_enc_kv_opt_double(jbuf, "memorySlabUnrecl", &mem_use->slabunrecl);
3530 evel_enc_kv_opt_double(jbuf, "memoryUsed", &mem_use->memused);
3531 evel_enc_kv_string(jbuf, "vmIdentifier", mem_use->id);
3532 evel_json_close_object(jbuf);
3535 item = dlist_get_next(item);
3537 evel_json_close_list(jbuf);
3539 /*************************************************************************/
3540 /* If we've not written anything, rewind to before we opened the list. */
3541 /*************************************************************************/
3544 evel_json_rewind(jbuf);
3549 evel_enc_kv_opt_int(
3550 jbuf, "numberOfMediaPortsInUse", &event->media_ports_in_use);
3551 evel_enc_kv_opt_int(
3552 jbuf, "vnfcScalingMetric", &event->vnfc_scaling_metric);
3554 /***************************************************************************/
3556 /***************************************************************************/
3557 if ((event->errors != NULL) &&
3558 evel_json_open_opt_named_object(jbuf, "errors"))
3560 errors = event->errors;
3561 evel_enc_kv_int(jbuf, "receiveDiscards", errors->receive_discards);
3562 evel_enc_kv_int(jbuf, "receiveErrors", errors->receive_errors);
3563 evel_enc_kv_int(jbuf, "transmitDiscards", errors->transmit_discards);
3564 evel_enc_kv_int(jbuf, "transmitErrors", errors->transmit_errors);
3565 evel_json_close_object(jbuf);
3568 /***************************************************************************/
3569 /* Feature Utilization list. */
3570 /***************************************************************************/
3571 evel_json_checkpoint(jbuf);
3572 if (evel_json_open_opt_named_list(jbuf, "featureUsageArray"))
3574 bool item_added = false;
3576 item = dlist_get_first(&event->feature_usage);
3577 while (item != NULL)
3579 feature_use = (MEASUREMENT_FEATURE_USE*) item->item;
3580 assert(feature_use != NULL);
3582 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3583 "featureUsageArray",
3584 feature_use->feature_id))
3586 evel_json_open_object(jbuf);
3587 evel_enc_kv_string(jbuf, "featureIdentifier", feature_use->feature_id);
3589 jbuf, "featureUtilization", feature_use->feature_utilization);
3590 evel_json_close_object(jbuf);
3593 item = dlist_get_next(item);
3595 evel_json_close_list(jbuf);
3597 /*************************************************************************/
3598 /* If we've not written anything, rewind to before we opened the list. */
3599 /*************************************************************************/
3602 evel_json_rewind(jbuf);
3606 /***************************************************************************/
3607 /* Codec Utilization list. */
3608 /***************************************************************************/
3609 evel_json_checkpoint(jbuf);
3610 if (evel_json_open_opt_named_list(jbuf, "codecUsageArray"))
3612 bool item_added = false;
3614 item = dlist_get_first(&event->codec_usage);
3615 while (item != NULL)
3617 codec_use = (MEASUREMENT_CODEC_USE*) item->item;
3618 assert(codec_use != NULL);
3620 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3622 codec_use->codec_id))
3624 evel_json_open_object(jbuf);
3625 evel_enc_kv_string(jbuf, "codecIdentifier", codec_use->codec_id);
3626 evel_enc_kv_int(jbuf, "numberInUse", codec_use->number_in_use);
3627 evel_json_close_object(jbuf);
3630 item = dlist_get_next(item);
3632 evel_json_close_list(jbuf);
3634 /*************************************************************************/
3635 /* If we've not written anything, rewind to before we opened the list. */
3636 /*************************************************************************/
3639 evel_json_rewind(jbuf);
3643 /***************************************************************************/
3644 /* Additional Measurement Groups list. */
3645 /***************************************************************************/
3646 evel_json_checkpoint(jbuf);
3647 if (evel_json_open_opt_named_list(jbuf, "additionalMeasurements"))
3649 bool item_added = false;
3651 item = dlist_get_first(&event->additional_measurements);
3652 while (item != NULL)
3654 measurement_group = (MEASUREMENT_GROUP *) item->item;
3655 assert(measurement_group != NULL);
3657 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3658 "additionalMeasurements",
3659 measurement_group->name))
3661 evel_json_open_object(jbuf);
3662 evel_enc_kv_string(jbuf, "name", measurement_group->name);
3663 evel_json_open_opt_named_list(jbuf, "arrayOfFields");
3665 /*********************************************************************/
3666 /* Measurements list. */
3667 /*********************************************************************/
3668 nested_item = dlist_get_first(&measurement_group->measurements);
3669 while (nested_item != NULL)
3671 custom_measurement = (CUSTOM_MEASUREMENT *) nested_item->item;
3672 assert(custom_measurement != NULL);
3674 evel_json_open_object(jbuf);
3675 evel_enc_kv_string(jbuf, "name", custom_measurement->name);
3676 evel_enc_kv_string(jbuf, "value", custom_measurement->value);
3677 evel_json_close_object(jbuf);
3678 nested_item = dlist_get_next(nested_item);
3680 evel_json_close_list(jbuf);
3681 evel_json_close_object(jbuf);
3684 item = dlist_get_next(item);
3686 evel_json_close_list(jbuf);
3688 /*************************************************************************/
3689 /* If we've not written anything, rewind to before we opened the list. */
3690 /*************************************************************************/
3693 evel_json_rewind(jbuf);
3697 /***************************************************************************/
3698 /* Although optional, we always generate the version. Note that this */
3699 /* closes the object, too. */
3700 /***************************************************************************/
3701 evel_enc_version(jbuf,
3702 "measurementsForVfScalingVersion",
3703 event->major_version,
3704 event->minor_version);
3705 evel_json_close_object(jbuf);
3710 /**************************************************************************//**
3711 * Free a Measurement.
3713 * Free off the Measurement supplied. Will free all the contained allocated
3716 * @note It does not free the Measurement itself, since that may be part of a
3718 *****************************************************************************/
3719 void evel_free_measurement(EVENT_MEASUREMENT * event)
3721 MEASUREMENT_CPU_USE * cpu_use = NULL;
3722 MEASUREMENT_DISK_USE * disk_use = NULL;
3723 MEASUREMENT_FSYS_USE * fsys_use = NULL;
3724 MEASUREMENT_LATENCY_BUCKET * bucket = NULL;
3725 MEASUREMENT_MEM_USE * mem_use = NULL;
3726 MEASUREMENT_VNIC_PERFORMANCE * vnic_performance = NULL;
3727 MEASUREMENT_FEATURE_USE * feature_use = NULL;
3728 MEASUREMENT_CODEC_USE * codec_use = NULL;
3729 MEASUREMENT_GROUP * measurement_group = NULL;
3730 CUSTOM_MEASUREMENT * measurement = NULL;
3731 OTHER_FIELD *addl_info = NULL;
3732 EVEL_JSON_OBJECT * jsonobjp = NULL;
3736 /***************************************************************************/
3737 /* Check preconditions. As an internal API we don't allow freeing NULL */
3738 /* events as we do on the public API. */
3739 /***************************************************************************/
3740 assert(event != NULL);
3741 assert(event->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
3743 /***************************************************************************/
3744 /* Free all internal strings then the header itself. */
3745 /***************************************************************************/
3746 addl_info = dlist_pop_last(&event->additional_info);
3747 while (addl_info != NULL)
3749 EVEL_DEBUG("Freeing Additional Info (%s, %s)",
3752 free(addl_info->name);
3753 free(addl_info->value);
3755 addl_info = dlist_pop_last(&event->additional_info);
3758 jsonobjp = dlist_pop_last(&event->additional_objects);
3759 while (jsonobjp != NULL)
3761 EVEL_DEBUG("Freeing jsonObject %p",jsonobjp);
3762 evel_free_jsonobject( jsonobjp );
3763 jsonobjp = dlist_pop_last(&event->additional_objects);
3766 cpu_use = dlist_pop_last(&event->cpu_usage);
3767 while (cpu_use != NULL)
3769 EVEL_DEBUG("Freeing CPU use Info (%s)", cpu_use->id);
3772 cpu_use = dlist_pop_last(&event->cpu_usage);
3774 disk_use = dlist_pop_last(&event->disk_usage);
3775 while (disk_use != NULL)
3777 EVEL_DEBUG("Freeing Disk use Info (%s)", disk_use->id);
3780 disk_use = dlist_pop_last(&event->disk_usage);
3782 mem_use = dlist_pop_last(&event->mem_usage);
3783 while (mem_use != NULL)
3785 EVEL_DEBUG("Freeing Memory use Info (%s)", mem_use->id);
3787 free(mem_use->vmid);
3789 mem_use = dlist_pop_last(&event->mem_usage);
3792 fsys_use = dlist_pop_last(&event->filesystem_usage);
3793 while (fsys_use != NULL)
3795 EVEL_DEBUG("Freeing Filesystem Use info (%s)", fsys_use->filesystem_name);
3796 free(fsys_use->filesystem_name);
3798 fsys_use = dlist_pop_last(&event->filesystem_usage);
3801 bucket = dlist_pop_last(&event->latency_distribution);
3802 while (bucket != NULL)
3804 EVEL_DEBUG("Freeing Latency Bucket");
3806 bucket = dlist_pop_last(&event->latency_distribution);
3809 vnic_performance = dlist_pop_last(&event->vnic_usage);
3810 while (vnic_performance != NULL)
3812 EVEL_DEBUG("Freeing vNIC performance Info (%s)", vnic_performance->vnic_id);
3813 evel_measurement_free_vnic_performance(vnic_performance);
3814 free(vnic_performance);
3815 vnic_performance = dlist_pop_last(&event->vnic_usage);
3818 codec_use = dlist_pop_last(&event->codec_usage);
3819 while (codec_use != NULL)
3821 EVEL_DEBUG("Freeing Codec use Info (%s)", codec_use->codec_id);
3822 free(codec_use->codec_id);
3824 codec_use = dlist_pop_last(&event->codec_usage);
3827 if (event->errors != NULL)
3829 EVEL_DEBUG("Freeing Errors");
3830 free(event->errors);
3833 feature_use = dlist_pop_last(&event->feature_usage);
3834 while (feature_use != NULL)
3836 EVEL_DEBUG("Freeing Feature use Info (%s)", feature_use->feature_id);
3837 free(feature_use->feature_id);
3839 feature_use = dlist_pop_last(&event->feature_usage);
3842 measurement_group = dlist_pop_last(&event->additional_measurements);
3843 while (measurement_group != NULL)
3845 EVEL_DEBUG("Freeing Measurement Group (%s)", measurement_group->name);
3847 measurement = dlist_pop_last(&measurement_group->measurements);
3848 while (measurement != NULL)
3850 EVEL_DEBUG("Freeing Measurement (%s)", measurement->name);
3851 free(measurement->name);
3852 free(measurement->value);
3854 measurement = dlist_pop_last(&measurement_group->measurements);
3856 free(measurement_group->name);
3857 free(measurement_group);
3858 measurement_group = dlist_pop_last(&event->additional_measurements);
3861 evel_free_header(&event->header);