1 /**************************************************************************//**
3 * Implementation of EVEL functions relating to the Measurement.
8 * Copyright(c) <2016>, AT&T Intellectual Property. All other rights reserved.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions are met:
13 * 1. Redistributions of source code must retain the above copyright notice,
14 * this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement: This product includes
20 * software developed by the AT&T.
21 * 4. Neither the name of AT&T nor the names of its contributors may be used to
22 * endorse or promote products derived from this software without specific
23 * prior written permission.
25 * THIS SOFTWARE IS PROVIDED BY AT&T INTELLECTUAL PROPERTY ''AS IS'' AND ANY
26 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
27 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28 * DISCLAIMED. IN NO EVENT SHALL AT&T INTELLECTUAL PROPERTY BE LIABLE FOR ANY
29 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
32 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 *****************************************************************************/
42 #include "evel_internal.h"
43 #include "evel_throttle.h"
45 /**************************************************************************//**
46 * Create a new Measurement event.
48 * @note The mandatory fields on the Measurement must be supplied to this
49 * factory function and are immutable once set. Optional fields have
50 * explicit setter functions, but again values may only be set once so
51 * that the Measurement has immutable properties.
53 * @param measurement_interval
55 * @returns pointer to the newly manufactured ::EVENT_MEASUREMENT. If the
56 * event is not used (i.e. posted) it must be released using
58 * @retval NULL Failed to create the event.
59 *****************************************************************************/
60 EVENT_MEASUREMENT * evel_new_measurement(double measurement_interval)
62 EVENT_MEASUREMENT * measurement = NULL;
66 /***************************************************************************/
67 /* Check preconditions. */
68 /***************************************************************************/
69 assert(measurement_interval >= 0.0);
71 /***************************************************************************/
72 /* Allocate the measurement. */
73 /***************************************************************************/
74 measurement = malloc(sizeof(EVENT_MEASUREMENT));
75 if (measurement == NULL)
77 log_error_state("Out of memory for Measurement");
80 memset(measurement, 0, sizeof(EVENT_MEASUREMENT));
81 EVEL_DEBUG("New measurement is at %lp", measurement);
83 /***************************************************************************/
84 /* Initialize the header & the measurement fields. */
85 /***************************************************************************/
86 evel_init_header(&measurement->header,"vnfScalingMeasurement");
87 measurement->header.event_domain = EVEL_DOMAIN_MEASUREMENT;
88 measurement->measurement_interval = measurement_interval;
89 dlist_initialize(&measurement->additional_info);
90 dlist_initialize(&measurement->additional_measurements);
91 dlist_initialize(&measurement->additional_objects);
92 dlist_initialize(&measurement->cpu_usage);
93 dlist_initialize(&measurement->disk_usage);
94 dlist_initialize(&measurement->mem_usage);
95 dlist_initialize(&measurement->filesystem_usage);
96 dlist_initialize(&measurement->latency_distribution);
97 dlist_initialize(&measurement->vnic_usage);
98 dlist_initialize(&measurement->codec_usage);
99 dlist_initialize(&measurement->feature_usage);
100 evel_init_option_double(&measurement->mean_request_latency);
101 evel_init_option_int(&measurement->vnfc_scaling_metric);
102 evel_init_option_int(&measurement->concurrent_sessions);
103 evel_init_option_int(&measurement->configured_entities);
104 evel_init_option_int(&measurement->media_ports_in_use);
105 evel_init_option_int(&measurement->request_rate);
106 measurement->major_version = EVEL_MEASUREMENT_MAJOR_VERSION;
107 measurement->minor_version = EVEL_MEASUREMENT_MINOR_VERSION;
114 /**************************************************************************//**
115 * Set the Event Type property of the Measurement.
117 * @note The property is treated as immutable: it is only valid to call
118 * the setter once. However, we don't assert if the caller tries to
119 * overwrite, just ignoring the update instead.
121 * @param measurement Pointer to the Measurement.
122 * @param type The Event Type to be set. ASCIIZ string. The caller
123 * does not need to preserve the value once the function
125 *****************************************************************************/
126 void evel_measurement_type_set(EVENT_MEASUREMENT * measurement,
127 const char * const type)
131 /***************************************************************************/
132 /* Check preconditions and call evel_header_type_set. */
133 /***************************************************************************/
134 assert(measurement != NULL);
135 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
136 evel_header_type_set(&measurement->header, type);
141 /**************************************************************************//**
142 * Add an additional value name/value pair to the Measurement.
144 * The name and value are null delimited ASCII strings. The library takes
145 * a copy so the caller does not have to preserve values after the function
148 * @param measurement Pointer to the measurement.
149 * @param name ASCIIZ string with the attribute's name. The caller
150 * does not need to preserve the value once the function
152 * @param value ASCIIZ string with the attribute's value. The caller
153 * does not need to preserve the value once the function
155 *****************************************************************************/
156 void evel_measurement_addl_info_add(EVENT_MEASUREMENT * measurement, char * name, char * value)
158 OTHER_FIELD * addl_info = NULL;
161 /***************************************************************************/
162 /* Check preconditions. */
163 /***************************************************************************/
164 assert(measurement != NULL);
165 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
166 assert(name != NULL);
167 assert(value != NULL);
169 EVEL_DEBUG("Adding name=%s value=%s", name, value);
170 addl_info = malloc(sizeof(OTHER_FIELD));
171 assert(addl_info != NULL);
172 memset(addl_info, 0, sizeof(OTHER_FIELD));
173 addl_info->name = strdup(name);
174 addl_info->value = strdup(value);
175 assert(addl_info->name != NULL);
176 assert(addl_info->value != NULL);
178 dlist_push_last(&measurement->additional_info, addl_info);
183 /**************************************************************************//**
184 * Set the Concurrent Sessions property of the Measurement.
186 * @note The property is treated as immutable: it is only valid to call
187 * the setter once. However, we don't assert if the caller tries to
188 * overwrite, just ignoring the update instead.
190 * @param measurement Pointer to the Measurement.
191 * @param concurrent_sessions The Concurrent Sessions to be set.
192 *****************************************************************************/
193 void evel_measurement_conc_sess_set(EVENT_MEASUREMENT * measurement,
194 int concurrent_sessions)
198 /***************************************************************************/
199 /* Check preconditions. */
200 /***************************************************************************/
201 assert(measurement != NULL);
202 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
203 assert(concurrent_sessions >= 0);
205 evel_set_option_int(&measurement->concurrent_sessions,
207 "Concurrent Sessions");
211 /**************************************************************************//**
212 * Set the Configured Entities property of the Measurement.
214 * @note The property is treated as immutable: it is only valid to call
215 * the setter once. However, we don't assert if the caller tries to
216 * overwrite, just ignoring the update instead.
218 * @param measurement Pointer to the Measurement.
219 * @param configured_entities The Configured Entities to be set.
220 *****************************************************************************/
221 void evel_measurement_cfg_ents_set(EVENT_MEASUREMENT * measurement,
222 int configured_entities)
226 /***************************************************************************/
227 /* Check preconditions. */
228 /***************************************************************************/
229 assert(measurement != NULL);
230 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
231 assert(configured_entities >= 0);
233 evel_set_option_int(&measurement->configured_entities,
235 "Configured Entities");
239 /**************************************************************************//**
240 * Add an additional set of Errors to the Measurement.
242 * @note The property is treated as immutable: it is only valid to call
243 * the setter once. However, we don't assert if the caller tries to
244 * overwrite, just ignoring the update instead.
246 * @param measurement Pointer to the measurement.
247 * @param receive_discards The number of receive discards.
248 * @param receive_errors The number of receive errors.
249 * @param transmit_discards The number of transmit discards.
250 * @param transmit_errors The number of transmit errors.
251 *****************************************************************************/
252 void evel_measurement_errors_set(EVENT_MEASUREMENT * measurement,
253 int receive_discards,
255 int transmit_discards,
258 MEASUREMENT_ERRORS * errors = NULL;
261 /***************************************************************************/
262 /* Check preconditions. */
263 /***************************************************************************/
264 assert(measurement != NULL);
265 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
266 assert(receive_discards >= 0);
267 assert(receive_errors >= 0);
268 assert(transmit_discards >= 0);
269 assert(transmit_errors >= 0);
271 if (measurement->errors == NULL)
273 EVEL_DEBUG("Adding Errors: %d, %d; %d, %d",
278 errors = malloc(sizeof(MEASUREMENT_ERRORS));
279 assert(errors != NULL);
280 memset(errors, 0, sizeof(MEASUREMENT_ERRORS));
281 errors->receive_discards = receive_discards;
282 errors->receive_errors = receive_errors;
283 errors->transmit_discards = transmit_discards;
284 errors->transmit_errors = transmit_errors;
285 measurement->errors = errors;
289 errors = measurement->errors;
290 EVEL_DEBUG("Ignoring attempt to add Errors: %d, %d; %d, %d\n"
291 "Errors already set: %d, %d; %d, %d",
296 errors->receive_discards,
297 errors->receive_errors,
298 errors->transmit_discards,
299 errors->transmit_errors);
305 /**************************************************************************//**
306 * Set the Mean Request Latency property of the Measurement.
308 * @note The property is treated as immutable: it is only valid to call
309 * the setter once. However, we don't assert if the caller tries to
310 * overwrite, just ignoring the update instead.
312 * @param measurement Pointer to the Measurement.
313 * @param mean_request_latency The Mean Request Latency to be set.
314 *****************************************************************************/
315 void evel_measurement_mean_req_lat_set(EVENT_MEASUREMENT * measurement,
316 double mean_request_latency)
320 /***************************************************************************/
321 /* Check preconditions. */
322 /***************************************************************************/
323 assert(measurement != NULL);
324 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
325 assert(mean_request_latency >= 0.0);
327 evel_set_option_double(&measurement->mean_request_latency,
328 mean_request_latency,
329 "Mean Request Latency");
334 /**************************************************************************//**
335 * Set the Request Rate property of the Measurement.
337 * @note The property is treated as immutable: it is only valid to call
338 * the setter once. However, we don't assert if the caller tries to
339 * overwrite, just ignoring the update instead.
341 * @param measurement Pointer to the Measurement.
342 * @param request_rate The Request Rate to be set.
343 *****************************************************************************/
344 void evel_measurement_request_rate_set(EVENT_MEASUREMENT * measurement,
349 /***************************************************************************/
350 /* Check preconditions. */
351 /***************************************************************************/
352 assert(measurement != NULL);
353 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
354 assert(request_rate >= 0);
356 evel_set_option_int(&measurement->request_rate,
362 /**************************************************************************//**
363 * Add an additional CPU usage value name/value pair to the Measurement.
365 * The name and value are null delimited ASCII strings. The library takes
366 * a copy so the caller does not have to preserve values after the function
369 * @param measurement Pointer to the measurement.
370 * @param id ASCIIZ string with the CPU's identifier.
371 * @param usage CPU utilization.
372 *****************************************************************************/
373 MEASUREMENT_CPU_USE *evel_measurement_new_cpu_use_add(EVENT_MEASUREMENT * measurement,
374 char * id, double usage)
376 MEASUREMENT_CPU_USE * cpu_use = NULL;
379 /***************************************************************************/
380 /* Check assumptions. */
381 /***************************************************************************/
382 assert(measurement != NULL);
383 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
385 assert(usage >= 0.0);
387 /***************************************************************************/
388 /* Allocate a container for the value and push onto the list. */
389 /***************************************************************************/
390 EVEL_DEBUG("Adding id=%s usage=%lf", id, usage);
391 cpu_use = malloc(sizeof(MEASUREMENT_CPU_USE));
392 assert(cpu_use != NULL);
393 memset(cpu_use, 0, sizeof(MEASUREMENT_CPU_USE));
394 cpu_use->id = strdup(id);
395 cpu_use->usage = usage;
396 evel_init_option_double(&cpu_use->idle);
397 evel_init_option_double(&cpu_use->intrpt);
398 evel_init_option_double(&cpu_use->nice);
399 evel_init_option_double(&cpu_use->softirq);
400 evel_init_option_double(&cpu_use->steal);
401 evel_init_option_double(&cpu_use->sys);
402 evel_init_option_double(&cpu_use->user);
403 evel_init_option_double(&cpu_use->wait);
405 dlist_push_last(&measurement->cpu_usage, cpu_use);
411 /**************************************************************************//**
412 * Set the CPU Idle value in measurement interval
413 * percentage of CPU time spent in the idle task
415 * @note The property is treated as immutable: it is only valid to call
416 * the setter once. However, we don't assert if the caller tries to
417 * overwrite, just ignoring the update instead.
419 * @param cpu_use Pointer to the CPU Use.
421 *****************************************************************************/
422 void evel_measurement_cpu_use_idle_set(MEASUREMENT_CPU_USE *const cpu_use,
426 evel_set_option_double(&cpu_use->idle, val, "CPU idle time");
430 /**************************************************************************//**
431 * Set the percentage of time spent servicing interrupts
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_interrupt_set(MEASUREMENT_CPU_USE * const cpu_use,
444 evel_set_option_double(&cpu_use->intrpt, val, "CPU interrupt value");
449 /**************************************************************************//**
450 * Set the percentage of time spent running user space processes that have been niced
452 * @note The property is treated as immutable: it is only valid to call
453 * the setter once. However, we don't assert if the caller tries to
454 * overwrite, just ignoring the update instead.
456 * @param cpu_use Pointer to the CPU Use.
458 *****************************************************************************/
459 void evel_measurement_cpu_use_nice_set(MEASUREMENT_CPU_USE * const cpu_use,
463 evel_set_option_double(&cpu_use->nice, val, "CPU nice value");
468 /**************************************************************************//**
469 * Set the percentage of time spent handling soft irq interrupts
471 * @note The property is treated as immutable: it is only valid to call
472 * the setter once. However, we don't assert if the caller tries to
473 * overwrite, just ignoring the update instead.
475 * @param cpu_use Pointer to the CPU Use.
477 *****************************************************************************/
478 void evel_measurement_cpu_use_softirq_set(MEASUREMENT_CPU_USE * const cpu_use,
482 evel_set_option_double(&cpu_use->softirq, val, "CPU Soft IRQ value");
486 /**************************************************************************//**
487 * Set the percentage of time spent in involuntary wait
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_steal_set(MEASUREMENT_CPU_USE * const cpu_use,
500 evel_set_option_double(&cpu_use->steal, val, "CPU involuntary wait");
504 /**************************************************************************//**
505 * Set the percentage of time spent on system tasks running the kernel
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_system_set(MEASUREMENT_CPU_USE * const cpu_use,
518 evel_set_option_double(&cpu_use->sys, val, "CPU System load");
523 /**************************************************************************//**
524 * Set the percentage of time spent running un-niced user space processes
526 * @note The property is treated as immutable: it is only valid to call
527 * the setter once. However, we don't assert if the caller tries to
528 * overwrite, just ignoring the update instead.
530 * @param cpu_use Pointer to the CPU Use.
532 *****************************************************************************/
533 void evel_measurement_cpu_use_usageuser_set(MEASUREMENT_CPU_USE * const cpu_use,
537 evel_set_option_double(&cpu_use->user, val, "CPU User load value");
541 /**************************************************************************//**
542 * Set the percentage of CPU time spent waiting for I/O operations to complete
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_wait_set(MEASUREMENT_CPU_USE * const cpu_use,
555 evel_set_option_double(&cpu_use->wait, val, "CPU Wait IO value");
560 /**************************************************************************//**
561 * Add an additional Memory usage value name/value pair to the Measurement.
563 * The name and value are null delimited ASCII strings. The library takes
564 * a copy so the caller does not have to preserve values after the function
567 * @param measurement Pointer to the measurement.
568 * @param id ASCIIZ string with the Memory identifier.
569 * @param vmidentifier ASCIIZ string with the VM's identifier.
570 * @param membuffsz Memory Size.
572 * @return Returns pointer to memory use structure in measurements
573 *****************************************************************************/
574 MEASUREMENT_MEM_USE * evel_measurement_new_mem_use_add(EVENT_MEASUREMENT * measurement,
575 char * id, char *vmidentifier, double membuffsz)
577 MEASUREMENT_MEM_USE * mem_use = NULL;
580 /***************************************************************************/
581 /* Check assumptions. */
582 /***************************************************************************/
583 assert(measurement != NULL);
584 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
586 assert(membuffsz >= 0.0);
588 /***************************************************************************/
589 /* Allocate a container for the value and push onto the list. */
590 /***************************************************************************/
591 EVEL_DEBUG("Adding id=%s buffer size=%lf", id, membuffsz);
592 mem_use = malloc(sizeof(MEASUREMENT_MEM_USE));
593 assert(mem_use != NULL);
594 memset(mem_use, 0, sizeof(MEASUREMENT_MEM_USE));
595 mem_use->id = strdup(id);
596 mem_use->vmid = strdup(vmidentifier);
597 mem_use->membuffsz = membuffsz;
598 evel_init_option_double(&mem_use->memcache);
599 evel_init_option_double(&mem_use->memconfig);
600 evel_init_option_double(&mem_use->memfree);
601 evel_init_option_double(&mem_use->slabrecl);
602 evel_init_option_double(&mem_use->slabunrecl);
603 evel_init_option_double(&mem_use->memused);
605 assert(mem_use->id != NULL);
607 dlist_push_last(&measurement->mem_usage, mem_use);
613 /**************************************************************************//**
614 * Set kilobytes of memory used for cache
616 * @note The property is treated as immutable: it is only valid to call
617 * the setter once. However, we don't assert if the caller tries to
618 * overwrite, just ignoring the update instead.
620 * @param mem_use Pointer to the Memory Use.
622 *****************************************************************************/
623 void evel_measurement_mem_use_memcache_set(MEASUREMENT_MEM_USE * const mem_use,
627 evel_set_option_double(&mem_use->memcache, val, "Memory cache value");
631 /**************************************************************************//**
632 * Set kilobytes of memory configured in the virtual machine on which the VNFC reporting
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_memconfig_set(MEASUREMENT_MEM_USE * const mem_use,
645 evel_set_option_double(&mem_use->memconfig, val, "Memory configured value");
649 /**************************************************************************//**
650 * Set kilobytes of physical RAM left unused by the system
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_memfree_set(MEASUREMENT_MEM_USE * const mem_use,
663 evel_set_option_double(&mem_use->memfree, val, "Memory freely available value");
667 /**************************************************************************//**
668 * Set the part of the slab that can be reclaimed such as caches measured in kilobytes
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_slab_reclaimed_set(MEASUREMENT_MEM_USE * const mem_use,
681 evel_set_option_double(&mem_use->slabrecl, val, "Memory reclaimable slab set");
685 /**************************************************************************//**
686 * Set the part of the slab that cannot 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_unreclaimable_set(MEASUREMENT_MEM_USE * const mem_use,
699 evel_set_option_double(&mem_use->slabunrecl, val, "Memory unreclaimable slab set");
703 /**************************************************************************//**
704 * Set the total memory minus the sum of free, buffered, cached and slab memory 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_usedup_set(MEASUREMENT_MEM_USE * const mem_use,
717 evel_set_option_double(&mem_use->memused, val, "Memory usedup total set");
721 /**************************************************************************//**
722 * Add an additional Disk usage value name/value pair to the Measurement.
724 * The name and value are null delimited ASCII strings. The library takes
725 * a copy so the caller does not have to preserve values after the function
728 * @param measurement Pointer to the measurement.
729 * @param id ASCIIZ string with the CPU's identifier.
730 * @param usage Disk utilization.
731 *****************************************************************************/
732 MEASUREMENT_DISK_USE * evel_measurement_new_disk_use_add(EVENT_MEASUREMENT * measurement, char * id)
734 MEASUREMENT_DISK_USE * disk_use = NULL;
737 /***************************************************************************/
738 /* Check assumptions. */
739 /***************************************************************************/
740 assert(measurement != NULL);
741 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
744 /***************************************************************************/
745 /* Allocate a container for the value and push onto the list. */
746 /***************************************************************************/
747 EVEL_DEBUG("Adding id=%s disk usage", id);
748 disk_use = malloc(sizeof(MEASUREMENT_DISK_USE));
749 assert(disk_use != NULL);
750 memset(disk_use, 0, sizeof(MEASUREMENT_DISK_USE));
751 disk_use->id = strdup(id);
752 assert(disk_use->id != NULL);
753 dlist_push_last(&measurement->disk_usage, disk_use);
755 evel_init_option_double(&disk_use->iotimeavg );
756 evel_init_option_double(&disk_use->iotimelast );
757 evel_init_option_double(&disk_use->iotimemax );
758 evel_init_option_double(&disk_use->iotimemin );
759 evel_init_option_double(&disk_use->mergereadavg );
760 evel_init_option_double(&disk_use->mergereadlast );
761 evel_init_option_double(&disk_use->mergereadmax );
762 evel_init_option_double(&disk_use->mergereadmin );
763 evel_init_option_double(&disk_use->mergewriteavg );
764 evel_init_option_double(&disk_use->mergewritelast );
765 evel_init_option_double(&disk_use->mergewritemax );
766 evel_init_option_double(&disk_use->mergewritemin );
767 evel_init_option_double(&disk_use->octetsreadavg );
768 evel_init_option_double(&disk_use->octetsreadlast );
769 evel_init_option_double(&disk_use->octetsreadmax );
770 evel_init_option_double(&disk_use->octetsreadmin );
771 evel_init_option_double(&disk_use->octetswriteavg );
772 evel_init_option_double(&disk_use->octetswritelast );
773 evel_init_option_double(&disk_use->octetswritemax );
774 evel_init_option_double(&disk_use->octetswritemin );
775 evel_init_option_double(&disk_use->opsreadavg );
776 evel_init_option_double(&disk_use->opsreadlast );
777 evel_init_option_double(&disk_use->opsreadmax );
778 evel_init_option_double(&disk_use->opsreadmin );
779 evel_init_option_double(&disk_use->opswriteavg );
780 evel_init_option_double(&disk_use->opswritelast );
781 evel_init_option_double(&disk_use->opswritemax );
782 evel_init_option_double(&disk_use->opswritemin );
783 evel_init_option_double(&disk_use->pendingopsavg );
784 evel_init_option_double(&disk_use->pendingopslast );
785 evel_init_option_double(&disk_use->pendingopsmax );
786 evel_init_option_double(&disk_use->pendingopsmin );
787 evel_init_option_double(&disk_use->timereadavg );
788 evel_init_option_double(&disk_use->timereadlast );
789 evel_init_option_double(&disk_use->timereadmax );
790 evel_init_option_double(&disk_use->timereadmin );
791 evel_init_option_double(&disk_use->timewriteavg );
792 evel_init_option_double(&disk_use->timewritelast );
793 evel_init_option_double(&disk_use->timewritemax );
794 evel_init_option_double(&disk_use->timewritemin );
800 /**************************************************************************//**
801 * Set milliseconds spent doing input/output operations over 1 sec; treat
802 * this metric as a device load percentage where 1000ms matches 100% load;
803 * provide the average over the measurement interval
805 * @note The property is treated as immutable: it is only valid to call
806 * the setter once. However, we don't assert if the caller tries to
807 * overwrite, just ignoring the update instead.
809 * @param disk_use Pointer to the Disk Use.
811 *****************************************************************************/
812 void evel_measurement_disk_use_iotimeavg_set(MEASUREMENT_DISK_USE * const disk_use,
816 evel_set_option_double(&disk_use->iotimeavg, val, "Disk ioload set");
820 /**************************************************************************//**
821 * Set milliseconds spent doing input/output operations over 1 sec; treat
822 * this metric as a device load percentage where 1000ms matches 100% load;
823 * provide the last value within the measurement interval
825 * @note The property is treated as immutable: it is only valid to call
826 * the setter once. However, we don't assert if the caller tries to
827 * overwrite, just ignoring the update instead.
829 * @param disk_use Pointer to the Disk Use.
831 *****************************************************************************/
832 void evel_measurement_disk_use_iotimelast_set(MEASUREMENT_DISK_USE * const disk_use,
836 evel_set_option_double(&disk_use->iotimelast, val, "Disk ioloadlast set");
840 /**************************************************************************//**
841 * Set milliseconds spent doing input/output operations over 1 sec; treat
842 * this metric as a device load percentage where 1000ms matches 100% load;
843 * provide the maximum value within the measurement interval
845 * @note The property is treated as immutable: it is only valid to call
846 * the setter once. However, we don't assert if the caller tries to
847 * overwrite, just ignoring the update instead.
849 * @param disk_use Pointer to the Disk Use.
851 *****************************************************************************/
852 void evel_measurement_disk_use_iotimemax_set(MEASUREMENT_DISK_USE * const disk_use,
856 evel_set_option_double(&disk_use->iotimemax, val, "Disk ioloadmax set");
860 /**************************************************************************//**
861 * Set milliseconds spent doing input/output operations over 1 sec; treat
862 * this metric as a device load percentage where 1000ms matches 100% load;
863 * provide the minimum value within the measurement interval
865 * @note The property is treated as immutable: it is only valid to call
866 * the setter once. However, we don't assert if the caller tries to
867 * overwrite, just ignoring the update instead.
869 * @param disk_use Pointer to the Disk Use.
871 *****************************************************************************/
872 void evel_measurement_disk_use_iotimemin_set(MEASUREMENT_DISK_USE * const disk_use,
876 evel_set_option_double(&disk_use->iotimemin, val, "Disk ioloadmin set");
880 /**************************************************************************//**
881 * Set number of logical read operations that were merged into physical read
882 * operations, e.g., two logical reads were served by one physical disk access;
883 * provide the average measurement within the measurement interval
885 * @note The property is treated as immutable: it is only valid to call
886 * the setter once. However, we don't assert if the caller tries to
887 * overwrite, just ignoring the update instead.
889 * @param disk_use Pointer to the Disk Use.
891 *****************************************************************************/
892 void evel_measurement_disk_use_mergereadavg_set(MEASUREMENT_DISK_USE * const disk_use,
896 evel_set_option_double(&disk_use->mergereadavg, val, "Disk Merged read average set");
899 /**************************************************************************//**
900 * Set number of logical read operations that were merged into physical read
901 * operations, e.g., two logical reads were served by one physical disk access;
902 * provide the last measurement within the measurement interval
904 * @note The property is treated as immutable: it is only valid to call
905 * the setter once. However, we don't assert if the caller tries to
906 * overwrite, just ignoring the update instead.
908 * @param disk_use Pointer to the Disk Use.
910 *****************************************************************************/
911 void evel_measurement_disk_use_mergereadlast_set(MEASUREMENT_DISK_USE * const disk_use,
915 evel_set_option_double(&disk_use->mergereadlast, val, "Disk mergedload last set");
918 /**************************************************************************//**
919 * Set number of logical read operations that were merged into physical read
920 * operations, e.g., two logical reads were served by one physical disk access;
921 * provide the maximum measurement within the measurement interval
923 * @note The property is treated as immutable: it is only valid to call
924 * the setter once. However, we don't assert if the caller tries to
925 * overwrite, just ignoring the update instead.
927 * @param disk_use Pointer to the Disk Use.
929 *****************************************************************************/
930 void evel_measurement_disk_use_mergereadmax_set(MEASUREMENT_DISK_USE * const disk_use,
934 evel_set_option_double(&disk_use->mergereadmax, val, "Disk merged loadmax set");
938 /**************************************************************************//**
939 * Set number of logical read operations that were merged into physical read
940 * operations, e.g., two logical reads were served by one physical disk access;
941 * provide the minimum measurement within the measurement interval
943 * @note The property is treated as immutable: it is only valid to call
944 * the setter once. However, we don't assert if the caller tries to
945 * overwrite, just ignoring the update instead.
947 * @param disk_use Pointer to the Disk Use.
949 *****************************************************************************/
950 void evel_measurement_disk_use_mergereadmin_set(MEASUREMENT_DISK_USE * const disk_use,
954 evel_set_option_double(&disk_use->mergereadmin, val, "Disk merged loadmin set");
957 /**************************************************************************//**
958 * Set number of logical write operations that were merged into physical read
959 * operations, e.g., two logical writes were served by one physical disk access;
960 * provide the last measurement within the measurement interval
962 * @note The property is treated as immutable: it is only valid to call
963 * the setter once. However, we don't assert if the caller tries to
964 * overwrite, just ignoring the update instead.
966 * @param disk_use Pointer to the Disk Use.
968 *****************************************************************************/
969 void evel_measurement_disk_use_mergewritelast_set(MEASUREMENT_DISK_USE * const disk_use,
973 evel_set_option_double(&disk_use->mergewritelast, val, "Disk merged writelast set");
976 /**************************************************************************//**
977 * Set number of logical write operations that were merged into physical read
978 * operations, e.g., two logical writes were served by one physical disk access;
979 * provide the maximum measurement within the measurement interval
981 * @note The property is treated as immutable: it is only valid to call
982 * the setter once. However, we don't assert if the caller tries to
983 * overwrite, just ignoring the update instead.
985 * @param disk_use Pointer to the Disk Use.
987 *****************************************************************************/
988 void evel_measurement_disk_use_mergewritemax_set(MEASUREMENT_DISK_USE * const disk_use,
992 evel_set_option_double(&disk_use->mergewritemax, val, "Disk writemax set");
995 /**************************************************************************//**
996 * Set number of logical write operations that were merged into physical read
997 * operations, e.g., two logical writes were served by one physical disk access;
998 * provide the maximum measurement within the measurement interval
1000 * @note The property is treated as immutable: it is only valid to call
1001 * the setter once. However, we don't assert if the caller tries to
1002 * overwrite, just ignoring the update instead.
1004 * @param disk_use Pointer to the Disk Use.
1006 *****************************************************************************/
1007 void evel_measurement_disk_use_mergewritemin_set(MEASUREMENT_DISK_USE * const disk_use,
1011 evel_set_option_double(&disk_use->mergewritemin, val, "Disk writemin set");
1015 /**************************************************************************//**
1016 * Set number of octets per second read from a disk or partition;
1017 * provide the average measurement within the measurement interval
1019 * @note The property is treated as immutable: it is only valid to call
1020 * the setter once. However, we don't assert if the caller tries to
1021 * overwrite, just ignoring the update instead.
1023 * @param disk_use Pointer to the Disk Use.
1025 *****************************************************************************/
1026 void evel_measurement_disk_use_octetsreadavg_set(MEASUREMENT_DISK_USE * const disk_use,
1030 evel_set_option_double(&disk_use->octetsreadavg, val, "Octets readavg set");
1034 /**************************************************************************//**
1035 * Set number of octets per second read from a disk or partition;
1036 * provide the last measurement within the measurement interval
1038 * @note The property is treated as immutable: it is only valid to call
1039 * the setter once. However, we don't assert if the caller tries to
1040 * overwrite, just ignoring the update instead.
1042 * @param disk_use Pointer to the Disk Use.
1044 *****************************************************************************/
1045 void evel_measurement_disk_use_octetsreadlast_set(MEASUREMENT_DISK_USE * const disk_use,
1049 evel_set_option_double(&disk_use->octetsreadlast, val, "Octets readlast set");
1053 /**************************************************************************//**
1054 * Set number of octets per second read from a disk or partition;
1055 * provide the maximum measurement within the measurement interval
1057 * @note The property is treated as immutable: it is only valid to call
1058 * the setter once. However, we don't assert if the caller tries to
1059 * overwrite, just ignoring the update instead.
1061 * @param disk_use Pointer to the Disk Use.
1063 *****************************************************************************/
1064 void evel_measurement_disk_use_octetsreadmax_set(MEASUREMENT_DISK_USE * const disk_use,
1068 evel_set_option_double(&disk_use->octetsreadmax, val, "Octets readmax set");
1071 /**************************************************************************//**
1072 * Set number of octets per second read from a disk or partition;
1073 * provide the minimum 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_octetsreadmin_set(MEASUREMENT_DISK_USE * const disk_use,
1086 evel_set_option_double(&disk_use->octetsreadmin, val, "Octets readmin set");
1089 /**************************************************************************//**
1090 * Set number of octets per second written to a disk or partition;
1091 * provide the average measurement within the measurement interval
1093 * @note The property is treated as immutable: it is only valid to call
1094 * the setter once. However, we don't assert if the caller tries to
1095 * overwrite, just ignoring the update instead.
1097 * @param disk_use Pointer to the Disk Use.
1099 *****************************************************************************/
1100 void evel_measurement_disk_use_octetswriteavg_set(MEASUREMENT_DISK_USE * const disk_use,
1104 evel_set_option_double(&disk_use->octetswriteavg, val, "Octets writeavg set");
1107 /**************************************************************************//**
1108 * Set number of octets per second written to a disk or partition;
1109 * provide the last measurement within the measurement interval
1111 * @note The property is treated as immutable: it is only valid to call
1112 * the setter once. However, we don't assert if the caller tries to
1113 * overwrite, just ignoring the update instead.
1115 * @param disk_use Pointer to the Disk Use.
1117 *****************************************************************************/
1118 void evel_measurement_disk_use_octetswritelast_set(MEASUREMENT_DISK_USE * const disk_use,
1122 evel_set_option_double(&disk_use->octetswritelast, val, "Octets writelast set");
1125 /**************************************************************************//**
1126 * Set number of octets per second written to a disk or partition;
1127 * provide the maximum measurement within the measurement interval
1129 * @note The property is treated as immutable: it is only valid to call
1130 * the setter once. However, we don't assert if the caller tries to
1131 * overwrite, just ignoring the update instead.
1133 * @param disk_use Pointer to the Disk Use.
1135 *****************************************************************************/
1136 void evel_measurement_disk_use_octetswritemax_set(MEASUREMENT_DISK_USE * const disk_use,
1140 evel_set_option_double(&disk_use->octetswritemax, val, "Octets writemax set");
1143 /**************************************************************************//**
1144 * Set number of octets per second written to a disk or partition;
1145 * provide the minimum measurement within the measurement interval
1147 * @note The property is treated as immutable: it is only valid to call
1148 * the setter once. However, we don't assert if the caller tries to
1149 * overwrite, just ignoring the update instead.
1151 * @param disk_use Pointer to the Disk Use.
1153 *****************************************************************************/
1154 void evel_measurement_disk_use_octetswritemin_set(MEASUREMENT_DISK_USE * const disk_use,
1158 evel_set_option_double(&disk_use->octetswritemin, val, "Octets writemin set");
1162 /**************************************************************************//**
1163 * Set number of read operations per second issued to the disk;
1164 * provide the average 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_opsreadavg_set(MEASUREMENT_DISK_USE * const disk_use,
1177 evel_set_option_double(&disk_use->opsreadavg, val, "Disk read operation average set");
1180 /**************************************************************************//**
1181 * Set number of read operations per second issued to the disk;
1182 * provide the last 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_opsreadlast_set(MEASUREMENT_DISK_USE * const disk_use,
1195 evel_set_option_double(&disk_use->opsreadlast, val, "Disk read operation last set");
1198 /**************************************************************************//**
1199 * Set number of read operations per second issued to the disk;
1200 * provide the maximum measurement within the measurement interval
1202 * @note The property is treated as immutable: it is only valid to call
1203 * the setter once. However, we don't assert if the caller tries to
1204 * overwrite, just ignoring the update instead.
1206 * @param disk_use Pointer to the Disk Use.
1208 *****************************************************************************/
1209 void evel_measurement_disk_use_opsreadmax_set(MEASUREMENT_DISK_USE * const disk_use,
1213 evel_set_option_double(&disk_use->opsreadmax, val, "Disk read operation maximum set");
1216 /**************************************************************************//**
1217 * Set number of read operations per second issued to the disk;
1218 * provide the minimum measurement within the measurement interval
1220 * @note The property is treated as immutable: it is only valid to call
1221 * the setter once. However, we don't assert if the caller tries to
1222 * overwrite, just ignoring the update instead.
1224 * @param disk_use Pointer to the Disk Use.
1226 *****************************************************************************/
1227 void evel_measurement_disk_use_opsreadmin_set(MEASUREMENT_DISK_USE * const disk_use,
1231 evel_set_option_double(&disk_use->opsreadmin, val, "Disk read operation minimum set");
1234 /**************************************************************************//**
1235 * Set number of write operations per second issued to the disk;
1236 * provide the average measurement within the measurement interval
1238 * @note The property is treated as immutable: it is only valid to call
1239 * the setter once. However, we don't assert if the caller tries to
1240 * overwrite, just ignoring the update instead.
1242 * @param disk_use Pointer to the Disk Use.
1244 *****************************************************************************/
1245 void evel_measurement_disk_use_opswriteavg_set(MEASUREMENT_DISK_USE * const disk_use,
1249 evel_set_option_double(&disk_use->opswriteavg, val, "Disk write operation average set");
1252 /**************************************************************************//**
1253 * Set number of write operations per second issued to the disk;
1254 * provide the last measurement within the measurement interval
1256 * @note The property is treated as immutable: it is only valid to call
1257 * the setter once. However, we don't assert if the caller tries to
1258 * overwrite, just ignoring the update instead.
1260 * @param disk_use Pointer to the Disk Use.
1262 *****************************************************************************/
1263 void evel_measurement_disk_use_opswritelast_set(MEASUREMENT_DISK_USE * const disk_use,
1267 evel_set_option_double(&disk_use->opswritelast, val, "Disk write operation last set");
1271 /**************************************************************************//**
1272 * Set number of write operations per second issued to the disk;
1273 * provide the maximum 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_opswritemax_set(MEASUREMENT_DISK_USE * const disk_use,
1286 evel_set_option_double(&disk_use->opswritemax, val, "Disk write operation maximum set");
1289 /**************************************************************************//**
1290 * Set number of write operations per second issued to the disk;
1291 * provide the average 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_opswritemin_set(MEASUREMENT_DISK_USE * const disk_use,
1304 evel_set_option_double(&disk_use->opswritemin, val, "Disk write operation minimum set");
1308 /**************************************************************************//**
1309 * Set queue size of pending I/O operations per second;
1310 * provide the average 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_pendingopsavg_set(MEASUREMENT_DISK_USE * const disk_use,
1323 evel_set_option_double(&disk_use->pendingopsavg, val, "Disk pending operation average set");
1326 /**************************************************************************//**
1327 * Set queue size of pending I/O operations per second;
1328 * provide the last 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_pendingopslast_set(MEASUREMENT_DISK_USE * const disk_use,
1341 evel_set_option_double(&disk_use->pendingopslast, val, "Disk pending operation last set");
1344 /**************************************************************************//**
1345 * Set queue size of pending I/O operations per second;
1346 * provide the maximum measurement within the measurement interval
1348 * @note The property is treated as immutable: it is only valid to call
1349 * the setter once. However, we don't assert if the caller tries to
1350 * overwrite, just ignoring the update instead.
1352 * @param disk_use Pointer to the Disk Use.
1354 *****************************************************************************/
1355 void evel_measurement_disk_use_pendingopsmax_set(MEASUREMENT_DISK_USE * const disk_use,
1359 evel_set_option_double(&disk_use->pendingopsmax, val, "Disk pending operation maximum set");
1362 /**************************************************************************//**
1363 * Set queue size of pending I/O operations per second;
1364 * provide the minimum measurement within the measurement interval
1366 * @note The property is treated as immutable: it is only valid to call
1367 * the setter once. However, we don't assert if the caller tries to
1368 * overwrite, just ignoring the update instead.
1370 * @param disk_use Pointer to the Disk Use.
1372 *****************************************************************************/
1373 void evel_measurement_disk_use_pendingopsmin_set(MEASUREMENT_DISK_USE * const disk_use,
1377 evel_set_option_double(&disk_use->pendingopsmin, val, "Disk pending operation min set");
1381 /**************************************************************************//**
1382 * Set milliseconds a read operation took to complete;
1383 * provide the average 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_timereadavg_set(MEASUREMENT_DISK_USE * const disk_use,
1396 evel_set_option_double(&disk_use->timereadavg, val, "Disk read time average set");
1399 /**************************************************************************//**
1400 * Set milliseconds a read operation took to complete;
1401 * provide the last 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_timereadlast_set(MEASUREMENT_DISK_USE * const disk_use,
1414 evel_set_option_double(&disk_use->timereadlast, val, "Disk read time last set");
1417 /**************************************************************************//**
1418 * Set milliseconds a read operation took to complete;
1419 * provide the maximum measurement within the measurement interval
1421 * @note The property is treated as immutable: it is only valid to call
1422 * the setter once. However, we don't assert if the caller tries to
1423 * overwrite, just ignoring the update instead.
1425 * @param disk_use Pointer to the Disk Use.
1427 *****************************************************************************/
1428 void evel_measurement_disk_use_timereadmax_set(MEASUREMENT_DISK_USE * const disk_use,
1432 evel_set_option_double(&disk_use->timereadmax, val, "Disk read time maximum set");
1435 /**************************************************************************//**
1436 * Set milliseconds a read operation took to complete;
1437 * provide the minimum measurement within the measurement interval
1439 * @note The property is treated as immutable: it is only valid to call
1440 * the setter once. However, we don't assert if the caller tries to
1441 * overwrite, just ignoring the update instead.
1443 * @param disk_use Pointer to the Disk Use.
1445 *****************************************************************************/
1446 void evel_measurement_disk_use_timereadmin_set(MEASUREMENT_DISK_USE * const disk_use,
1450 evel_set_option_double(&disk_use->timereadmin, val, "Disk read time minimum set");
1453 /**************************************************************************//**
1454 * Set milliseconds a write operation took to complete;
1455 * provide the average measurement within the measurement interval
1457 * @note The property is treated as immutable: it is only valid to call
1458 * the setter once. However, we don't assert if the caller tries to
1459 * overwrite, just ignoring the update instead.
1461 * @param disk_use Pointer to the Disk Use.
1463 *****************************************************************************/
1464 void evel_measurement_disk_use_timewriteavg_set(MEASUREMENT_DISK_USE * const disk_use,
1468 evel_set_option_double(&disk_use->timewriteavg, val, "Disk write time average set");
1472 /**************************************************************************//**
1473 * Set milliseconds a write operation took to complete;
1474 * provide the last 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_timewritelast_set(MEASUREMENT_DISK_USE * const disk_use,
1487 evel_set_option_double(&disk_use->timewritelast, val, "Disk write time last set");
1490 /**************************************************************************//**
1491 * Set milliseconds a write operation took to complete;
1492 * provide the maximum 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_timewritemax_set(MEASUREMENT_DISK_USE * const disk_use,
1505 evel_set_option_double(&disk_use->timewritemax, val, "Disk write time max set");
1508 /**************************************************************************//**
1509 * Set milliseconds a write operation took to complete;
1510 * provide the average measurement within the measurement interval
1512 * @note The property is treated as immutable: it is only valid to call
1513 * the setter once. However, we don't assert if the caller tries to
1514 * overwrite, just ignoring the update instead.
1516 * @param disk_use Pointer to the Disk Use.
1518 *****************************************************************************/
1519 void evel_measurement_disk_use_timewritemin_set(MEASUREMENT_DISK_USE * const disk_use,
1523 evel_set_option_double(&disk_use->timewritemin, val, "Disk write time min set");
1527 /**************************************************************************//**
1528 * Add an additional File System usage value name/value pair to the
1531 * The filesystem_name is null delimited ASCII string. The library takes a
1532 * copy so the caller does not have to preserve values after the function
1535 * @param measurement Pointer to the measurement.
1536 * @param filesystem_name ASCIIZ string with the file-system's UUID.
1537 * @param block_configured Block storage configured.
1538 * @param block_used Block storage in use.
1539 * @param block_iops Block storage IOPS.
1540 * @param ephemeral_configured Ephemeral storage configured.
1541 * @param ephemeral_used Ephemeral storage in use.
1542 * @param ephemeral_iops Ephemeral storage IOPS.
1543 *****************************************************************************/
1544 void evel_measurement_fsys_use_add(EVENT_MEASUREMENT * measurement,
1545 char * filesystem_name,
1546 double block_configured,
1549 double ephemeral_configured,
1550 double ephemeral_used,
1553 MEASUREMENT_FSYS_USE * fsys_use = NULL;
1556 /***************************************************************************/
1557 /* Check assumptions. */
1558 /***************************************************************************/
1559 assert(measurement != NULL);
1560 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1561 assert(filesystem_name != NULL);
1562 assert(block_configured >= 0.0);
1563 assert(block_used >= 0.0);
1564 assert(block_iops >= 0);
1565 assert(ephemeral_configured >= 0.0);
1566 assert(ephemeral_used >= 0.0);
1567 assert(ephemeral_iops >= 0);
1569 /***************************************************************************/
1570 /* Allocate a container for the value and push onto the list. */
1571 /***************************************************************************/
1572 EVEL_DEBUG("Adding filesystem_name=%s", filesystem_name);
1573 fsys_use = malloc(sizeof(MEASUREMENT_FSYS_USE));
1574 assert(fsys_use != NULL);
1575 memset(fsys_use, 0, sizeof(MEASUREMENT_FSYS_USE));
1576 fsys_use->filesystem_name = strdup(filesystem_name);
1577 fsys_use->block_configured = block_configured;
1578 fsys_use->block_used = block_used;
1579 fsys_use->block_iops = block_iops;
1580 fsys_use->ephemeral_configured = block_configured;
1581 fsys_use->ephemeral_used = ephemeral_used;
1582 fsys_use->ephemeral_iops = ephemeral_iops;
1584 dlist_push_last(&measurement->filesystem_usage, fsys_use);
1589 /**************************************************************************//**
1590 * Add a Feature usage value name/value pair to the Measurement.
1592 * The name is null delimited ASCII string. The library takes
1593 * a copy so the caller does not have to preserve values after the function
1596 * @param measurement Pointer to the measurement.
1597 * @param feature ASCIIZ string with the feature's name.
1598 * @param utilization Utilization of the feature.
1599 *****************************************************************************/
1600 void evel_measurement_feature_use_add(EVENT_MEASUREMENT * measurement,
1604 MEASUREMENT_FEATURE_USE * feature_use = NULL;
1607 /***************************************************************************/
1608 /* Check assumptions. */
1609 /***************************************************************************/
1610 assert(measurement != NULL);
1611 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1612 assert(feature != NULL);
1613 assert(utilization >= 0);
1615 /***************************************************************************/
1616 /* Allocate a container for the value and push onto the list. */
1617 /***************************************************************************/
1618 EVEL_DEBUG("Adding Feature=%s Use=%d", feature, utilization);
1619 feature_use = malloc(sizeof(MEASUREMENT_FEATURE_USE));
1620 assert(feature_use != NULL);
1621 memset(feature_use, 0, sizeof(MEASUREMENT_FEATURE_USE));
1622 feature_use->feature_id = strdup(feature);
1623 assert(feature_use->feature_id != NULL);
1624 feature_use->feature_utilization = utilization;
1626 dlist_push_last(&measurement->feature_usage, feature_use);
1631 /**************************************************************************//**
1632 * Add a Additional Measurement value name/value pair to the Report.
1634 * The name is null delimited ASCII string. The library takes
1635 * a copy so the caller does not have to preserve values after the function
1638 * @param measurement Pointer to the Measaurement.
1639 * @param group ASCIIZ string with the measurement group's name.
1640 * @param name ASCIIZ string containing the measurement's name.
1641 * @param value ASCIIZ string containing the measurement's value.
1642 *****************************************************************************/
1643 void evel_measurement_custom_measurement_add(EVENT_MEASUREMENT * measurement,
1644 const char * const group,
1645 const char * const name,
1646 const char * const value)
1648 MEASUREMENT_GROUP * measurement_group = NULL;
1649 CUSTOM_MEASUREMENT * custom_measurement = NULL;
1650 DLIST_ITEM * item = NULL;
1653 /***************************************************************************/
1654 /* Check assumptions. */
1655 /***************************************************************************/
1656 assert(measurement != NULL);
1657 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1658 assert(group != NULL);
1659 assert(name != NULL);
1660 assert(value != NULL);
1662 /***************************************************************************/
1663 /* Allocate a container for the name/value pair. */
1664 /***************************************************************************/
1665 EVEL_DEBUG("Adding Measurement Group=%s Name=%s Value=%s",
1666 group, name, value);
1667 custom_measurement = malloc(sizeof(CUSTOM_MEASUREMENT));
1668 assert(custom_measurement != NULL);
1669 memset(custom_measurement, 0, sizeof(CUSTOM_MEASUREMENT));
1670 custom_measurement->name = strdup(name);
1671 assert(custom_measurement->name != NULL);
1672 custom_measurement->value = strdup(value);
1673 assert(custom_measurement->value != NULL);
1675 /***************************************************************************/
1676 /* See if we have that group already. */
1677 /***************************************************************************/
1678 item = dlist_get_first(&measurement->additional_measurements);
1679 while (item != NULL)
1681 measurement_group = (MEASUREMENT_GROUP *) item->item;
1682 assert(measurement_group != NULL);
1684 EVEL_DEBUG("Got measurement group %s", measurement_group->name);
1685 if (strcmp(group, measurement_group->name) == 0)
1687 EVEL_DEBUG("Found existing Measurement Group");
1690 item = dlist_get_next(item);
1693 /***************************************************************************/
1694 /* If we didn't have the group already, create it. */
1695 /***************************************************************************/
1698 EVEL_DEBUG("Creating new Measurement Group");
1699 measurement_group = malloc(sizeof(MEASUREMENT_GROUP));
1700 assert(measurement_group != NULL);
1701 memset(measurement_group, 0, sizeof(MEASUREMENT_GROUP));
1702 measurement_group->name = strdup(group);
1703 assert(measurement_group->name != NULL);
1704 dlist_initialize(&measurement_group->measurements);
1705 dlist_push_last(&measurement->additional_measurements, measurement_group);
1708 /***************************************************************************/
1709 /* If we didn't have the group already, create it. */
1710 /***************************************************************************/
1711 dlist_push_last(&measurement_group->measurements, custom_measurement);
1716 /**************************************************************************//**
1717 * Add a Codec usage value name/value pair to the Measurement.
1719 * The name is null delimited ASCII string. The library takes
1720 * a copy so the caller does not have to preserve values after the function
1723 * @param measurement Pointer to the measurement.
1724 * @param codec ASCIIZ string with the codec's name.
1725 * @param utilization Number of codecs in use.
1726 *****************************************************************************/
1727 void evel_measurement_codec_use_add(EVENT_MEASUREMENT * measurement,
1731 MEASUREMENT_CODEC_USE * codec_use = NULL;
1734 /***************************************************************************/
1735 /* Check assumptions. */
1736 /***************************************************************************/
1737 assert(measurement != NULL);
1738 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1739 assert(codec != NULL);
1740 assert(utilization >= 0.0);
1742 /***************************************************************************/
1743 /* Allocate a container for the value and push onto the list. */
1744 /***************************************************************************/
1745 EVEL_DEBUG("Adding Codec=%s Use=%d", codec, utilization);
1746 codec_use = malloc(sizeof(MEASUREMENT_CODEC_USE));
1747 assert(codec_use != NULL);
1748 memset(codec_use, 0, sizeof(MEASUREMENT_CODEC_USE));
1749 codec_use->codec_id = strdup(codec);
1750 assert(codec_use->codec_id != NULL);
1751 codec_use->number_in_use = utilization;
1753 dlist_push_last(&measurement->codec_usage, codec_use);
1759 /**************************************************************************//**
1760 * Set the Media Ports in Use property of the Measurement.
1762 * @note The property is treated as immutable: it is only valid to call
1763 * the setter once. However, we don't assert if the caller tries to
1764 * overwrite, just ignoring the update instead.
1766 * @param measurement Pointer to the measurement.
1767 * @param media_ports_in_use The media port usage to set.
1768 *****************************************************************************/
1769 void evel_measurement_media_port_use_set(EVENT_MEASUREMENT * measurement,
1770 int media_ports_in_use)
1774 /***************************************************************************/
1775 /* Check preconditions. */
1776 /***************************************************************************/
1777 assert(measurement != NULL);
1778 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1779 assert(media_ports_in_use >= 0);
1781 evel_set_option_int(&measurement->media_ports_in_use,
1783 "Media Ports In Use");
1787 /**************************************************************************//**
1788 * Set the VNFC Scaling Metric property of the Measurement.
1790 * @note The property is treated as immutable: it is only valid to call
1791 * the setter once. However, we don't assert if the caller tries to
1792 * overwrite, just ignoring the update instead.
1794 * @param measurement Pointer to the measurement.
1795 * @param scaling_metric The scaling metric to set.
1796 *****************************************************************************/
1797 void evel_measurement_vnfc_scaling_metric_set(EVENT_MEASUREMENT * measurement,
1802 /***************************************************************************/
1803 /* Check preconditions. */
1804 /***************************************************************************/
1805 assert(measurement != NULL);
1806 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1807 assert(scaling_metric >= 0.0);
1809 evel_set_option_int(&measurement->vnfc_scaling_metric,
1811 "VNFC Scaling Metric");
1815 /**************************************************************************//**
1816 * Create a new Latency Bucket to be added to a Measurement event.
1818 * @note The mandatory fields on the ::MEASUREMENT_LATENCY_BUCKET must be
1819 * supplied to this factory function and are immutable once set.
1820 * Optional fields have explicit setter functions, but again values
1821 * may only be set once so that the ::MEASUREMENT_LATENCY_BUCKET has
1822 * immutable properties.
1824 * @param count Count of events in this bucket.
1826 * @returns pointer to the newly manufactured ::MEASUREMENT_LATENCY_BUCKET.
1827 * If the structure is not used it must be released using free.
1828 * @retval NULL Failed to create the Latency Bucket.
1829 *****************************************************************************/
1830 MEASUREMENT_LATENCY_BUCKET * evel_new_meas_latency_bucket(const int count)
1832 MEASUREMENT_LATENCY_BUCKET * bucket;
1836 /***************************************************************************/
1837 /* Check preconditions. */
1838 /***************************************************************************/
1841 /***************************************************************************/
1842 /* Allocate, then set Mandatory Parameters. */
1843 /***************************************************************************/
1844 EVEL_DEBUG("Creating bucket, count = %d", count);
1845 bucket = malloc(sizeof(MEASUREMENT_LATENCY_BUCKET));
1846 assert(bucket != NULL);
1848 /***************************************************************************/
1849 /* Set Mandatory Parameters. */
1850 /***************************************************************************/
1851 bucket->count = count;
1853 /***************************************************************************/
1854 /* Initialize Optional Parameters. */
1855 /***************************************************************************/
1856 evel_init_option_double(&bucket->high_end);
1857 evel_init_option_double(&bucket->low_end);
1864 /**************************************************************************//**
1865 * Set the High End property of the Measurement Latency Bucket.
1867 * @note The property is treated as immutable: it is only valid to call
1868 * the setter once. However, we don't assert if the caller tries to
1869 * overwrite, just ignoring the update instead.
1871 * @param bucket Pointer to the Measurement Latency Bucket.
1872 * @param high_end High end of the bucket's range.
1873 *****************************************************************************/
1874 void evel_meas_latency_bucket_high_end_set(
1875 MEASUREMENT_LATENCY_BUCKET * const bucket,
1876 const double high_end)
1880 /***************************************************************************/
1881 /* Check preconditions. */
1882 /***************************************************************************/
1883 assert(high_end >= 0.0);
1884 evel_set_option_double(&bucket->high_end, high_end, "High End");
1889 /**************************************************************************//**
1890 * Set the Low End property of the Measurement Latency Bucket.
1892 * @note The property is treated as immutable: it is only valid to call
1893 * the setter once. However, we don't assert if the caller tries to
1894 * overwrite, just ignoring the update instead.
1896 * @param bucket Pointer to the Measurement Latency Bucket.
1897 * @param low_end Low end of the bucket's range.
1898 *****************************************************************************/
1899 void evel_meas_latency_bucket_low_end_set(
1900 MEASUREMENT_LATENCY_BUCKET * const bucket,
1901 const double low_end)
1905 /***************************************************************************/
1906 /* Check preconditions. */
1907 /***************************************************************************/
1908 assert(low_end >= 0.0);
1909 evel_set_option_double(&bucket->low_end, low_end, "Low End");
1913 /**************************************************************************//**
1914 * Add an additional Measurement Latency Bucket to the specified event.
1916 * @param measurement Pointer to the Measurement event.
1917 * @param bucket Pointer to the Measurement Latency Bucket to add.
1918 *****************************************************************************/
1919 void evel_meas_latency_bucket_add(EVENT_MEASUREMENT * const measurement,
1920 MEASUREMENT_LATENCY_BUCKET * const bucket)
1924 /***************************************************************************/
1925 /* Check preconditions. */
1926 /***************************************************************************/
1927 assert(measurement != NULL);
1928 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1929 assert(bucket != NULL);
1930 dlist_push_last(&measurement->latency_distribution, bucket);
1935 /**************************************************************************//**
1936 * Add an additional Latency Distribution bucket to the Measurement.
1938 * This function implements the previous API, purely for convenience.
1940 * @param measurement Pointer to the measurement.
1941 * @param low_end Low end of the bucket's range.
1942 * @param high_end High end of the bucket's range.
1943 * @param count Count of events in this bucket.
1944 *****************************************************************************/
1945 void evel_measurement_latency_add(EVENT_MEASUREMENT * const measurement,
1946 const double low_end,
1947 const double high_end,
1950 MEASUREMENT_LATENCY_BUCKET * bucket = NULL;
1954 /***************************************************************************/
1955 /* Trust the assertions in the underlying methods. */
1956 /***************************************************************************/
1957 bucket = evel_new_meas_latency_bucket(count);
1958 evel_meas_latency_bucket_low_end_set(bucket, low_end);
1959 evel_meas_latency_bucket_high_end_set(bucket, high_end);
1960 evel_meas_latency_bucket_add(measurement, bucket);
1965 /**************************************************************************//**
1966 * Create a new vNIC Use to be added to a Measurement event.
1968 * @note The mandatory fields on the ::MEASUREMENT_VNIC_PERFORMANCE must be supplied
1969 * to this factory function and are immutable once set. Optional
1970 * fields have explicit setter functions, but again values may only be
1971 * set once so that the ::MEASUREMENT_VNIC_PERFORMANCE has immutable
1974 * @param vnic_id ASCIIZ string with the vNIC's ID.
1975 * @param val_suspect True or false confidence in data.
1977 * @returns pointer to the newly manufactured ::MEASUREMENT_VNIC_PERFORMANCE.
1978 * If the structure is not used it must be released using
1979 * ::evel_measurement_free_vnic_performance.
1980 * @retval NULL Failed to create the vNIC Use.
1981 *****************************************************************************/
1982 MEASUREMENT_VNIC_PERFORMANCE * evel_measurement_new_vnic_performance(char * const vnic_id,
1983 char * const val_suspect)
1985 MEASUREMENT_VNIC_PERFORMANCE * vnic_performance;
1989 /***************************************************************************/
1990 /* Check preconditions. */
1991 /***************************************************************************/
1992 assert(vnic_id != NULL);
1993 assert(!strcmp(val_suspect,"true") || !strcmp(val_suspect,"false"));
1995 /***************************************************************************/
1996 /* Allocate, then set Mandatory Parameters. */
1997 /***************************************************************************/
1998 EVEL_DEBUG("Adding VNIC ID=%s", vnic_id);
1999 vnic_performance = malloc(sizeof(MEASUREMENT_VNIC_PERFORMANCE));
2000 assert(vnic_performance != NULL);
2001 vnic_performance->vnic_id = strdup(vnic_id);
2002 vnic_performance->valuesaresuspect = strdup(val_suspect);
2004 /***************************************************************************/
2005 /* Initialize Optional Parameters. */
2006 /***************************************************************************/
2007 evel_init_option_double(&vnic_performance-> recvd_bcast_packets_acc);
2008 evel_init_option_double(&vnic_performance-> recvd_bcast_packets_delta);
2009 evel_init_option_double(&vnic_performance-> recvd_discarded_packets_acc);
2010 evel_init_option_double(&vnic_performance-> recvd_discarded_packets_delta);
2011 evel_init_option_double(&vnic_performance-> recvd_error_packets_acc);
2012 evel_init_option_double(&vnic_performance-> recvd_error_packets_delta);
2013 evel_init_option_double(&vnic_performance-> recvd_mcast_packets_acc);
2014 evel_init_option_double(&vnic_performance-> recvd_mcast_packets_delta);
2015 evel_init_option_double(&vnic_performance-> recvd_octets_acc);
2016 evel_init_option_double(&vnic_performance-> recvd_octets_delta);
2017 evel_init_option_double(&vnic_performance-> recvd_total_packets_acc);
2018 evel_init_option_double(&vnic_performance-> recvd_total_packets_delta);
2019 evel_init_option_double(&vnic_performance-> recvd_ucast_packets_acc);
2020 evel_init_option_double(&vnic_performance-> recvd_ucast_packets_delta);
2021 evel_init_option_double(&vnic_performance-> tx_bcast_packets_acc);
2022 evel_init_option_double(&vnic_performance-> tx_bcast_packets_delta);
2023 evel_init_option_double(&vnic_performance-> tx_discarded_packets_acc);
2024 evel_init_option_double(&vnic_performance-> tx_discarded_packets_delta);
2025 evel_init_option_double(&vnic_performance-> tx_error_packets_acc);
2026 evel_init_option_double(&vnic_performance-> tx_error_packets_delta);
2027 evel_init_option_double(&vnic_performance-> tx_mcast_packets_acc);
2028 evel_init_option_double(&vnic_performance-> tx_mcast_packets_delta);
2029 evel_init_option_double(&vnic_performance-> tx_octets_acc);
2030 evel_init_option_double(&vnic_performance-> tx_octets_delta);
2031 evel_init_option_double(&vnic_performance-> tx_total_packets_acc);
2032 evel_init_option_double(&vnic_performance-> tx_total_packets_delta);
2033 evel_init_option_double(&vnic_performance-> tx_ucast_packets_acc);
2034 evel_init_option_double(&vnic_performance-> tx_ucast_packets_delta);
2038 return vnic_performance;
2041 /**************************************************************************//**
2044 * Free off the ::MEASUREMENT_VNIC_PERFORMANCE supplied. Will free all the contained
2047 * @note It does not free the vNIC Use itself, since that may be part of a
2049 *****************************************************************************/
2050 void evel_measurement_free_vnic_performance(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance)
2054 /***************************************************************************/
2055 /* Check preconditions. */
2056 /***************************************************************************/
2057 assert(vnic_performance != NULL);
2058 assert(vnic_performance->vnic_id != NULL);
2059 assert(vnic_performance->valuesaresuspect != NULL);
2061 /***************************************************************************/
2062 /* Free the duplicated string. */
2063 /***************************************************************************/
2064 free(vnic_performance->vnic_id);
2065 free(vnic_performance->valuesaresuspect);
2066 vnic_performance->vnic_id = NULL;
2071 /**************************************************************************//**
2072 * Set the Accumulated Broadcast Packets Received in measurement interval
2073 * property of the vNIC performance.
2075 * @note The property is treated as immutable: it is only valid to call
2076 * the setter once. However, we don't assert if the caller tries to
2077 * overwrite, just ignoring the update instead.
2079 * @param vnic_performance Pointer to the vNIC Use.
2080 * @param recvd_bcast_packets_acc
2081 *****************************************************************************/
2082 void evel_vnic_performance_rx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2083 const double recvd_bcast_packets_acc)
2087 /***************************************************************************/
2088 /* Check preconditions. */
2089 /***************************************************************************/
2090 assert(recvd_bcast_packets_acc >= 0.0);
2092 evel_set_option_double(&vnic_performance->recvd_bcast_packets_acc,
2093 recvd_bcast_packets_acc,
2094 "Broadcast Packets accumulated");
2099 /**************************************************************************//**
2100 * Set the Delta Broadcast Packets Received in measurement interval
2101 * property of the vNIC performance.
2103 * @note The property is treated as immutable: it is only valid to call
2104 * the setter once. However, we don't assert if the caller tries to
2105 * overwrite, just ignoring the update instead.
2107 * @param vnic_performance Pointer to the vNIC Use.
2108 * @param recvd_bcast_packets_delta
2109 *****************************************************************************/
2110 void evel_vnic_performance_rx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2111 const double recvd_bcast_packets_delta)
2115 /***************************************************************************/
2116 /* Check preconditions. */
2117 /***************************************************************************/
2118 assert(recvd_bcast_packets_delta >= 0.0);
2120 evel_set_option_double(&vnic_performance->recvd_bcast_packets_delta,
2121 recvd_bcast_packets_delta,
2122 "Delta Broadcast Packets recieved");
2128 /**************************************************************************//**
2129 * Set the Discarded Packets Received in measurement interval
2130 * property of the vNIC performance.
2132 * @note The property is treated as immutable: it is only valid to call
2133 * the setter once. However, we don't assert if the caller tries to
2134 * overwrite, just ignoring the update instead.
2136 * @param vnic_performance Pointer to the vNIC Use.
2137 * @param recvd_discard_packets_acc
2138 *****************************************************************************/
2139 void evel_vnic_performance_rx_discard_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2140 const double recvd_discard_packets_acc)
2144 /***************************************************************************/
2145 /* Check preconditions. */
2146 /***************************************************************************/
2147 assert(recvd_discard_packets_acc >= 0.0);
2149 evel_set_option_double(&vnic_performance->recvd_discarded_packets_acc,
2150 recvd_discard_packets_acc,
2151 "Discarded Packets accumulated");
2156 /**************************************************************************//**
2157 * Set the Delta Discarded Packets Received in measurement interval
2158 * property of the vNIC performance.
2160 * @note The property is treated as immutable: it is only valid to call
2161 * the setter once. However, we don't assert if the caller tries to
2162 * overwrite, just ignoring the update instead.
2164 * @param vnic_performance Pointer to the vNIC Use.
2165 * @param recvd_discard_packets_delta
2166 *****************************************************************************/
2167 void evel_vnic_performance_rx_discard_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2168 const double recvd_discard_packets_delta)
2172 /***************************************************************************/
2173 /* Check preconditions. */
2174 /***************************************************************************/
2175 assert(recvd_discard_packets_delta >= 0.0);
2177 evel_set_option_double(&vnic_performance->recvd_discarded_packets_delta,
2178 recvd_discard_packets_delta,
2179 "Delta Discarded Packets recieved");
2185 /**************************************************************************//**
2186 * Set the Error Packets Received in measurement interval
2187 * property of the vNIC performance.
2189 * @note The property is treated as immutable: it is only valid to call
2190 * the setter once. However, we don't assert if the caller tries to
2191 * overwrite, just ignoring the update instead.
2193 * @param vnic_performance Pointer to the vNIC Use.
2194 * @param recvd_error_packets_acc
2195 *****************************************************************************/
2196 void evel_vnic_performance_rx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2197 const double recvd_error_packets_acc)
2201 /***************************************************************************/
2202 /* Check preconditions. */
2203 /***************************************************************************/
2204 assert(recvd_error_packets_acc >= 0.0);
2206 evel_set_option_double(&vnic_performance->recvd_error_packets_acc,
2207 recvd_error_packets_acc,
2208 "Error Packets received accumulated");
2213 /**************************************************************************//**
2214 * Set the Delta Error Packets Received in measurement interval
2215 * property of the vNIC performance.
2217 * @note The property is treated as immutable: it is only valid to call
2218 * the setter once. However, we don't assert if the caller tries to
2219 * overwrite, just ignoring the update instead.
2221 * @param vnic_performance Pointer to the vNIC Use.
2222 * @param recvd_error_packets_delta
2223 *****************************************************************************/
2224 void evel_vnic_performance_rx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2225 const double recvd_error_packets_delta)
2229 /***************************************************************************/
2230 /* Check preconditions. */
2231 /***************************************************************************/
2232 assert(recvd_error_packets_delta >= 0.0);
2234 evel_set_option_double(&vnic_performance->recvd_error_packets_delta,
2235 recvd_error_packets_delta,
2236 "Delta Error Packets recieved");
2241 /**************************************************************************//**
2242 * Set the Accumulated Multicast Packets Received in measurement interval
2243 * property of the vNIC performance.
2245 * @note The property is treated as immutable: it is only valid to call
2246 * the setter once. However, we don't assert if the caller tries to
2247 * overwrite, just ignoring the update instead.
2249 * @param vnic_performance Pointer to the vNIC Use.
2250 * @param recvd_mcast_packets_acc
2251 *****************************************************************************/
2252 void evel_vnic_performance_rx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2253 const double recvd_mcast_packets_acc)
2257 /***************************************************************************/
2258 /* Check preconditions. */
2259 /***************************************************************************/
2260 assert(recvd_mcast_packets_acc >= 0.0);
2262 evel_set_option_double(&vnic_performance->recvd_mcast_packets_acc,
2263 recvd_mcast_packets_acc,
2264 "Multicast Packets accumulated");
2269 /**************************************************************************//**
2270 * Set the Delta Multicast Packets Received in measurement interval
2271 * property of the vNIC performance.
2273 * @note The property is treated as immutable: it is only valid to call
2274 * the setter once. However, we don't assert if the caller tries to
2275 * overwrite, just ignoring the update instead.
2277 * @param vnic_performance Pointer to the vNIC Use.
2278 * @param recvd_mcast_packets_delta
2279 *****************************************************************************/
2280 void evel_vnic_performance_rx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2281 const double recvd_mcast_packets_delta)
2285 /***************************************************************************/
2286 /* Check preconditions. */
2287 /***************************************************************************/
2288 assert(recvd_mcast_packets_delta >= 0.0);
2290 evel_set_option_double(&vnic_performance->recvd_mcast_packets_delta,
2291 recvd_mcast_packets_delta,
2292 "Delta Multicast Packets recieved");
2297 /**************************************************************************//**
2298 * Set the Accumulated Octets Received in measurement interval
2299 * property of the vNIC performance.
2301 * @note The property is treated as immutable: it is only valid to call
2302 * the setter once. However, we don't assert if the caller tries to
2303 * overwrite, just ignoring the update instead.
2305 * @param vnic_performance Pointer to the vNIC Use.
2306 * @param recvd_octets_acc
2307 *****************************************************************************/
2308 void evel_vnic_performance_rx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2309 const double recvd_octets_acc)
2313 /***************************************************************************/
2314 /* Check preconditions. */
2315 /***************************************************************************/
2316 assert(recvd_octets_acc >= 0.0);
2318 evel_set_option_double(&vnic_performance->recvd_octets_acc,
2320 "Octets received accumulated");
2325 /**************************************************************************//**
2326 * Set the Delta Octets Received in measurement interval
2327 * property of the vNIC performance.
2329 * @note The property is treated as immutable: it is only valid to call
2330 * the setter once. However, we don't assert if the caller tries to
2331 * overwrite, just ignoring the update instead.
2333 * @param vnic_performance Pointer to the vNIC Use.
2334 * @param recvd_octets_delta
2335 *****************************************************************************/
2336 void evel_vnic_performance_rx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2337 const double recvd_octets_delta)
2341 /***************************************************************************/
2342 /* Check preconditions. */
2343 /***************************************************************************/
2344 assert(recvd_octets_delta >= 0.0);
2346 evel_set_option_double(&vnic_performance->recvd_octets_delta,
2348 "Delta Octets recieved");
2353 /**************************************************************************//**
2354 * Set the Accumulated Total Packets Received in measurement interval
2355 * property of the vNIC performance.
2357 * @note The property is treated as immutable: it is only valid to call
2358 * the setter once. However, we don't assert if the caller tries to
2359 * overwrite, just ignoring the update instead.
2361 * @param vnic_performance Pointer to the vNIC Use.
2362 * @param recvd_total_packets_acc
2363 *****************************************************************************/
2364 void evel_vnic_performance_rx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2365 const double recvd_total_packets_acc)
2369 /***************************************************************************/
2370 /* Check preconditions. */
2371 /***************************************************************************/
2372 assert(recvd_total_packets_acc >= 0.0);
2374 evel_set_option_double(&vnic_performance->recvd_total_packets_acc,
2375 recvd_total_packets_acc,
2376 "Total Packets accumulated");
2381 /**************************************************************************//**
2382 * Set the Delta Total Packets Received in measurement interval
2383 * property of the vNIC performance.
2385 * @note The property is treated as immutable: it is only valid to call
2386 * the setter once. However, we don't assert if the caller tries to
2387 * overwrite, just ignoring the update instead.
2389 * @param vnic_performance Pointer to the vNIC Use.
2390 * @param recvd_total_packets_delta
2391 *****************************************************************************/
2392 void evel_vnic_performance_rx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2393 const double recvd_total_packets_delta)
2397 /***************************************************************************/
2398 /* Check preconditions. */
2399 /***************************************************************************/
2400 assert(recvd_total_packets_delta >= 0.0);
2402 evel_set_option_double(&vnic_performance->recvd_total_packets_delta,
2403 recvd_total_packets_delta,
2404 "Delta Total Packets recieved");
2409 /**************************************************************************//**
2410 * Set the Accumulated Unicast Packets Received in measurement interval
2411 * property of the vNIC performance.
2413 * @note The property is treated as immutable: it is only valid to call
2414 * the setter once. However, we don't assert if the caller tries to
2415 * overwrite, just ignoring the update instead.
2417 * @param vnic_performance Pointer to the vNIC Use.
2418 * @param recvd_ucast_packets_acc
2419 *****************************************************************************/
2420 void evel_vnic_performance_rx_ucast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2421 const double recvd_ucast_packets_acc)
2425 /***************************************************************************/
2426 /* Check preconditions. */
2427 /***************************************************************************/
2428 assert(recvd_ucast_packets_acc >= 0.0);
2430 evel_set_option_double(&vnic_performance->recvd_ucast_packets_acc,
2431 recvd_ucast_packets_acc,
2432 "Unicast Packets received accumulated");
2437 /**************************************************************************//**
2438 * Set the Delta Unicast packets Received in measurement interval
2439 * property of the vNIC performance.
2441 * @note The property is treated as immutable: it is only valid to call
2442 * the setter once. However, we don't assert if the caller tries to
2443 * overwrite, just ignoring the update instead.
2445 * @param vnic_performance Pointer to the vNIC Use.
2446 * @param recvd_ucast_packets_delta
2447 *****************************************************************************/
2448 void evel_vnic_performance_rx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2449 const double recvd_ucast_packets_delta)
2453 /***************************************************************************/
2454 /* Check preconditions. */
2455 /***************************************************************************/
2456 assert(recvd_ucast_packets_delta >= 0.0);
2458 evel_set_option_double(&vnic_performance->recvd_ucast_packets_delta,
2459 recvd_ucast_packets_delta,
2460 "Delta Unicast packets recieved");
2465 /**************************************************************************//**
2466 * Set the Transmitted Broadcast Packets in measurement interval
2467 * property of the vNIC performance.
2469 * @note The property is treated as immutable: it is only valid to call
2470 * the setter once. However, we don't assert if the caller tries to
2471 * overwrite, just ignoring the update instead.
2473 * @param vnic_performance Pointer to the vNIC Use.
2474 * @param tx_bcast_packets_acc
2475 *****************************************************************************/
2476 void evel_vnic_performance_tx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2477 const double tx_bcast_packets_acc)
2481 /***************************************************************************/
2482 /* Check preconditions. */
2483 /***************************************************************************/
2484 assert(tx_bcast_packets_acc >= 0.0);
2486 evel_set_option_double(&vnic_performance->tx_bcast_packets_acc,
2487 tx_bcast_packets_acc,
2488 "Transmitted Broadcast Packets accumulated");
2493 /**************************************************************************//**
2494 * Set the Delta Broadcast packets Transmitted in measurement interval
2495 * property of the vNIC performance.
2497 * @note The property is treated as immutable: it is only valid to call
2498 * the setter once. However, we don't assert if the caller tries to
2499 * overwrite, just ignoring the update instead.
2501 * @param vnic_performance Pointer to the vNIC Use.
2502 * @param tx_bcast_packets_delta
2503 *****************************************************************************/
2504 void evel_vnic_performance_tx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2505 const double tx_bcast_packets_delta)
2509 /***************************************************************************/
2510 /* Check preconditions. */
2511 /***************************************************************************/
2512 assert(tx_bcast_packets_delta >= 0.0);
2514 evel_set_option_double(&vnic_performance->tx_bcast_packets_delta,
2515 tx_bcast_packets_delta,
2516 "Delta Transmitted Broadcast packets ");
2521 /**************************************************************************//**
2522 * Set the Transmitted Discarded Packets in measurement interval
2523 * property of the vNIC performance.
2525 * @note The property is treated as immutable: it is only valid to call
2526 * the setter once. However, we don't assert if the caller tries to
2527 * overwrite, just ignoring the update instead.
2529 * @param vnic_performance Pointer to the vNIC Use.
2530 * @param tx_discarded_packets_acc
2531 *****************************************************************************/
2532 void evel_vnic_performance_tx_discarded_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2533 const double tx_discarded_packets_acc)
2537 /***************************************************************************/
2538 /* Check preconditions. */
2539 /***************************************************************************/
2540 assert(tx_discarded_packets_acc >= 0.0);
2542 evel_set_option_double(&vnic_performance->tx_discarded_packets_acc,
2543 tx_discarded_packets_acc,
2544 "Transmitted Discarded Packets accumulated");
2549 /**************************************************************************//**
2550 * Set the Delta Discarded packets Transmitted in measurement interval
2551 * property of the vNIC performance.
2553 * @note The property is treated as immutable: it is only valid to call
2554 * the setter once. However, we don't assert if the caller tries to
2555 * overwrite, just ignoring the update instead.
2557 * @param vnic_performance Pointer to the vNIC Use.
2558 * @param tx_discarded_packets_delta
2559 *****************************************************************************/
2560 void evel_vnic_performance_tx_discarded_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2561 const double tx_discarded_packets_delta)
2565 /***************************************************************************/
2566 /* Check preconditions. */
2567 /***************************************************************************/
2568 assert(tx_discarded_packets_delta >= 0.0);
2570 evel_set_option_double(&vnic_performance->tx_discarded_packets_delta,
2571 tx_discarded_packets_delta,
2572 "Delta Transmitted Discarded packets ");
2577 /**************************************************************************//**
2578 * Set the Transmitted Errored Packets in measurement interval
2579 * property of the vNIC performance.
2581 * @note The property is treated as immutable: it is only valid to call
2582 * the setter once. However, we don't assert if the caller tries to
2583 * overwrite, just ignoring the update instead.
2585 * @param vnic_performance Pointer to the vNIC Use.
2586 * @param tx_error_packets_acc
2587 *****************************************************************************/
2588 void evel_vnic_performance_tx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2589 const double tx_error_packets_acc)
2593 /***************************************************************************/
2594 /* Check preconditions. */
2595 /***************************************************************************/
2596 assert(tx_error_packets_acc >= 0.0);
2598 evel_set_option_double(&vnic_performance->tx_error_packets_acc,
2599 tx_error_packets_acc,
2600 "Transmitted Error Packets accumulated");
2605 /**************************************************************************//**
2606 * Set the Delta Errored packets Transmitted in measurement interval
2607 * property of the vNIC performance.
2609 * @note The property is treated as immutable: it is only valid to call
2610 * the setter once. However, we don't assert if the caller tries to
2611 * overwrite, just ignoring the update instead.
2613 * @param vnic_performance Pointer to the vNIC Use.
2614 * @param tx_error_packets_delta
2615 *****************************************************************************/
2616 void evel_vnic_performance_tx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2617 const double tx_error_packets_delta)
2621 /***************************************************************************/
2622 /* Check preconditions. */
2623 /***************************************************************************/
2624 assert(tx_error_packets_delta >= 0.0);
2626 evel_set_option_double(&vnic_performance->tx_error_packets_delta,
2627 tx_error_packets_delta,
2628 "Delta Transmitted Error packets ");
2633 /**************************************************************************//**
2634 * Set the Transmitted Multicast Packets in measurement interval
2635 * property of the vNIC performance.
2637 * @note The property is treated as immutable: it is only valid to call
2638 * the setter once. However, we don't assert if the caller tries to
2639 * overwrite, just ignoring the update instead.
2641 * @param vnic_performance Pointer to the vNIC Use.
2642 * @param tx_mcast_packets_acc
2643 *****************************************************************************/
2644 void evel_vnic_performance_tx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2645 const double tx_mcast_packets_acc)
2649 /***************************************************************************/
2650 /* Check preconditions. */
2651 /***************************************************************************/
2652 assert(tx_mcast_packets_acc >= 0.0);
2654 evel_set_option_double(&vnic_performance->tx_mcast_packets_acc,
2655 tx_mcast_packets_acc,
2656 "Transmitted Multicast Packets accumulated");
2661 /**************************************************************************//**
2662 * Set the Delta Multicast packets Transmitted in measurement interval
2663 * property of the vNIC performance.
2665 * @note The property is treated as immutable: it is only valid to call
2666 * the setter once. However, we don't assert if the caller tries to
2667 * overwrite, just ignoring the update instead.
2669 * @param vnic_performance Pointer to the vNIC Use.
2670 * @param tx_mcast_packets_delta
2671 *****************************************************************************/
2672 void evel_vnic_performance_tx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2673 const double tx_mcast_packets_delta)
2677 /***************************************************************************/
2678 /* Check preconditions. */
2679 /***************************************************************************/
2680 assert(tx_mcast_packets_delta >= 0.0);
2682 evel_set_option_double(&vnic_performance->tx_mcast_packets_delta,
2683 tx_mcast_packets_delta,
2684 "Delta Transmitted Multicast packets ");
2689 /**************************************************************************//**
2690 * Set the Transmitted Octets in measurement interval
2691 * property of the vNIC performance.
2693 * @note The property is treated as immutable: it is only valid to call
2694 * the setter once. However, we don't assert if the caller tries to
2695 * overwrite, just ignoring the update instead.
2697 * @param vnic_performance Pointer to the vNIC Use.
2698 * @param tx_octets_acc
2699 *****************************************************************************/
2700 void evel_vnic_performance_tx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2701 const double tx_octets_acc)
2705 /***************************************************************************/
2706 /* Check preconditions. */
2707 /***************************************************************************/
2708 assert(tx_octets_acc >= 0.0);
2710 evel_set_option_double(&vnic_performance->tx_octets_acc,
2712 "Transmitted Octets accumulated");
2717 /**************************************************************************//**
2718 * Set the Delta Octets Transmitted in measurement interval
2719 * property of the vNIC performance.
2721 * @note The property is treated as immutable: it is only valid to call
2722 * the setter once. However, we don't assert if the caller tries to
2723 * overwrite, just ignoring the update instead.
2725 * @param vnic_performance Pointer to the vNIC Use.
2726 * @param tx_octets_delta
2727 *****************************************************************************/
2728 void evel_vnic_performance_tx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2729 const double tx_octets_delta)
2733 /***************************************************************************/
2734 /* Check preconditions. */
2735 /***************************************************************************/
2736 assert(tx_octets_delta >= 0.0);
2738 evel_set_option_double(&vnic_performance->tx_octets_delta,
2740 "Delta Transmitted Octets ");
2746 /**************************************************************************//**
2747 * Set the Transmitted Total Packets in measurement interval
2748 * property of the vNIC performance.
2750 * @note The property is treated as immutable: it is only valid to call
2751 * the setter once. However, we don't assert if the caller tries to
2752 * overwrite, just ignoring the update instead.
2754 * @param vnic_performance Pointer to the vNIC Use.
2755 * @param tx_total_packets_acc
2756 *****************************************************************************/
2757 void evel_vnic_performance_tx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2758 const double tx_total_packets_acc)
2762 /***************************************************************************/
2763 /* Check preconditions. */
2764 /***************************************************************************/
2765 assert(tx_total_packets_acc >= 0.0);
2767 evel_set_option_double(&vnic_performance->tx_total_packets_acc,
2768 tx_total_packets_acc,
2769 "Transmitted Total Packets accumulated");
2774 /**************************************************************************//**
2775 * Set the Delta Total Packets Transmitted in measurement interval
2776 * property of the vNIC performance.
2778 * @note The property is treated as immutable: it is only valid to call
2779 * the setter once. However, we don't assert if the caller tries to
2780 * overwrite, just ignoring the update instead.
2782 * @param vnic_performance Pointer to the vNIC Use.
2783 * @param tx_total_packets_delta
2784 *****************************************************************************/
2785 void evel_vnic_performance_tx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2786 const double tx_total_packets_delta)
2790 /***************************************************************************/
2791 /* Check preconditions. */
2792 /***************************************************************************/
2793 assert(tx_total_packets_delta >= 0.0);
2795 evel_set_option_double(&vnic_performance->tx_total_packets_delta,
2796 tx_total_packets_delta,
2797 "Delta Transmitted Total Packets ");
2803 /**************************************************************************//**
2804 * Set the Transmitted Unicast Packets in measurement interval
2805 * property of the vNIC performance.
2807 * @note The property is treated as immutable: it is only valid to call
2808 * the setter once. However, we don't assert if the caller tries to
2809 * overwrite, just ignoring the update instead.
2811 * @param vnic_performance Pointer to the vNIC Use.
2812 * @param tx_ucast_packets_acc
2813 *****************************************************************************/
2814 void evel_vnic_performance_tx_ucast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2815 const double tx_ucast_packets_acc)
2819 /***************************************************************************/
2820 /* Check preconditions. */
2821 /***************************************************************************/
2822 assert(tx_ucast_packets_acc >= 0.0);
2824 evel_set_option_double(&vnic_performance->tx_ucast_packets_acc,
2825 tx_ucast_packets_acc,
2826 "Transmitted Unicast Packets accumulated");
2831 /**************************************************************************//**
2832 * Set the Delta Octets Transmitted in measurement interval
2833 * property of the vNIC performance.
2835 * @note The property is treated as immutable: it is only valid to call
2836 * the setter once. However, we don't assert if the caller tries to
2837 * overwrite, just ignoring the update instead.
2839 * @param vnic_performance Pointer to the vNIC Use.
2840 * @param tx_ucast_packets_delta
2841 *****************************************************************************/
2842 void evel_vnic_performance_tx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2843 const double tx_ucast_packets_delta)
2847 /***************************************************************************/
2848 /* Check preconditions. */
2849 /***************************************************************************/
2850 assert(tx_ucast_packets_delta >= 0.0);
2852 evel_set_option_double(&vnic_performance->tx_ucast_packets_delta,
2853 tx_ucast_packets_delta,
2854 "Delta Transmitted Unicast Packets ");
2860 /**************************************************************************//**
2861 * Add an additional vNIC Use to the specified Measurement event.
2863 * @param measurement Pointer to the measurement.
2864 * @param vnic_performance Pointer to the vNIC Use to add.
2865 *****************************************************************************/
2866 void evel_meas_vnic_performance_add(EVENT_MEASUREMENT * const measurement,
2867 MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance)
2871 /***************************************************************************/
2872 /* Check preconditions. */
2873 /***************************************************************************/
2874 assert(measurement != NULL);
2875 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
2876 assert(vnic_performance != NULL);
2878 dlist_push_last(&measurement->vnic_usage, vnic_performance);
2883 /**************************************************************************//**
2884 * Add an additional vNIC usage record Measurement.
2886 * This function implements the previous API, purely for convenience.
2888 * The ID is null delimited ASCII string. The library takes a copy so the
2889 * caller does not have to preserve values after the function returns.
2891 * @param measurement Pointer to the measurement.
2892 * @param vnic_id ASCIIZ string with the vNIC's ID.
2893 * @param valset true or false confidence level
2894 * @param recvd_bcast_packets_acc Recieved broadcast packets
2895 * @param recvd_bcast_packets_delta Received delta broadcast packets
2896 * @param recvd_discarded_packets_acc Recieved discarded packets
2897 * @param recvd_discarded_packets_delta Received discarded delta packets
2898 * @param recvd_error_packets_acc Received error packets
2899 * @param recvd_error_packets_delta, Received delta error packets
2900 * @param recvd_mcast_packets_acc Received multicast packets
2901 * @param recvd_mcast_packets_delta Received delta multicast packets
2902 * @param recvd_octets_acc Received octets
2903 * @param recvd_octets_delta Received delta octets
2904 * @param recvd_total_packets_acc Received total packets
2905 * @param recvd_total_packets_delta Received delta total packets
2906 * @param recvd_ucast_packets_acc Received Unicast packets
2907 * @param recvd_ucast_packets_delta Received delta unicast packets
2908 * @param tx_bcast_packets_acc Transmitted broadcast packets
2909 * @param tx_bcast_packets_delta Transmitted delta broadcast packets
2910 * @param tx_discarded_packets_acc Transmitted packets discarded
2911 * @param tx_discarded_packets_delta Transmitted delta discarded packets
2912 * @param tx_error_packets_acc Transmitted error packets
2913 * @param tx_error_packets_delta Transmitted delta error packets
2914 * @param tx_mcast_packets_acc Transmitted multicast packets accumulated
2915 * @param tx_mcast_packets_delta Transmitted delta multicast packets
2916 * @param tx_octets_acc Transmitted octets
2917 * @param tx_octets_delta Transmitted delta octets
2918 * @param tx_total_packets_acc Transmitted total packets
2919 * @param tx_total_packets_delta Transmitted delta total packets
2920 * @param tx_ucast_packets_acc Transmitted Unicast packets
2921 * @param tx_ucast_packets_delta Transmitted delta Unicast packets
2922 *****************************************************************************/
2923 void evel_measurement_vnic_performance_add(EVENT_MEASUREMENT * const measurement,
2924 char * const vnic_id,
2926 double recvd_bcast_packets_acc,
2927 double recvd_bcast_packets_delta,
2928 double recvd_discarded_packets_acc,
2929 double recvd_discarded_packets_delta,
2930 double recvd_error_packets_acc,
2931 double recvd_error_packets_delta,
2932 double recvd_mcast_packets_acc,
2933 double recvd_mcast_packets_delta,
2934 double recvd_octets_acc,
2935 double recvd_octets_delta,
2936 double recvd_total_packets_acc,
2937 double recvd_total_packets_delta,
2938 double recvd_ucast_packets_acc,
2939 double recvd_ucast_packets_delta,
2940 double tx_bcast_packets_acc,
2941 double tx_bcast_packets_delta,
2942 double tx_discarded_packets_acc,
2943 double tx_discarded_packets_delta,
2944 double tx_error_packets_acc,
2945 double tx_error_packets_delta,
2946 double tx_mcast_packets_acc,
2947 double tx_mcast_packets_delta,
2948 double tx_octets_acc,
2949 double tx_octets_delta,
2950 double tx_total_packets_acc,
2951 double tx_total_packets_delta,
2952 double tx_ucast_packets_acc,
2953 double tx_ucast_packets_delta)
2955 MEASUREMENT_VNIC_PERFORMANCE * vnic_performance = NULL;
2958 /***************************************************************************/
2959 /* Trust the assertions in the underlying methods. */
2960 /***************************************************************************/
2961 vnic_performance = evel_measurement_new_vnic_performance(vnic_id, valset);
2963 evel_vnic_performance_rx_bcast_pkt_acc_set(vnic_performance, recvd_bcast_packets_acc);
2964 evel_vnic_performance_rx_bcast_pkt_delta_set(vnic_performance, recvd_bcast_packets_delta);
2965 evel_vnic_performance_rx_discard_pkt_acc_set(vnic_performance, recvd_discarded_packets_acc);
2966 evel_vnic_performance_rx_discard_pkt_delta_set(vnic_performance, recvd_discarded_packets_delta);
2967 evel_vnic_performance_rx_error_pkt_acc_set(vnic_performance, recvd_error_packets_acc);
2968 evel_vnic_performance_rx_error_pkt_delta_set(vnic_performance, recvd_error_packets_delta);
2969 evel_vnic_performance_rx_mcast_pkt_acc_set(vnic_performance, recvd_mcast_packets_acc);
2970 evel_vnic_performance_rx_mcast_pkt_delta_set(vnic_performance, recvd_mcast_packets_delta);
2971 evel_vnic_performance_rx_octets_acc_set(vnic_performance, recvd_octets_acc);
2972 evel_vnic_performance_rx_octets_delta_set(vnic_performance, recvd_octets_delta);
2973 evel_vnic_performance_rx_total_pkt_acc_set(vnic_performance, recvd_total_packets_acc);
2974 evel_vnic_performance_rx_total_pkt_delta_set(vnic_performance, recvd_total_packets_delta);
2975 evel_vnic_performance_rx_ucast_pkt_acc_set(vnic_performance, recvd_ucast_packets_acc);
2976 evel_vnic_performance_rx_ucast_pkt_delta_set(vnic_performance, recvd_ucast_packets_delta);
2977 evel_vnic_performance_tx_bcast_pkt_acc_set(vnic_performance, tx_bcast_packets_acc);
2978 evel_vnic_performance_tx_bcast_pkt_delta_set(vnic_performance, tx_bcast_packets_delta);
2979 evel_vnic_performance_tx_discarded_pkt_acc_set(vnic_performance, tx_discarded_packets_acc);
2980 evel_vnic_performance_tx_discarded_pkt_delta_set(vnic_performance, tx_discarded_packets_delta);
2981 evel_vnic_performance_tx_error_pkt_acc_set(vnic_performance, tx_error_packets_acc);
2982 evel_vnic_performance_tx_error_pkt_delta_set(vnic_performance, tx_error_packets_delta);
2983 evel_vnic_performance_tx_mcast_pkt_acc_set(vnic_performance, tx_mcast_packets_acc);
2984 evel_vnic_performance_tx_mcast_pkt_delta_set(vnic_performance, tx_mcast_packets_delta);
2985 evel_vnic_performance_tx_octets_acc_set(vnic_performance, tx_octets_acc);
2986 evel_vnic_performance_tx_octets_delta_set(vnic_performance, tx_octets_delta);
2987 evel_vnic_performance_tx_total_pkt_acc_set(vnic_performance, tx_total_packets_acc);
2988 evel_vnic_performance_tx_total_pkt_delta_set(vnic_performance, tx_total_packets_delta);
2989 evel_vnic_performance_tx_ucast_pkt_acc_set(vnic_performance, tx_ucast_packets_acc);
2990 evel_vnic_performance_tx_ucast_pkt_delta_set(vnic_performance, tx_ucast_packets_delta);
2991 evel_meas_vnic_performance_add(measurement, vnic_performance);
2994 /**************************************************************************//**
2995 * Encode the measurement as a JSON measurement.
2997 * @param jbuf Pointer to the ::EVEL_JSON_BUFFER to encode into.
2998 * @param event Pointer to the ::EVENT_HEADER to encode.
2999 *****************************************************************************/
3000 void evel_json_encode_measurement(EVEL_JSON_BUFFER * jbuf,
3001 EVENT_MEASUREMENT * event)
3003 MEASUREMENT_CPU_USE * cpu_use = NULL;
3004 MEASUREMENT_MEM_USE * mem_use = NULL;
3005 MEASUREMENT_DISK_USE * disk_use = NULL;
3006 MEASUREMENT_FSYS_USE * fsys_use = NULL;
3007 MEASUREMENT_LATENCY_BUCKET * bucket = NULL;
3008 MEASUREMENT_VNIC_PERFORMANCE * vnic_performance = NULL;
3009 MEASUREMENT_ERRORS * errors = NULL;
3010 MEASUREMENT_FEATURE_USE * feature_use = NULL;
3011 MEASUREMENT_CODEC_USE * codec_use = NULL;
3012 MEASUREMENT_GROUP * measurement_group = NULL;
3013 CUSTOM_MEASUREMENT * custom_measurement = NULL;
3014 DLIST_ITEM * item = NULL;
3015 DLIST_ITEM * nested_item = NULL;
3016 DLIST_ITEM * addl_info_item = NULL;
3017 OTHER_FIELD *addl_info = NULL;
3021 /***************************************************************************/
3022 /* Check preconditions. */
3023 /***************************************************************************/
3024 assert(event != NULL);
3025 assert(event->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
3027 evel_json_encode_header(jbuf, &event->header);
3028 evel_json_open_named_object(jbuf, "measurementsForVfScalingFields");
3030 /***************************************************************************/
3031 /* Mandatory fields. */
3032 /***************************************************************************/
3033 evel_enc_kv_int(jbuf, "measurementInterval", event->measurement_interval);
3035 /***************************************************************************/
3036 /* Optional fields. */
3037 /***************************************************************************/
3038 // additional fields
3039 evel_json_checkpoint(jbuf);
3040 if (evel_json_open_opt_named_list(jbuf, "additionalFields"))
3042 bool item_added = false;
3044 addl_info_item = dlist_get_first(&event->additional_info);
3045 while (addl_info_item != NULL)
3047 addl_info = (OTHER_FIELD*) addl_info_item->item;
3048 assert(addl_info != NULL);
3050 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3054 evel_json_open_object(jbuf);
3055 evel_enc_kv_string(jbuf, "name", addl_info->name);
3056 evel_enc_kv_string(jbuf, "value", addl_info->value);
3057 evel_json_close_object(jbuf);
3060 addl_info_item = dlist_get_next(addl_info_item);
3062 evel_json_close_list(jbuf);
3064 /*************************************************************************/
3065 /* If we've not written anything, rewind to before we opened the list. */
3066 /*************************************************************************/
3069 evel_json_rewind(jbuf);
3073 // TBD additional json objects
3074 evel_enc_kv_opt_int(jbuf, "concurrentSessions", &event->concurrent_sessions);
3075 evel_enc_kv_opt_int(jbuf, "configuredEntities", &event->configured_entities);
3077 /***************************************************************************/
3079 /***************************************************************************/
3080 evel_json_checkpoint(jbuf);
3081 if (evel_json_open_opt_named_list(jbuf, "cpuUsageArray"))
3083 bool item_added = false;
3085 item = dlist_get_first(&event->cpu_usage);
3086 while (item != NULL)
3088 cpu_use = (MEASUREMENT_CPU_USE*) item->item;
3089 assert(cpu_use != NULL);
3091 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3095 evel_json_open_object(jbuf);
3096 evel_enc_kv_string(jbuf, "cpuIdentifier", cpu_use->id);
3097 evel_enc_kv_opt_double(jbuf, "cpuIdle", &cpu_use->idle);
3098 evel_enc_kv_opt_double(jbuf, "cpuUsageInterrupt", &cpu_use->intrpt);
3099 evel_enc_kv_opt_double(jbuf, "cpuUsageNice", &cpu_use->nice);
3100 evel_enc_kv_opt_double(jbuf, "cpuUsageSoftIrq", &cpu_use->softirq);
3101 evel_enc_kv_opt_double(jbuf, "cpuUsageSteal", &cpu_use->steal);
3102 evel_enc_kv_opt_double(jbuf, "cpuUsageSystem", &cpu_use->sys);
3103 evel_enc_kv_opt_double(jbuf, "cpuUsageUser", &cpu_use->user);
3104 evel_enc_kv_opt_double(jbuf, "cpuWait", &cpu_use->wait);
3105 evel_enc_kv_double(jbuf, "percentUsage",cpu_use->usage);
3106 evel_json_close_object(jbuf);
3109 item = dlist_get_next(item);
3111 evel_json_close_list(jbuf);
3113 /*************************************************************************/
3114 /* If we've not written anything, rewind to before we opened the list. */
3115 /*************************************************************************/
3118 evel_json_rewind(jbuf);
3123 /***************************************************************************/
3124 /* Disk Use list. */
3125 /***************************************************************************/
3126 evel_json_checkpoint(jbuf);
3127 if (evel_json_open_opt_named_list(jbuf, "diskUsageArray"))
3129 bool item_added = false;
3131 item = dlist_get_first(&event->disk_usage);
3132 while (item != NULL)
3134 disk_use = (MEASUREMENT_DISK_USE*) item->item;
3135 assert(disk_use != NULL);
3137 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3141 evel_json_open_object(jbuf);
3142 evel_enc_kv_string(jbuf, "diskIdentifier", disk_use->id);
3143 evel_enc_kv_opt_double(jbuf, "diskIoTimeAvg", &disk_use->iotimeavg);
3144 evel_enc_kv_opt_double(jbuf, "diskIoTimeLast", &disk_use->iotimelast);
3145 evel_enc_kv_opt_double(jbuf, "diskIoTimeMax", &disk_use->iotimemax);
3146 evel_enc_kv_opt_double(jbuf, "diskIoTimeMin", &disk_use->iotimemin);
3147 evel_enc_kv_opt_double(jbuf, "diskMergedReadAvg", &disk_use->mergereadavg);
3148 evel_enc_kv_opt_double(jbuf, "diskMergedReadLast", &disk_use->mergereadlast);
3149 evel_enc_kv_opt_double(jbuf, "diskMergedReadMax", &disk_use->mergereadmax);
3150 evel_enc_kv_opt_double(jbuf, "diskMergedReadMin", &disk_use->mergereadmin);
3151 evel_enc_kv_opt_double(jbuf, "diskMergedWriteAvg", &disk_use->mergewriteavg);
3152 evel_enc_kv_opt_double(jbuf, "diskMergedWriteLast", &disk_use->mergewritelast);
3153 evel_enc_kv_opt_double(jbuf, "diskMergedWriteMax", &disk_use->mergewritemax);
3154 evel_enc_kv_opt_double(jbuf, "diskMergedWriteMin", &disk_use->mergewritemin);
3155 evel_enc_kv_opt_double(jbuf, "diskOctetsReadAvg", &disk_use->octetsreadavg);
3156 evel_enc_kv_opt_double(jbuf, "diskOctetsReadLast", &disk_use->octetsreadlast);
3157 evel_enc_kv_opt_double(jbuf, "diskOctetsReadMax", &disk_use->octetsreadmax);
3158 evel_enc_kv_opt_double(jbuf, "diskOctetsReadMin", &disk_use->octetsreadmin);
3159 evel_enc_kv_opt_double(jbuf, "diskOctetsWriteAvg", &disk_use->octetswriteavg);
3160 evel_enc_kv_opt_double(jbuf, "diskOctetsWriteLast", &disk_use->octetswritelast);
3161 evel_enc_kv_opt_double(jbuf, "diskOctetsWriteMax", &disk_use->octetswritemax);
3162 evel_enc_kv_opt_double(jbuf, "diskOctetsWriteMin", &disk_use->octetswritemin);
3163 evel_enc_kv_opt_double(jbuf, "diskOpsReadAvg", &disk_use->opsreadavg);
3164 evel_enc_kv_opt_double(jbuf, "diskOpsReadLast", &disk_use->opsreadlast);
3165 evel_enc_kv_opt_double(jbuf, "diskOpsReadMax", &disk_use->opsreadmax);
3166 evel_enc_kv_opt_double(jbuf, "diskOpsReadMin", &disk_use->opsreadmin);
3167 evel_enc_kv_opt_double(jbuf, "diskOpsWriteAvg", &disk_use->opswriteavg);
3168 evel_enc_kv_opt_double(jbuf, "diskOpsWriteLast", &disk_use->opswritelast);
3169 evel_enc_kv_opt_double(jbuf, "diskOpsWriteMax", &disk_use->opswritemax);
3170 evel_enc_kv_opt_double(jbuf, "diskOpsWriteMin", &disk_use->opswritemin);
3171 evel_enc_kv_opt_double(jbuf, "diskPendingOperationsAvg", &disk_use->pendingopsavg);
3172 evel_enc_kv_opt_double(jbuf, "diskPendingOperationsLast", &disk_use->pendingopslast);
3173 evel_enc_kv_opt_double(jbuf, "diskPendingOperationsMax", &disk_use->pendingopsmax);
3174 evel_enc_kv_opt_double(jbuf, "diskPendingOperationsMin", &disk_use->pendingopsmin);
3175 evel_enc_kv_opt_double(jbuf, "diskTimeReadAvg", &disk_use->timereadavg);
3176 evel_enc_kv_opt_double(jbuf, "diskTimeReadLast", &disk_use->timereadlast);
3177 evel_enc_kv_opt_double(jbuf, "diskTimeReadMax", &disk_use->timereadmax);
3178 evel_enc_kv_opt_double(jbuf, "diskTimeReadMin", &disk_use->timereadmin);
3179 evel_enc_kv_opt_double(jbuf, "diskTimeWriteAvg", &disk_use->timewriteavg);
3180 evel_enc_kv_opt_double(jbuf, "diskTimeWriteLast", &disk_use->timewritelast);
3181 evel_enc_kv_opt_double(jbuf, "diskTimeWriteMax", &disk_use->timewritemax);
3182 evel_enc_kv_opt_double(jbuf, "diskTimeWriteMin", &disk_use->timewritemin);
3183 evel_json_close_object(jbuf);
3186 item = dlist_get_next(item);
3188 evel_json_close_list(jbuf);
3190 /*************************************************************************/
3191 /* If we've not written anything, rewind to before we opened the list. */
3192 /*************************************************************************/
3195 evel_json_rewind(jbuf);
3199 /***************************************************************************/
3200 /* Filesystem Usage list. */
3201 /***************************************************************************/
3202 evel_json_checkpoint(jbuf);
3203 if (evel_json_open_opt_named_list(jbuf, "filesystemUsageArray"))
3205 bool item_added = false;
3207 item = dlist_get_first(&event->filesystem_usage);
3208 while (item != NULL)
3210 fsys_use = (MEASUREMENT_FSYS_USE *) item->item;
3211 assert(fsys_use != NULL);
3213 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3214 "filesystemUsageArray",
3215 fsys_use->filesystem_name))
3217 evel_json_open_object(jbuf);
3219 jbuf, "blockConfigured", fsys_use->block_configured);
3220 evel_enc_kv_int(jbuf, "blockIops", fsys_use->block_iops);
3221 evel_enc_kv_double(jbuf, "blockUsed", fsys_use->block_used);
3223 jbuf, "ephemeralConfigured", fsys_use->ephemeral_configured);
3224 evel_enc_kv_int(jbuf, "ephemeralIops", fsys_use->ephemeral_iops);
3225 evel_enc_kv_double(jbuf, "ephemeralUsed", fsys_use->ephemeral_used);
3226 evel_enc_kv_string(jbuf, "filesystemName", fsys_use->filesystem_name);
3227 evel_json_close_object(jbuf);
3230 item = dlist_get_next(item);
3232 evel_json_close_list(jbuf);
3234 /*************************************************************************/
3235 /* If we've not written anything, rewind to before we opened the list. */
3236 /*************************************************************************/
3239 evel_json_rewind(jbuf);
3243 /***************************************************************************/
3244 /* Latency distribution. */
3245 /***************************************************************************/
3246 item = dlist_get_first(&event->latency_distribution);
3247 if ((item != NULL) &&
3248 evel_json_open_opt_named_list(jbuf, "latencyDistribution"))
3250 while (item != NULL)
3252 bucket = (MEASUREMENT_LATENCY_BUCKET*) item->item;
3253 assert(bucket != NULL);
3255 evel_json_open_object(jbuf);
3256 evel_enc_kv_opt_double(
3257 jbuf, "lowEndOfLatencyBucket", &bucket->low_end);
3258 evel_enc_kv_opt_double(
3259 jbuf, "highEndOfLatencyBucket", &bucket->high_end);
3260 evel_enc_kv_int(jbuf, "countsInTheBucket", bucket->count);
3261 evel_json_close_object(jbuf);
3262 item = dlist_get_next(item);
3264 evel_json_close_list(jbuf);
3267 evel_enc_kv_opt_double(
3268 jbuf, "meanRequestLatency", &event->mean_request_latency);
3269 evel_enc_kv_opt_int(jbuf, "requestRate", &event->request_rate);
3271 /***************************************************************************/
3272 /* vNIC Usage TBD Performance array */
3273 /***************************************************************************/
3274 evel_json_checkpoint(jbuf);
3275 if (evel_json_open_opt_named_list(jbuf, "vNicUsageArray"))
3277 bool item_added = false;
3279 item = dlist_get_first(&event->vnic_usage);
3280 while (item != NULL)
3282 vnic_performance = (MEASUREMENT_VNIC_PERFORMANCE *) item->item;
3283 assert(vnic_performance != NULL);
3285 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3286 "vNicPerformanceArray",
3287 vnic_performance->vnic_id))
3289 evel_json_open_object(jbuf);
3291 /*********************************************************************/
3292 /* Optional fields. */
3293 /*********************************************************************/
3294 evel_enc_kv_opt_double( jbuf,
3295 "receivedBroadcastPacketsAccumulated", &vnic_performance->recvd_bcast_packets_acc);
3296 evel_enc_kv_opt_double( jbuf,
3297 "receivedBroadcastPacketsDelta", &vnic_performance->recvd_bcast_packets_delta);
3298 evel_enc_kv_opt_double( jbuf,
3299 "receivedDiscardedPacketsAccumulated", &vnic_performance->recvd_discarded_packets_acc);
3300 evel_enc_kv_opt_double( jbuf,
3301 "receivedDiscardedPacketsDelta", &vnic_performance->recvd_discarded_packets_delta);
3302 evel_enc_kv_opt_double( jbuf,
3303 "receivedErrorPacketsAccumulated", &vnic_performance->recvd_error_packets_acc);
3304 evel_enc_kv_opt_double( jbuf,
3305 "receivedErrorPacketsDelta", &vnic_performance->recvd_error_packets_delta);
3306 evel_enc_kv_opt_double( jbuf,
3307 "receivedMulticastPacketsAccumulated", &vnic_performance->recvd_mcast_packets_acc);
3308 evel_enc_kv_opt_double( jbuf,
3309 "receivedMulticastPacketsDelta", &vnic_performance->recvd_mcast_packets_delta);
3310 evel_enc_kv_opt_double( jbuf,
3311 "receivedOctetsAccumulated", &vnic_performance->recvd_octets_acc);
3312 evel_enc_kv_opt_double( jbuf,
3313 "receivedOctetsDelta", &vnic_performance->recvd_octets_delta);
3314 evel_enc_kv_opt_double( jbuf,
3315 "receivedTotalPacketsAccumulated", &vnic_performance->recvd_total_packets_acc);
3316 evel_enc_kv_opt_double( jbuf,
3317 "receivedTotalPacketsDelta", &vnic_performance->recvd_total_packets_delta);
3318 evel_enc_kv_opt_double( jbuf,
3319 "receivedUnicastPacketsAccumulated", &vnic_performance->recvd_ucast_packets_acc);
3320 evel_enc_kv_opt_double( jbuf,
3321 "receivedUnicastPacketsDelta", &vnic_performance->recvd_ucast_packets_delta);
3322 evel_enc_kv_opt_double( jbuf,
3323 "transmittedBroadcastPacketsAccumulated", &vnic_performance->tx_bcast_packets_acc);
3324 evel_enc_kv_opt_double( jbuf,
3325 "transmittedBroadcastPacketsDelta", &vnic_performance->tx_bcast_packets_delta);
3326 evel_enc_kv_opt_double( jbuf,
3327 "transmittedDiscardedPacketsAccumulated", &vnic_performance->tx_discarded_packets_acc);
3328 evel_enc_kv_opt_double( jbuf,
3329 "transmittedDiscardedPacketsDelta", &vnic_performance->tx_discarded_packets_delta);
3330 evel_enc_kv_opt_double( jbuf,
3331 "transmittedErrorPacketsAccumulated", &vnic_performance->tx_error_packets_acc);
3332 evel_enc_kv_opt_double( jbuf,
3333 "transmittedErrorPacketsDelta", &vnic_performance->tx_error_packets_delta);
3334 evel_enc_kv_opt_double( jbuf,
3335 "transmittedMulticastPacketsAccumulated", &vnic_performance->tx_mcast_packets_acc);
3336 evel_enc_kv_opt_double( jbuf,
3337 "transmittedMulticastPacketsDelta", &vnic_performance->tx_mcast_packets_delta);
3338 evel_enc_kv_opt_double( jbuf,
3339 "transmittedOctetsAccumulated", &vnic_performance->tx_octets_acc);
3340 evel_enc_kv_opt_double( jbuf,
3341 "transmittedOctetsDelta", &vnic_performance->tx_octets_delta);
3342 evel_enc_kv_opt_double( jbuf,
3343 "transmittedTotalPacketsAccumulated", &vnic_performance->tx_total_packets_acc);
3344 evel_enc_kv_opt_double( jbuf,
3345 "transmittedTotalPacketsDelta", &vnic_performance->tx_total_packets_delta);
3346 evel_enc_kv_opt_double( jbuf,
3347 "transmittedUnicastPacketsAccumulated", &vnic_performance->tx_ucast_packets_acc);
3348 evel_enc_kv_opt_double( jbuf,
3349 "transmittedUnicastPacketsDelta", &vnic_performance->tx_ucast_packets_delta);
3351 /*********************************************************************/
3352 /* Mandatory fields. */
3353 /*********************************************************************/
3354 evel_enc_kv_string(jbuf, "valuesAreSuspect", vnic_performance->valuesaresuspect);
3355 evel_enc_kv_string(jbuf, "vNicIdentifier", vnic_performance->vnic_id);
3357 evel_json_close_object(jbuf);
3360 item = dlist_get_next(item);
3363 evel_json_close_list(jbuf);
3365 /*************************************************************************/
3366 /* If we've not written anything, rewind to before we opened the list. */
3367 /*************************************************************************/
3370 evel_json_rewind(jbuf);
3375 /***************************************************************************/
3376 /* Memory Use list. */
3377 /***************************************************************************/
3378 evel_json_checkpoint(jbuf);
3379 if (evel_json_open_opt_named_list(jbuf, "memoryUsageArray"))
3381 bool item_added = false;
3383 item = dlist_get_first(&event->mem_usage);
3384 while (item != NULL)
3386 mem_use = (MEASUREMENT_MEM_USE*) item->item;
3387 assert(mem_use != NULL);
3389 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3393 evel_json_open_object(jbuf);
3394 evel_enc_kv_double(jbuf, "memoryBuffered", mem_use->membuffsz);
3395 evel_enc_kv_opt_double(jbuf, "memoryCached", &mem_use->memcache);
3396 evel_enc_kv_opt_double(jbuf, "memoryConfigured", &mem_use->memconfig);
3397 evel_enc_kv_opt_double(jbuf, "memoryFree", &mem_use->memfree);
3398 evel_enc_kv_opt_double(jbuf, "memorySlabRecl", &mem_use->slabrecl);
3399 evel_enc_kv_opt_double(jbuf, "memorySlabUnrecl", &mem_use->slabunrecl);
3400 evel_enc_kv_opt_double(jbuf, "memoryUsed", &mem_use->memused);
3401 evel_enc_kv_string(jbuf, "vmIdentifier", mem_use->id);
3402 evel_json_close_object(jbuf);
3405 item = dlist_get_next(item);
3407 evel_json_close_list(jbuf);
3409 /*************************************************************************/
3410 /* If we've not written anything, rewind to before we opened the list. */
3411 /*************************************************************************/
3414 evel_json_rewind(jbuf);
3419 evel_enc_kv_opt_int(
3420 jbuf, "numberOfMediaPortsInUse", &event->media_ports_in_use);
3421 evel_enc_kv_opt_int(
3422 jbuf, "vnfcScalingMetric", &event->vnfc_scaling_metric);
3424 /***************************************************************************/
3426 /***************************************************************************/
3427 if ((event->errors != NULL) &&
3428 evel_json_open_opt_named_object(jbuf, "errors"))
3430 errors = event->errors;
3431 evel_enc_kv_int(jbuf, "receiveDiscards", errors->receive_discards);
3432 evel_enc_kv_int(jbuf, "receiveErrors", errors->receive_errors);
3433 evel_enc_kv_int(jbuf, "transmitDiscards", errors->transmit_discards);
3434 evel_enc_kv_int(jbuf, "transmitErrors", errors->transmit_errors);
3435 evel_json_close_object(jbuf);
3438 /***************************************************************************/
3439 /* Feature Utilization list. */
3440 /***************************************************************************/
3441 evel_json_checkpoint(jbuf);
3442 if (evel_json_open_opt_named_list(jbuf, "featureUsageArray"))
3444 bool item_added = false;
3446 item = dlist_get_first(&event->feature_usage);
3447 while (item != NULL)
3449 feature_use = (MEASUREMENT_FEATURE_USE*) item->item;
3450 assert(feature_use != NULL);
3452 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3453 "featureUsageArray",
3454 feature_use->feature_id))
3456 evel_json_open_object(jbuf);
3457 evel_enc_kv_string(jbuf, "featureIdentifier", feature_use->feature_id);
3459 jbuf, "featureUtilization", feature_use->feature_utilization);
3460 evel_json_close_object(jbuf);
3463 item = dlist_get_next(item);
3465 evel_json_close_list(jbuf);
3467 /*************************************************************************/
3468 /* If we've not written anything, rewind to before we opened the list. */
3469 /*************************************************************************/
3472 evel_json_rewind(jbuf);
3476 /***************************************************************************/
3477 /* Codec Utilization list. */
3478 /***************************************************************************/
3479 evel_json_checkpoint(jbuf);
3480 if (evel_json_open_opt_named_list(jbuf, "codecUsageArray"))
3482 bool item_added = false;
3484 item = dlist_get_first(&event->codec_usage);
3485 while (item != NULL)
3487 codec_use = (MEASUREMENT_CODEC_USE*) item->item;
3488 assert(codec_use != NULL);
3490 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3492 codec_use->codec_id))
3494 evel_json_open_object(jbuf);
3495 evel_enc_kv_string(jbuf, "codecIdentifier", codec_use->codec_id);
3496 evel_enc_kv_int(jbuf, "numberInUse", codec_use->number_in_use);
3497 evel_json_close_object(jbuf);
3500 item = dlist_get_next(item);
3502 evel_json_close_list(jbuf);
3504 /*************************************************************************/
3505 /* If we've not written anything, rewind to before we opened the list. */
3506 /*************************************************************************/
3509 evel_json_rewind(jbuf);
3513 /***************************************************************************/
3514 /* Additional Measurement Groups list. */
3515 /***************************************************************************/
3516 evel_json_checkpoint(jbuf);
3517 if (evel_json_open_opt_named_list(jbuf, "additionalMeasurements"))
3519 bool item_added = false;
3521 item = dlist_get_first(&event->additional_measurements);
3522 while (item != NULL)
3524 measurement_group = (MEASUREMENT_GROUP *) item->item;
3525 assert(measurement_group != NULL);
3527 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3528 "additionalMeasurements",
3529 measurement_group->name))
3531 evel_json_open_object(jbuf);
3532 evel_enc_kv_string(jbuf, "name", measurement_group->name);
3533 evel_json_open_opt_named_list(jbuf, "measurements");
3535 /*********************************************************************/
3536 /* Measurements list. */
3537 /*********************************************************************/
3538 nested_item = dlist_get_first(&measurement_group->measurements);
3539 while (nested_item != NULL)
3541 custom_measurement = (CUSTOM_MEASUREMENT *) nested_item->item;
3542 assert(custom_measurement != NULL);
3544 evel_json_open_object(jbuf);
3545 evel_enc_kv_string(jbuf, "name", custom_measurement->name);
3546 evel_enc_kv_string(jbuf, "value", custom_measurement->value);
3547 evel_json_close_object(jbuf);
3548 nested_item = dlist_get_next(nested_item);
3550 evel_json_close_list(jbuf);
3551 evel_json_close_object(jbuf);
3554 item = dlist_get_next(item);
3556 evel_json_close_list(jbuf);
3558 /*************************************************************************/
3559 /* If we've not written anything, rewind to before we opened the list. */
3560 /*************************************************************************/
3563 evel_json_rewind(jbuf);
3567 /***************************************************************************/
3568 /* Although optional, we always generate the version. Note that this */
3569 /* closes the object, too. */
3570 /***************************************************************************/
3571 evel_enc_version(jbuf,
3572 "measurementsForVfScalingVersion",
3573 event->major_version,
3574 event->minor_version);
3575 evel_json_close_object(jbuf);
3580 /**************************************************************************//**
3581 * Free a Measurement.
3583 * Free off the Measurement supplied. Will free all the contained allocated
3586 * @note It does not free the Measurement itself, since that may be part of a
3588 *****************************************************************************/
3589 void evel_free_measurement(EVENT_MEASUREMENT * event)
3591 MEASUREMENT_CPU_USE * cpu_use = NULL;
3592 MEASUREMENT_DISK_USE * disk_use = NULL;
3593 MEASUREMENT_FSYS_USE * fsys_use = NULL;
3594 MEASUREMENT_LATENCY_BUCKET * bucket = NULL;
3595 MEASUREMENT_MEM_USE * mem_use = NULL;
3596 MEASUREMENT_VNIC_PERFORMANCE * vnic_performance = NULL;
3597 MEASUREMENT_FEATURE_USE * feature_use = NULL;
3598 MEASUREMENT_CODEC_USE * codec_use = NULL;
3599 MEASUREMENT_GROUP * measurement_group = NULL;
3600 CUSTOM_MEASUREMENT * measurement = NULL;
3601 OTHER_FIELD *addl_info = NULL;
3605 /***************************************************************************/
3606 /* Check preconditions. As an internal API we don't allow freeing NULL */
3607 /* events as we do on the public API. */
3608 /***************************************************************************/
3609 assert(event != NULL);
3610 assert(event->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
3612 /***************************************************************************/
3613 /* Free all internal strings then the header itself. */
3614 /***************************************************************************/
3615 addl_info = dlist_pop_last(&event->additional_info);
3616 while (addl_info != NULL)
3618 EVEL_DEBUG("Freeing Additional Info (%s, %s)",
3621 free(addl_info->name);
3622 free(addl_info->value);
3624 addl_info = dlist_pop_last(&event->additional_info);
3629 cpu_use = dlist_pop_last(&event->cpu_usage);
3630 while (cpu_use != NULL)
3632 EVEL_DEBUG("Freeing CPU use Info (%s)", cpu_use->id);
3635 cpu_use = dlist_pop_last(&event->cpu_usage);
3637 disk_use = dlist_pop_last(&event->disk_usage);
3638 while (disk_use != NULL)
3640 EVEL_DEBUG("Freeing Disk use Info (%s)", disk_use->id);
3643 disk_use = dlist_pop_last(&event->disk_usage);
3645 mem_use = dlist_pop_last(&event->mem_usage);
3646 while (mem_use != NULL)
3648 EVEL_DEBUG("Freeing Memory use Info (%s)", mem_use->id);
3650 free(mem_use->vmid);
3652 mem_use = dlist_pop_last(&event->mem_usage);
3655 fsys_use = dlist_pop_last(&event->filesystem_usage);
3656 while (fsys_use != NULL)
3658 EVEL_DEBUG("Freeing Filesystem Use info (%s)", fsys_use->filesystem_name);
3659 free(fsys_use->filesystem_name);
3661 fsys_use = dlist_pop_last(&event->filesystem_usage);
3664 bucket = dlist_pop_last(&event->latency_distribution);
3665 while (bucket != NULL)
3667 EVEL_DEBUG("Freeing Latency Bucket");
3669 bucket = dlist_pop_last(&event->latency_distribution);
3672 vnic_performance = dlist_pop_last(&event->vnic_usage);
3673 while (vnic_performance != NULL)
3675 EVEL_DEBUG("Freeing vNIC performance Info (%s)", vnic_performance->vnic_id);
3676 evel_measurement_free_vnic_performance(vnic_performance);
3677 free(vnic_performance);
3678 vnic_performance = dlist_pop_last(&event->vnic_usage);
3681 codec_use = dlist_pop_last(&event->codec_usage);
3682 while (codec_use != NULL)
3684 EVEL_DEBUG("Freeing Codec use Info (%s)", codec_use->codec_id);
3685 free(codec_use->codec_id);
3687 codec_use = dlist_pop_last(&event->codec_usage);
3690 if (event->errors != NULL)
3692 EVEL_DEBUG("Freeing Errors");
3693 free(event->errors);
3696 feature_use = dlist_pop_last(&event->feature_usage);
3697 while (feature_use != NULL)
3699 EVEL_DEBUG("Freeing Feature use Info (%s)", feature_use->feature_id);
3700 free(feature_use->feature_id);
3702 feature_use = dlist_pop_last(&event->feature_usage);
3705 measurement_group = dlist_pop_last(&event->additional_measurements);
3706 while (measurement_group != NULL)
3708 EVEL_DEBUG("Freeing Measurement Group (%s)", measurement_group->name);
3710 measurement = dlist_pop_last(&measurement_group->measurements);
3711 while (measurement != NULL)
3713 EVEL_DEBUG("Freeing Measurement (%s)", measurement->name);
3714 free(measurement->name);
3715 free(measurement->value);
3717 measurement = dlist_pop_last(&measurement_group->measurements);
3719 free(measurement_group->name);
3720 free(measurement_group);
3721 measurement_group = dlist_pop_last(&event->additional_measurements);
3724 evel_free_header(&event->header);