1 /*************************************************************************//**
3 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 ****************************************************************************/
17 /**************************************************************************//**
19 * Implementation of EVEL functions relating to the Measurement.
21 ****************************************************************************/
28 #include "evel_internal.h"
29 #include "evel_throttle.h"
31 /**************************************************************************//**
32 * Create a new Measurement event.
34 * @note The mandatory fields on the Measurement must be supplied to this
35 * factory function and are immutable once set. Optional fields have
36 * explicit setter functions, but again values may only be set once so
37 * that the Measurement has immutable properties.
39 * @param measurement_interval
41 * @returns pointer to the newly manufactured ::EVENT_MEASUREMENT. If the
42 * event is not used (i.e. posted) it must be released using
44 * @retval NULL Failed to create the event.
45 *****************************************************************************/
46 EVENT_MEASUREMENT * evel_new_measurement(double measurement_interval)
48 EVENT_MEASUREMENT * measurement = NULL;
52 /***************************************************************************/
53 /* Check preconditions. */
54 /***************************************************************************/
55 assert(measurement_interval >= 0.0);
57 /***************************************************************************/
58 /* Allocate the measurement. */
59 /***************************************************************************/
60 measurement = malloc(sizeof(EVENT_MEASUREMENT));
61 if (measurement == NULL)
63 log_error_state("Out of memory for Measurement");
66 memset(measurement, 0, sizeof(EVENT_MEASUREMENT));
67 EVEL_DEBUG("New measurement is at %lp", measurement);
69 /***************************************************************************/
70 /* Initialize the header & the measurement fields. */
71 /***************************************************************************/
72 evel_init_header(&measurement->header,"vnfScalingMeasurement");
73 measurement->header.event_domain = EVEL_DOMAIN_MEASUREMENT;
74 measurement->measurement_interval = measurement_interval;
75 dlist_initialize(&measurement->additional_info);
76 dlist_initialize(&measurement->additional_measurements);
77 dlist_initialize(&measurement->additional_objects);
78 dlist_initialize(&measurement->cpu_usage);
79 dlist_initialize(&measurement->disk_usage);
80 dlist_initialize(&measurement->mem_usage);
81 dlist_initialize(&measurement->filesystem_usage);
82 dlist_initialize(&measurement->latency_distribution);
83 dlist_initialize(&measurement->vnic_usage);
84 dlist_initialize(&measurement->codec_usage);
85 dlist_initialize(&measurement->feature_usage);
86 evel_init_option_double(&measurement->mean_request_latency);
87 evel_init_option_int(&measurement->vnfc_scaling_metric);
88 evel_init_option_int(&measurement->concurrent_sessions);
89 evel_init_option_int(&measurement->configured_entities);
90 evel_init_option_int(&measurement->media_ports_in_use);
91 evel_init_option_int(&measurement->request_rate);
92 measurement->major_version = EVEL_MEASUREMENT_MAJOR_VERSION;
93 measurement->minor_version = EVEL_MEASUREMENT_MINOR_VERSION;
100 /**************************************************************************//**
101 * Set the Event Type property of the Measurement.
103 * @note The property is treated as immutable: it is only valid to call
104 * the setter once. However, we don't assert if the caller tries to
105 * overwrite, just ignoring the update instead.
107 * @param measurement Pointer to the Measurement.
108 * @param type The Event Type to be set. ASCIIZ string. The caller
109 * does not need to preserve the value once the function
111 *****************************************************************************/
112 void evel_measurement_type_set(EVENT_MEASUREMENT * measurement,
113 const char * const type)
117 /***************************************************************************/
118 /* Check preconditions and call evel_header_type_set. */
119 /***************************************************************************/
120 assert(measurement != NULL);
121 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
122 evel_header_type_set(&measurement->header, type);
127 /**************************************************************************//**
128 * Add an additional value name/value pair to the Measurement.
130 * The name and value are null delimited ASCII strings. The library takes
131 * a copy so the caller does not have to preserve values after the function
134 * @param measurement Pointer to the measurement.
135 * @param name ASCIIZ string with the attribute's name. The caller
136 * does not need to preserve the value once the function
138 * @param value ASCIIZ string with the attribute's value. The caller
139 * does not need to preserve the value once the function
141 *****************************************************************************/
142 void evel_measurement_addl_info_add(EVENT_MEASUREMENT * measurement, char * name, char * value)
144 OTHER_FIELD * addl_info = NULL;
147 /***************************************************************************/
148 /* Check preconditions. */
149 /***************************************************************************/
150 assert(measurement != NULL);
151 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
152 assert(name != NULL);
153 assert(value != NULL);
155 EVEL_DEBUG("Adding name=%s value=%s", name, value);
156 addl_info = malloc(sizeof(OTHER_FIELD));
157 assert(addl_info != NULL);
158 memset(addl_info, 0, sizeof(OTHER_FIELD));
159 addl_info->name = strdup(name);
160 addl_info->value = strdup(value);
161 assert(addl_info->name != NULL);
162 assert(addl_info->value != NULL);
164 dlist_push_last(&measurement->additional_info, addl_info);
169 /**************************************************************************//**
170 * Set the Concurrent Sessions property of the Measurement.
172 * @note The property is treated as immutable: it is only valid to call
173 * the setter once. However, we don't assert if the caller tries to
174 * overwrite, just ignoring the update instead.
176 * @param measurement Pointer to the Measurement.
177 * @param concurrent_sessions The Concurrent Sessions to be set.
178 *****************************************************************************/
179 void evel_measurement_conc_sess_set(EVENT_MEASUREMENT * measurement,
180 int concurrent_sessions)
184 /***************************************************************************/
185 /* Check preconditions. */
186 /***************************************************************************/
187 assert(measurement != NULL);
188 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
189 assert(concurrent_sessions >= 0);
191 evel_set_option_int(&measurement->concurrent_sessions,
193 "Concurrent Sessions");
197 /**************************************************************************//**
198 * Set the Configured Entities property of the Measurement.
200 * @note The property is treated as immutable: it is only valid to call
201 * the setter once. However, we don't assert if the caller tries to
202 * overwrite, just ignoring the update instead.
204 * @param measurement Pointer to the Measurement.
205 * @param configured_entities The Configured Entities to be set.
206 *****************************************************************************/
207 void evel_measurement_cfg_ents_set(EVENT_MEASUREMENT * measurement,
208 int configured_entities)
212 /***************************************************************************/
213 /* Check preconditions. */
214 /***************************************************************************/
215 assert(measurement != NULL);
216 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
217 assert(configured_entities >= 0);
219 evel_set_option_int(&measurement->configured_entities,
221 "Configured Entities");
225 /**************************************************************************//**
226 * Add an additional set of Errors to the Measurement.
228 * @note The property is treated as immutable: it is only valid to call
229 * the setter once. However, we don't assert if the caller tries to
230 * overwrite, just ignoring the update instead.
232 * @param measurement Pointer to the measurement.
233 * @param receive_discards The number of receive discards.
234 * @param receive_errors The number of receive errors.
235 * @param transmit_discards The number of transmit discards.
236 * @param transmit_errors The number of transmit errors.
237 *****************************************************************************/
238 void evel_measurement_errors_set(EVENT_MEASUREMENT * measurement,
239 int receive_discards,
241 int transmit_discards,
244 MEASUREMENT_ERRORS * errors = NULL;
247 /***************************************************************************/
248 /* Check preconditions. */
249 /***************************************************************************/
250 assert(measurement != NULL);
251 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
252 assert(receive_discards >= 0);
253 assert(receive_errors >= 0);
254 assert(transmit_discards >= 0);
255 assert(transmit_errors >= 0);
257 if (measurement->errors == NULL)
259 EVEL_DEBUG("Adding Errors: %d, %d; %d, %d",
264 errors = malloc(sizeof(MEASUREMENT_ERRORS));
265 assert(errors != NULL);
266 memset(errors, 0, sizeof(MEASUREMENT_ERRORS));
267 errors->receive_discards = receive_discards;
268 errors->receive_errors = receive_errors;
269 errors->transmit_discards = transmit_discards;
270 errors->transmit_errors = transmit_errors;
271 measurement->errors = errors;
275 errors = measurement->errors;
276 EVEL_DEBUG("Ignoring attempt to add Errors: %d, %d; %d, %d\n"
277 "Errors already set: %d, %d; %d, %d",
282 errors->receive_discards,
283 errors->receive_errors,
284 errors->transmit_discards,
285 errors->transmit_errors);
291 /**************************************************************************//**
292 * Set the Mean Request Latency property of the Measurement.
294 * @note The property is treated as immutable: it is only valid to call
295 * the setter once. However, we don't assert if the caller tries to
296 * overwrite, just ignoring the update instead.
298 * @param measurement Pointer to the Measurement.
299 * @param mean_request_latency The Mean Request Latency to be set.
300 *****************************************************************************/
301 void evel_measurement_mean_req_lat_set(EVENT_MEASUREMENT * measurement,
302 double mean_request_latency)
306 /***************************************************************************/
307 /* Check preconditions. */
308 /***************************************************************************/
309 assert(measurement != NULL);
310 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
311 assert(mean_request_latency >= 0.0);
313 evel_set_option_double(&measurement->mean_request_latency,
314 mean_request_latency,
315 "Mean Request Latency");
320 /**************************************************************************//**
321 * Set the Request Rate property of the Measurement.
323 * @note The property is treated as immutable: it is only valid to call
324 * the setter once. However, we don't assert if the caller tries to
325 * overwrite, just ignoring the update instead.
327 * @param measurement Pointer to the Measurement.
328 * @param request_rate The Request Rate to be set.
329 *****************************************************************************/
330 void evel_measurement_request_rate_set(EVENT_MEASUREMENT * measurement,
335 /***************************************************************************/
336 /* Check preconditions. */
337 /***************************************************************************/
338 assert(measurement != NULL);
339 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
340 assert(request_rate >= 0);
342 evel_set_option_int(&measurement->request_rate,
348 /**************************************************************************//**
349 * Add an additional CPU usage value name/value pair to the Measurement.
351 * The name and value are null delimited ASCII strings. The library takes
352 * a copy so the caller does not have to preserve values after the function
355 * @param measurement Pointer to the measurement.
356 * @param id ASCIIZ string with the CPU's identifier.
357 * @param usage CPU utilization.
358 *****************************************************************************/
359 MEASUREMENT_CPU_USE *evel_measurement_new_cpu_use_add(EVENT_MEASUREMENT * measurement,
360 char * id, double usage)
362 MEASUREMENT_CPU_USE * cpu_use = NULL;
365 /***************************************************************************/
366 /* Check assumptions. */
367 /***************************************************************************/
368 assert(measurement != NULL);
369 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
371 assert(usage >= 0.0);
373 /***************************************************************************/
374 /* Allocate a container for the value and push onto the list. */
375 /***************************************************************************/
376 EVEL_DEBUG("Adding id=%s usage=%lf", id, usage);
377 cpu_use = malloc(sizeof(MEASUREMENT_CPU_USE));
378 assert(cpu_use != NULL);
379 memset(cpu_use, 0, sizeof(MEASUREMENT_CPU_USE));
380 cpu_use->id = strdup(id);
381 cpu_use->usage = usage;
382 evel_init_option_double(&cpu_use->idle);
383 evel_init_option_double(&cpu_use->intrpt);
384 evel_init_option_double(&cpu_use->nice);
385 evel_init_option_double(&cpu_use->softirq);
386 evel_init_option_double(&cpu_use->steal);
387 evel_init_option_double(&cpu_use->sys);
388 evel_init_option_double(&cpu_use->user);
389 evel_init_option_double(&cpu_use->wait);
391 dlist_push_last(&measurement->cpu_usage, cpu_use);
397 /**************************************************************************//**
398 * Set the CPU Idle value in measurement interval
399 * percentage of CPU time spent in the idle task
401 * @note The property is treated as immutable: it is only valid to call
402 * the setter once. However, we don't assert if the caller tries to
403 * overwrite, just ignoring the update instead.
405 * @param cpu_use Pointer to the CPU Use.
407 *****************************************************************************/
408 void evel_measurement_cpu_use_idle_set(MEASUREMENT_CPU_USE *const cpu_use,
412 evel_set_option_double(&cpu_use->idle, val, "CPU idle time");
416 /**************************************************************************//**
417 * Set the percentage of time spent servicing interrupts
419 * @note The property is treated as immutable: it is only valid to call
420 * the setter once. However, we don't assert if the caller tries to
421 * overwrite, just ignoring the update instead.
423 * @param cpu_use Pointer to the CPU Use.
425 *****************************************************************************/
426 void evel_measurement_cpu_use_interrupt_set(MEASUREMENT_CPU_USE * const cpu_use,
430 evel_set_option_double(&cpu_use->intrpt, val, "CPU interrupt value");
435 /**************************************************************************//**
436 * Set the percentage of time spent running user space processes that have been niced
438 * @note The property is treated as immutable: it is only valid to call
439 * the setter once. However, we don't assert if the caller tries to
440 * overwrite, just ignoring the update instead.
442 * @param cpu_use Pointer to the CPU Use.
444 *****************************************************************************/
445 void evel_measurement_cpu_use_nice_set(MEASUREMENT_CPU_USE * const cpu_use,
449 evel_set_option_double(&cpu_use->nice, val, "CPU nice value");
454 /**************************************************************************//**
455 * Set the percentage of time spent handling soft irq interrupts
457 * @note The property is treated as immutable: it is only valid to call
458 * the setter once. However, we don't assert if the caller tries to
459 * overwrite, just ignoring the update instead.
461 * @param cpu_use Pointer to the CPU Use.
463 *****************************************************************************/
464 void evel_measurement_cpu_use_softirq_set(MEASUREMENT_CPU_USE * const cpu_use,
468 evel_set_option_double(&cpu_use->softirq, val, "CPU Soft IRQ value");
472 /**************************************************************************//**
473 * Set the percentage of time spent in involuntary wait
475 * @note The property is treated as immutable: it is only valid to call
476 * the setter once. However, we don't assert if the caller tries to
477 * overwrite, just ignoring the update instead.
479 * @param cpu_use Pointer to the CPU Use.
481 *****************************************************************************/
482 void evel_measurement_cpu_use_steal_set(MEASUREMENT_CPU_USE * const cpu_use,
486 evel_set_option_double(&cpu_use->steal, val, "CPU involuntary wait");
490 /**************************************************************************//**
491 * Set the percentage of time spent on system tasks running the kernel
493 * @note The property is treated as immutable: it is only valid to call
494 * the setter once. However, we don't assert if the caller tries to
495 * overwrite, just ignoring the update instead.
497 * @param cpu_use Pointer to the CPU Use.
499 *****************************************************************************/
500 void evel_measurement_cpu_use_system_set(MEASUREMENT_CPU_USE * const cpu_use,
504 evel_set_option_double(&cpu_use->sys, val, "CPU System load");
509 /**************************************************************************//**
510 * Set the percentage of time spent running un-niced user space processes
512 * @note The property is treated as immutable: it is only valid to call
513 * the setter once. However, we don't assert if the caller tries to
514 * overwrite, just ignoring the update instead.
516 * @param cpu_use Pointer to the CPU Use.
518 *****************************************************************************/
519 void evel_measurement_cpu_use_usageuser_set(MEASUREMENT_CPU_USE * const cpu_use,
523 evel_set_option_double(&cpu_use->user, val, "CPU User load value");
527 /**************************************************************************//**
528 * Set the percentage of CPU time spent waiting for I/O operations to complete
530 * @note The property is treated as immutable: it is only valid to call
531 * the setter once. However, we don't assert if the caller tries to
532 * overwrite, just ignoring the update instead.
534 * @param cpu_use Pointer to the CPU Use.
536 *****************************************************************************/
537 void evel_measurement_cpu_use_wait_set(MEASUREMENT_CPU_USE * const cpu_use,
541 evel_set_option_double(&cpu_use->wait, val, "CPU Wait IO value");
546 /**************************************************************************//**
547 * Add an additional Memory usage value name/value pair to the Measurement.
549 * The name and value are null delimited ASCII strings. The library takes
550 * a copy so the caller does not have to preserve values after the function
553 * @param measurement Pointer to the measurement.
554 * @param id ASCIIZ string with the Memory identifier.
555 * @param vmidentifier ASCIIZ string with the VM's identifier.
556 * @param membuffsz Memory Size.
558 * @return Returns pointer to memory use structure in measurements
559 *****************************************************************************/
560 MEASUREMENT_MEM_USE * evel_measurement_new_mem_use_add(EVENT_MEASUREMENT * measurement,
561 char * id, char *vmidentifier, double membuffsz)
563 MEASUREMENT_MEM_USE * mem_use = NULL;
566 /***************************************************************************/
567 /* Check assumptions. */
568 /***************************************************************************/
569 assert(measurement != NULL);
570 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
572 assert(membuffsz >= 0.0);
574 /***************************************************************************/
575 /* Allocate a container for the value and push onto the list. */
576 /***************************************************************************/
577 EVEL_DEBUG("Adding id=%s buffer size=%lf", id, membuffsz);
578 mem_use = malloc(sizeof(MEASUREMENT_MEM_USE));
579 assert(mem_use != NULL);
580 memset(mem_use, 0, sizeof(MEASUREMENT_MEM_USE));
581 mem_use->id = strdup(id);
582 mem_use->vmid = strdup(vmidentifier);
583 mem_use->membuffsz = membuffsz;
584 evel_init_option_double(&mem_use->memcache);
585 evel_init_option_double(&mem_use->memconfig);
586 evel_init_option_double(&mem_use->memfree);
587 evel_init_option_double(&mem_use->slabrecl);
588 evel_init_option_double(&mem_use->slabunrecl);
589 evel_init_option_double(&mem_use->memused);
591 assert(mem_use->id != NULL);
593 dlist_push_last(&measurement->mem_usage, mem_use);
599 /**************************************************************************//**
600 * Set kilobytes of memory used for cache
602 * @note The property is treated as immutable: it is only valid to call
603 * the setter once. However, we don't assert if the caller tries to
604 * overwrite, just ignoring the update instead.
606 * @param mem_use Pointer to the Memory Use.
608 *****************************************************************************/
609 void evel_measurement_mem_use_memcache_set(MEASUREMENT_MEM_USE * const mem_use,
613 evel_set_option_double(&mem_use->memcache, val, "Memory cache value");
617 /**************************************************************************//**
618 * Set kilobytes of memory configured in the virtual machine on which the VNFC reporting
620 * @note The property is treated as immutable: it is only valid to call
621 * the setter once. However, we don't assert if the caller tries to
622 * overwrite, just ignoring the update instead.
624 * @param mem_use Pointer to the Memory Use.
626 *****************************************************************************/
627 void evel_measurement_mem_use_memconfig_set(MEASUREMENT_MEM_USE * const mem_use,
631 evel_set_option_double(&mem_use->memconfig, val, "Memory configured value");
635 /**************************************************************************//**
636 * Set kilobytes of physical RAM left unused by the system
638 * @note The property is treated as immutable: it is only valid to call
639 * the setter once. However, we don't assert if the caller tries to
640 * overwrite, just ignoring the update instead.
642 * @param mem_use Pointer to the Memory Use.
644 *****************************************************************************/
645 void evel_measurement_mem_use_memfree_set(MEASUREMENT_MEM_USE * const mem_use,
649 evel_set_option_double(&mem_use->memfree, val, "Memory freely available value");
653 /**************************************************************************//**
654 * Set the part of the slab that can be reclaimed such as caches measured in kilobytes
656 * @note The property is treated as immutable: it is only valid to call
657 * the setter once. However, we don't assert if the caller tries to
658 * overwrite, just ignoring the update instead.
660 * @param mem_use Pointer to the Memory Use.
662 *****************************************************************************/
663 void evel_measurement_mem_use_slab_reclaimed_set(MEASUREMENT_MEM_USE * const mem_use,
667 evel_set_option_double(&mem_use->slabrecl, val, "Memory reclaimable slab set");
671 /**************************************************************************//**
672 * Set the part of the slab that cannot be reclaimed such as caches measured in kilobytes
674 * @note The property is treated as immutable: it is only valid to call
675 * the setter once. However, we don't assert if the caller tries to
676 * overwrite, just ignoring the update instead.
678 * @param mem_use Pointer to the Memory Use.
680 *****************************************************************************/
681 void evel_measurement_mem_use_slab_unreclaimable_set(MEASUREMENT_MEM_USE * const mem_use,
685 evel_set_option_double(&mem_use->slabunrecl, val, "Memory unreclaimable slab set");
689 /**************************************************************************//**
690 * Set the total memory minus the sum of free, buffered, cached and slab memory in kilobytes
692 * @note The property is treated as immutable: it is only valid to call
693 * the setter once. However, we don't assert if the caller tries to
694 * overwrite, just ignoring the update instead.
696 * @param mem_use Pointer to the Memory Use.
698 *****************************************************************************/
699 void evel_measurement_mem_use_usedup_set(MEASUREMENT_MEM_USE * const mem_use,
703 evel_set_option_double(&mem_use->memused, val, "Memory usedup total set");
707 /**************************************************************************//**
708 * Add an additional Disk usage value name/value pair to the Measurement.
710 * The name and value are null delimited ASCII strings. The library takes
711 * a copy so the caller does not have to preserve values after the function
714 * @param measurement Pointer to the measurement.
715 * @param id ASCIIZ string with the CPU's identifier.
716 * @param usage Disk utilization.
717 *****************************************************************************/
718 MEASUREMENT_DISK_USE * evel_measurement_new_disk_use_add(EVENT_MEASUREMENT * measurement, char * id)
720 MEASUREMENT_DISK_USE * disk_use = NULL;
723 /***************************************************************************/
724 /* Check assumptions. */
725 /***************************************************************************/
726 assert(measurement != NULL);
727 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
730 /***************************************************************************/
731 /* Allocate a container for the value and push onto the list. */
732 /***************************************************************************/
733 EVEL_DEBUG("Adding id=%s disk usage", id);
734 disk_use = malloc(sizeof(MEASUREMENT_DISK_USE));
735 assert(disk_use != NULL);
736 memset(disk_use, 0, sizeof(MEASUREMENT_DISK_USE));
737 disk_use->id = strdup(id);
738 assert(disk_use->id != NULL);
739 dlist_push_last(&measurement->disk_usage, disk_use);
741 evel_init_option_double(&disk_use->iotimeavg );
742 evel_init_option_double(&disk_use->iotimelast );
743 evel_init_option_double(&disk_use->iotimemax );
744 evel_init_option_double(&disk_use->iotimemin );
745 evel_init_option_double(&disk_use->mergereadavg );
746 evel_init_option_double(&disk_use->mergereadlast );
747 evel_init_option_double(&disk_use->mergereadmax );
748 evel_init_option_double(&disk_use->mergereadmin );
749 evel_init_option_double(&disk_use->mergewriteavg );
750 evel_init_option_double(&disk_use->mergewritelast );
751 evel_init_option_double(&disk_use->mergewritemax );
752 evel_init_option_double(&disk_use->mergewritemin );
753 evel_init_option_double(&disk_use->octetsreadavg );
754 evel_init_option_double(&disk_use->octetsreadlast );
755 evel_init_option_double(&disk_use->octetsreadmax );
756 evel_init_option_double(&disk_use->octetsreadmin );
757 evel_init_option_double(&disk_use->octetswriteavg );
758 evel_init_option_double(&disk_use->octetswritelast );
759 evel_init_option_double(&disk_use->octetswritemax );
760 evel_init_option_double(&disk_use->octetswritemin );
761 evel_init_option_double(&disk_use->opsreadavg );
762 evel_init_option_double(&disk_use->opsreadlast );
763 evel_init_option_double(&disk_use->opsreadmax );
764 evel_init_option_double(&disk_use->opsreadmin );
765 evel_init_option_double(&disk_use->opswriteavg );
766 evel_init_option_double(&disk_use->opswritelast );
767 evel_init_option_double(&disk_use->opswritemax );
768 evel_init_option_double(&disk_use->opswritemin );
769 evel_init_option_double(&disk_use->pendingopsavg );
770 evel_init_option_double(&disk_use->pendingopslast );
771 evel_init_option_double(&disk_use->pendingopsmax );
772 evel_init_option_double(&disk_use->pendingopsmin );
773 evel_init_option_double(&disk_use->timereadavg );
774 evel_init_option_double(&disk_use->timereadlast );
775 evel_init_option_double(&disk_use->timereadmax );
776 evel_init_option_double(&disk_use->timereadmin );
777 evel_init_option_double(&disk_use->timewriteavg );
778 evel_init_option_double(&disk_use->timewritelast );
779 evel_init_option_double(&disk_use->timewritemax );
780 evel_init_option_double(&disk_use->timewritemin );
786 /**************************************************************************//**
787 * Set milliseconds spent doing input/output operations over 1 sec; treat
788 * this metric as a device load percentage where 1000ms matches 100% load;
789 * provide the average over the measurement interval
791 * @note The property is treated as immutable: it is only valid to call
792 * the setter once. However, we don't assert if the caller tries to
793 * overwrite, just ignoring the update instead.
795 * @param disk_use Pointer to the Disk Use.
797 *****************************************************************************/
798 void evel_measurement_disk_use_iotimeavg_set(MEASUREMENT_DISK_USE * const disk_use,
802 evel_set_option_double(&disk_use->iotimeavg, val, "Disk ioload set");
806 /**************************************************************************//**
807 * Set milliseconds spent doing input/output operations over 1 sec; treat
808 * this metric as a device load percentage where 1000ms matches 100% load;
809 * provide the last value within the measurement interval
811 * @note The property is treated as immutable: it is only valid to call
812 * the setter once. However, we don't assert if the caller tries to
813 * overwrite, just ignoring the update instead.
815 * @param disk_use Pointer to the Disk Use.
817 *****************************************************************************/
818 void evel_measurement_disk_use_iotimelast_set(MEASUREMENT_DISK_USE * const disk_use,
822 evel_set_option_double(&disk_use->iotimelast, val, "Disk ioloadlast set");
826 /**************************************************************************//**
827 * Set milliseconds spent doing input/output operations over 1 sec; treat
828 * this metric as a device load percentage where 1000ms matches 100% load;
829 * provide the maximum value within the measurement interval
831 * @note The property is treated as immutable: it is only valid to call
832 * the setter once. However, we don't assert if the caller tries to
833 * overwrite, just ignoring the update instead.
835 * @param disk_use Pointer to the Disk Use.
837 *****************************************************************************/
838 void evel_measurement_disk_use_iotimemax_set(MEASUREMENT_DISK_USE * const disk_use,
842 evel_set_option_double(&disk_use->iotimemax, val, "Disk ioloadmax set");
846 /**************************************************************************//**
847 * Set milliseconds spent doing input/output operations over 1 sec; treat
848 * this metric as a device load percentage where 1000ms matches 100% load;
849 * provide the minimum value within the measurement interval
851 * @note The property is treated as immutable: it is only valid to call
852 * the setter once. However, we don't assert if the caller tries to
853 * overwrite, just ignoring the update instead.
855 * @param disk_use Pointer to the Disk Use.
857 *****************************************************************************/
858 void evel_measurement_disk_use_iotimemin_set(MEASUREMENT_DISK_USE * const disk_use,
862 evel_set_option_double(&disk_use->iotimemin, val, "Disk ioloadmin set");
866 /**************************************************************************//**
867 * Set number of logical read operations that were merged into physical read
868 * operations, e.g., two logical reads were served by one physical disk access;
869 * provide the average measurement within the measurement interval
871 * @note The property is treated as immutable: it is only valid to call
872 * the setter once. However, we don't assert if the caller tries to
873 * overwrite, just ignoring the update instead.
875 * @param disk_use Pointer to the Disk Use.
877 *****************************************************************************/
878 void evel_measurement_disk_use_mergereadavg_set(MEASUREMENT_DISK_USE * const disk_use,
882 evel_set_option_double(&disk_use->mergereadavg, val, "Disk Merged read average set");
885 /**************************************************************************//**
886 * Set number of logical read operations that were merged into physical read
887 * operations, e.g., two logical reads were served by one physical disk access;
888 * provide the last measurement within the measurement interval
890 * @note The property is treated as immutable: it is only valid to call
891 * the setter once. However, we don't assert if the caller tries to
892 * overwrite, just ignoring the update instead.
894 * @param disk_use Pointer to the Disk Use.
896 *****************************************************************************/
897 void evel_measurement_disk_use_mergereadlast_set(MEASUREMENT_DISK_USE * const disk_use,
901 evel_set_option_double(&disk_use->mergereadlast, val, "Disk mergedload last set");
904 /**************************************************************************//**
905 * Set number of logical read operations that were merged into physical read
906 * operations, e.g., two logical reads were served by one physical disk access;
907 * provide the maximum measurement within the measurement interval
909 * @note The property is treated as immutable: it is only valid to call
910 * the setter once. However, we don't assert if the caller tries to
911 * overwrite, just ignoring the update instead.
913 * @param disk_use Pointer to the Disk Use.
915 *****************************************************************************/
916 void evel_measurement_disk_use_mergereadmax_set(MEASUREMENT_DISK_USE * const disk_use,
920 evel_set_option_double(&disk_use->mergereadmax, val, "Disk merged loadmax set");
924 /**************************************************************************//**
925 * Set number of logical read operations that were merged into physical read
926 * operations, e.g., two logical reads were served by one physical disk access;
927 * provide the minimum measurement within the measurement interval
929 * @note The property is treated as immutable: it is only valid to call
930 * the setter once. However, we don't assert if the caller tries to
931 * overwrite, just ignoring the update instead.
933 * @param disk_use Pointer to the Disk Use.
935 *****************************************************************************/
936 void evel_measurement_disk_use_mergereadmin_set(MEASUREMENT_DISK_USE * const disk_use,
940 evel_set_option_double(&disk_use->mergereadmin, val, "Disk merged loadmin set");
943 /**************************************************************************//**
944 * Set number of logical write operations that were merged into physical read
945 * operations, e.g., two logical writes were served by one physical disk access;
946 * provide the last measurement within the measurement interval
948 * @note The property is treated as immutable: it is only valid to call
949 * the setter once. However, we don't assert if the caller tries to
950 * overwrite, just ignoring the update instead.
952 * @param disk_use Pointer to the Disk Use.
954 *****************************************************************************/
955 void evel_measurement_disk_use_mergewritelast_set(MEASUREMENT_DISK_USE * const disk_use,
959 evel_set_option_double(&disk_use->mergewritelast, val, "Disk merged writelast set");
962 /**************************************************************************//**
963 * Set number of logical write operations that were merged into physical read
964 * operations, e.g., two logical writes were served by one physical disk access;
965 * provide the maximum measurement within the measurement interval
967 * @note The property is treated as immutable: it is only valid to call
968 * the setter once. However, we don't assert if the caller tries to
969 * overwrite, just ignoring the update instead.
971 * @param disk_use Pointer to the Disk Use.
973 *****************************************************************************/
974 void evel_measurement_disk_use_mergewritemax_set(MEASUREMENT_DISK_USE * const disk_use,
978 evel_set_option_double(&disk_use->mergewritemax, val, "Disk writemax set");
981 /**************************************************************************//**
982 * Set number of logical write operations that were merged into physical read
983 * operations, e.g., two logical writes were served by one physical disk access;
984 * provide the maximum measurement within the measurement interval
986 * @note The property is treated as immutable: it is only valid to call
987 * the setter once. However, we don't assert if the caller tries to
988 * overwrite, just ignoring the update instead.
990 * @param disk_use Pointer to the Disk Use.
992 *****************************************************************************/
993 void evel_measurement_disk_use_mergewritemin_set(MEASUREMENT_DISK_USE * const disk_use,
997 evel_set_option_double(&disk_use->mergewritemin, val, "Disk writemin set");
1001 /**************************************************************************//**
1002 * Set number of octets per second read from a disk or partition;
1003 * provide the average measurement within the measurement interval
1005 * @note The property is treated as immutable: it is only valid to call
1006 * the setter once. However, we don't assert if the caller tries to
1007 * overwrite, just ignoring the update instead.
1009 * @param disk_use Pointer to the Disk Use.
1011 *****************************************************************************/
1012 void evel_measurement_disk_use_octetsreadavg_set(MEASUREMENT_DISK_USE * const disk_use,
1016 evel_set_option_double(&disk_use->octetsreadavg, val, "Octets readavg set");
1020 /**************************************************************************//**
1021 * Set number of octets per second read from a disk or partition;
1022 * provide the last measurement within the measurement interval
1024 * @note The property is treated as immutable: it is only valid to call
1025 * the setter once. However, we don't assert if the caller tries to
1026 * overwrite, just ignoring the update instead.
1028 * @param disk_use Pointer to the Disk Use.
1030 *****************************************************************************/
1031 void evel_measurement_disk_use_octetsreadlast_set(MEASUREMENT_DISK_USE * const disk_use,
1035 evel_set_option_double(&disk_use->octetsreadlast, val, "Octets readlast set");
1039 /**************************************************************************//**
1040 * Set number of octets per second read from a disk or partition;
1041 * provide the maximum measurement within the measurement interval
1043 * @note The property is treated as immutable: it is only valid to call
1044 * the setter once. However, we don't assert if the caller tries to
1045 * overwrite, just ignoring the update instead.
1047 * @param disk_use Pointer to the Disk Use.
1049 *****************************************************************************/
1050 void evel_measurement_disk_use_octetsreadmax_set(MEASUREMENT_DISK_USE * const disk_use,
1054 evel_set_option_double(&disk_use->octetsreadmax, val, "Octets readmax set");
1057 /**************************************************************************//**
1058 * Set number of octets per second read from a disk or partition;
1059 * provide the minimum measurement within the measurement interval
1061 * @note The property is treated as immutable: it is only valid to call
1062 * the setter once. However, we don't assert if the caller tries to
1063 * overwrite, just ignoring the update instead.
1065 * @param disk_use Pointer to the Disk Use.
1067 *****************************************************************************/
1068 void evel_measurement_disk_use_octetsreadmin_set(MEASUREMENT_DISK_USE * const disk_use,
1072 evel_set_option_double(&disk_use->octetsreadmin, val, "Octets readmin set");
1075 /**************************************************************************//**
1076 * Set number of octets per second written to a disk or partition;
1077 * provide the average measurement within the measurement interval
1079 * @note The property is treated as immutable: it is only valid to call
1080 * the setter once. However, we don't assert if the caller tries to
1081 * overwrite, just ignoring the update instead.
1083 * @param disk_use Pointer to the Disk Use.
1085 *****************************************************************************/
1086 void evel_measurement_disk_use_octetswriteavg_set(MEASUREMENT_DISK_USE * const disk_use,
1090 evel_set_option_double(&disk_use->octetswriteavg, val, "Octets writeavg set");
1093 /**************************************************************************//**
1094 * Set number of octets per second written to a disk or partition;
1095 * provide the last measurement within the measurement interval
1097 * @note The property is treated as immutable: it is only valid to call
1098 * the setter once. However, we don't assert if the caller tries to
1099 * overwrite, just ignoring the update instead.
1101 * @param disk_use Pointer to the Disk Use.
1103 *****************************************************************************/
1104 void evel_measurement_disk_use_octetswritelast_set(MEASUREMENT_DISK_USE * const disk_use,
1108 evel_set_option_double(&disk_use->octetswritelast, val, "Octets writelast set");
1111 /**************************************************************************//**
1112 * Set number of octets per second written to a disk or partition;
1113 * provide the maximum measurement within the measurement interval
1115 * @note The property is treated as immutable: it is only valid to call
1116 * the setter once. However, we don't assert if the caller tries to
1117 * overwrite, just ignoring the update instead.
1119 * @param disk_use Pointer to the Disk Use.
1121 *****************************************************************************/
1122 void evel_measurement_disk_use_octetswritemax_set(MEASUREMENT_DISK_USE * const disk_use,
1126 evel_set_option_double(&disk_use->octetswritemax, val, "Octets writemax set");
1129 /**************************************************************************//**
1130 * Set number of octets per second written to a disk or partition;
1131 * provide the minimum measurement within the measurement interval
1133 * @note The property is treated as immutable: it is only valid to call
1134 * the setter once. However, we don't assert if the caller tries to
1135 * overwrite, just ignoring the update instead.
1137 * @param disk_use Pointer to the Disk Use.
1139 *****************************************************************************/
1140 void evel_measurement_disk_use_octetswritemin_set(MEASUREMENT_DISK_USE * const disk_use,
1144 evel_set_option_double(&disk_use->octetswritemin, val, "Octets writemin set");
1148 /**************************************************************************//**
1149 * Set number of read operations per second issued to the disk;
1150 * provide the average measurement within the measurement interval
1152 * @note The property is treated as immutable: it is only valid to call
1153 * the setter once. However, we don't assert if the caller tries to
1154 * overwrite, just ignoring the update instead.
1156 * @param disk_use Pointer to the Disk Use.
1158 *****************************************************************************/
1159 void evel_measurement_disk_use_opsreadavg_set(MEASUREMENT_DISK_USE * const disk_use,
1163 evel_set_option_double(&disk_use->opsreadavg, val, "Disk read operation average set");
1166 /**************************************************************************//**
1167 * Set number of read operations per second issued to the disk;
1168 * provide the last measurement within the measurement interval
1170 * @note The property is treated as immutable: it is only valid to call
1171 * the setter once. However, we don't assert if the caller tries to
1172 * overwrite, just ignoring the update instead.
1174 * @param disk_use Pointer to the Disk Use.
1176 *****************************************************************************/
1177 void evel_measurement_disk_use_opsreadlast_set(MEASUREMENT_DISK_USE * const disk_use,
1181 evel_set_option_double(&disk_use->opsreadlast, val, "Disk read operation last set");
1184 /**************************************************************************//**
1185 * Set number of read operations per second issued to the disk;
1186 * provide the maximum measurement within the measurement interval
1188 * @note The property is treated as immutable: it is only valid to call
1189 * the setter once. However, we don't assert if the caller tries to
1190 * overwrite, just ignoring the update instead.
1192 * @param disk_use Pointer to the Disk Use.
1194 *****************************************************************************/
1195 void evel_measurement_disk_use_opsreadmax_set(MEASUREMENT_DISK_USE * const disk_use,
1199 evel_set_option_double(&disk_use->opsreadmax, val, "Disk read operation maximum set");
1202 /**************************************************************************//**
1203 * Set number of read operations per second issued to the disk;
1204 * provide the minimum measurement within the measurement interval
1206 * @note The property is treated as immutable: it is only valid to call
1207 * the setter once. However, we don't assert if the caller tries to
1208 * overwrite, just ignoring the update instead.
1210 * @param disk_use Pointer to the Disk Use.
1212 *****************************************************************************/
1213 void evel_measurement_disk_use_opsreadmin_set(MEASUREMENT_DISK_USE * const disk_use,
1217 evel_set_option_double(&disk_use->opsreadmin, val, "Disk read operation minimum set");
1220 /**************************************************************************//**
1221 * Set number of write operations per second issued to the disk;
1222 * provide the average measurement within the measurement interval
1224 * @note The property is treated as immutable: it is only valid to call
1225 * the setter once. However, we don't assert if the caller tries to
1226 * overwrite, just ignoring the update instead.
1228 * @param disk_use Pointer to the Disk Use.
1230 *****************************************************************************/
1231 void evel_measurement_disk_use_opswriteavg_set(MEASUREMENT_DISK_USE * const disk_use,
1235 evel_set_option_double(&disk_use->opswriteavg, val, "Disk write operation average set");
1238 /**************************************************************************//**
1239 * Set number of write operations per second issued to the disk;
1240 * provide the last measurement within the measurement interval
1242 * @note The property is treated as immutable: it is only valid to call
1243 * the setter once. However, we don't assert if the caller tries to
1244 * overwrite, just ignoring the update instead.
1246 * @param disk_use Pointer to the Disk Use.
1248 *****************************************************************************/
1249 void evel_measurement_disk_use_opswritelast_set(MEASUREMENT_DISK_USE * const disk_use,
1253 evel_set_option_double(&disk_use->opswritelast, val, "Disk write operation last set");
1257 /**************************************************************************//**
1258 * Set number of write operations per second issued to the disk;
1259 * provide the maximum measurement within the measurement interval
1261 * @note The property is treated as immutable: it is only valid to call
1262 * the setter once. However, we don't assert if the caller tries to
1263 * overwrite, just ignoring the update instead.
1265 * @param disk_use Pointer to the Disk Use.
1267 *****************************************************************************/
1268 void evel_measurement_disk_use_opswritemax_set(MEASUREMENT_DISK_USE * const disk_use,
1272 evel_set_option_double(&disk_use->opswritemax, val, "Disk write operation maximum set");
1275 /**************************************************************************//**
1276 * Set number of write operations per second issued to the disk;
1277 * provide the average measurement within the measurement interval
1279 * @note The property is treated as immutable: it is only valid to call
1280 * the setter once. However, we don't assert if the caller tries to
1281 * overwrite, just ignoring the update instead.
1283 * @param disk_use Pointer to the Disk Use.
1285 *****************************************************************************/
1286 void evel_measurement_disk_use_opswritemin_set(MEASUREMENT_DISK_USE * const disk_use,
1290 evel_set_option_double(&disk_use->opswritemin, val, "Disk write operation minimum set");
1294 /**************************************************************************//**
1295 * Set queue size of pending I/O operations per second;
1296 * provide the average measurement within the measurement interval
1298 * @note The property is treated as immutable: it is only valid to call
1299 * the setter once. However, we don't assert if the caller tries to
1300 * overwrite, just ignoring the update instead.
1302 * @param disk_use Pointer to the Disk Use.
1304 *****************************************************************************/
1305 void evel_measurement_disk_use_pendingopsavg_set(MEASUREMENT_DISK_USE * const disk_use,
1309 evel_set_option_double(&disk_use->pendingopsavg, val, "Disk pending operation average set");
1312 /**************************************************************************//**
1313 * Set queue size of pending I/O operations per second;
1314 * provide the last measurement within the measurement interval
1316 * @note The property is treated as immutable: it is only valid to call
1317 * the setter once. However, we don't assert if the caller tries to
1318 * overwrite, just ignoring the update instead.
1320 * @param disk_use Pointer to the Disk Use.
1322 *****************************************************************************/
1323 void evel_measurement_disk_use_pendingopslast_set(MEASUREMENT_DISK_USE * const disk_use,
1327 evel_set_option_double(&disk_use->pendingopslast, val, "Disk pending operation last set");
1330 /**************************************************************************//**
1331 * Set queue size of pending I/O operations per second;
1332 * provide the maximum measurement within the measurement interval
1334 * @note The property is treated as immutable: it is only valid to call
1335 * the setter once. However, we don't assert if the caller tries to
1336 * overwrite, just ignoring the update instead.
1338 * @param disk_use Pointer to the Disk Use.
1340 *****************************************************************************/
1341 void evel_measurement_disk_use_pendingopsmax_set(MEASUREMENT_DISK_USE * const disk_use,
1345 evel_set_option_double(&disk_use->pendingopsmax, val, "Disk pending operation maximum set");
1348 /**************************************************************************//**
1349 * Set queue size of pending I/O operations per second;
1350 * provide the minimum measurement within the measurement interval
1352 * @note The property is treated as immutable: it is only valid to call
1353 * the setter once. However, we don't assert if the caller tries to
1354 * overwrite, just ignoring the update instead.
1356 * @param disk_use Pointer to the Disk Use.
1358 *****************************************************************************/
1359 void evel_measurement_disk_use_pendingopsmin_set(MEASUREMENT_DISK_USE * const disk_use,
1363 evel_set_option_double(&disk_use->pendingopsmin, val, "Disk pending operation min set");
1367 /**************************************************************************//**
1368 * Set milliseconds a read operation took to complete;
1369 * provide the average measurement within the measurement interval
1371 * @note The property is treated as immutable: it is only valid to call
1372 * the setter once. However, we don't assert if the caller tries to
1373 * overwrite, just ignoring the update instead.
1375 * @param disk_use Pointer to the Disk Use.
1377 *****************************************************************************/
1378 void evel_measurement_disk_use_timereadavg_set(MEASUREMENT_DISK_USE * const disk_use,
1382 evel_set_option_double(&disk_use->timereadavg, val, "Disk read time average set");
1385 /**************************************************************************//**
1386 * Set milliseconds a read operation took to complete;
1387 * provide the last measurement within the measurement interval
1389 * @note The property is treated as immutable: it is only valid to call
1390 * the setter once. However, we don't assert if the caller tries to
1391 * overwrite, just ignoring the update instead.
1393 * @param disk_use Pointer to the Disk Use.
1395 *****************************************************************************/
1396 void evel_measurement_disk_use_timereadlast_set(MEASUREMENT_DISK_USE * const disk_use,
1400 evel_set_option_double(&disk_use->timereadlast, val, "Disk read time last set");
1403 /**************************************************************************//**
1404 * Set milliseconds a read operation took to complete;
1405 * provide the maximum measurement within the measurement interval
1407 * @note The property is treated as immutable: it is only valid to call
1408 * the setter once. However, we don't assert if the caller tries to
1409 * overwrite, just ignoring the update instead.
1411 * @param disk_use Pointer to the Disk Use.
1413 *****************************************************************************/
1414 void evel_measurement_disk_use_timereadmax_set(MEASUREMENT_DISK_USE * const disk_use,
1418 evel_set_option_double(&disk_use->timereadmax, val, "Disk read time maximum set");
1421 /**************************************************************************//**
1422 * Set milliseconds a read operation took to complete;
1423 * provide the minimum measurement within the measurement interval
1425 * @note The property is treated as immutable: it is only valid to call
1426 * the setter once. However, we don't assert if the caller tries to
1427 * overwrite, just ignoring the update instead.
1429 * @param disk_use Pointer to the Disk Use.
1431 *****************************************************************************/
1432 void evel_measurement_disk_use_timereadmin_set(MEASUREMENT_DISK_USE * const disk_use,
1436 evel_set_option_double(&disk_use->timereadmin, val, "Disk read time minimum set");
1439 /**************************************************************************//**
1440 * Set milliseconds a write operation took to complete;
1441 * provide the average measurement within the measurement interval
1443 * @note The property is treated as immutable: it is only valid to call
1444 * the setter once. However, we don't assert if the caller tries to
1445 * overwrite, just ignoring the update instead.
1447 * @param disk_use Pointer to the Disk Use.
1449 *****************************************************************************/
1450 void evel_measurement_disk_use_timewriteavg_set(MEASUREMENT_DISK_USE * const disk_use,
1454 evel_set_option_double(&disk_use->timewriteavg, val, "Disk write time average set");
1458 /**************************************************************************//**
1459 * Set milliseconds a write operation took to complete;
1460 * provide the last measurement within the measurement interval
1462 * @note The property is treated as immutable: it is only valid to call
1463 * the setter once. However, we don't assert if the caller tries to
1464 * overwrite, just ignoring the update instead.
1466 * @param disk_use Pointer to the Disk Use.
1468 *****************************************************************************/
1469 void evel_measurement_disk_use_timewritelast_set(MEASUREMENT_DISK_USE * const disk_use,
1473 evel_set_option_double(&disk_use->timewritelast, val, "Disk write time last set");
1476 /**************************************************************************//**
1477 * Set milliseconds a write operation took to complete;
1478 * provide the maximum measurement within the measurement interval
1480 * @note The property is treated as immutable: it is only valid to call
1481 * the setter once. However, we don't assert if the caller tries to
1482 * overwrite, just ignoring the update instead.
1484 * @param disk_use Pointer to the Disk Use.
1486 *****************************************************************************/
1487 void evel_measurement_disk_use_timewritemax_set(MEASUREMENT_DISK_USE * const disk_use,
1491 evel_set_option_double(&disk_use->timewritemax, val, "Disk write time max set");
1494 /**************************************************************************//**
1495 * Set milliseconds a write operation took to complete;
1496 * provide the average measurement within the measurement interval
1498 * @note The property is treated as immutable: it is only valid to call
1499 * the setter once. However, we don't assert if the caller tries to
1500 * overwrite, just ignoring the update instead.
1502 * @param disk_use Pointer to the Disk Use.
1504 *****************************************************************************/
1505 void evel_measurement_disk_use_timewritemin_set(MEASUREMENT_DISK_USE * const disk_use,
1509 evel_set_option_double(&disk_use->timewritemin, val, "Disk write time min set");
1513 /**************************************************************************//**
1514 * Add an additional File System usage value name/value pair to the
1517 * The filesystem_name is null delimited ASCII string. The library takes a
1518 * copy so the caller does not have to preserve values after the function
1521 * @param measurement Pointer to the measurement.
1522 * @param filesystem_name ASCIIZ string with the file-system's UUID.
1523 * @param block_configured Block storage configured.
1524 * @param block_used Block storage in use.
1525 * @param block_iops Block storage IOPS.
1526 * @param ephemeral_configured Ephemeral storage configured.
1527 * @param ephemeral_used Ephemeral storage in use.
1528 * @param ephemeral_iops Ephemeral storage IOPS.
1529 *****************************************************************************/
1530 void evel_measurement_fsys_use_add(EVENT_MEASUREMENT * measurement,
1531 char * filesystem_name,
1532 double block_configured,
1535 double ephemeral_configured,
1536 double ephemeral_used,
1539 MEASUREMENT_FSYS_USE * fsys_use = NULL;
1542 /***************************************************************************/
1543 /* Check assumptions. */
1544 /***************************************************************************/
1545 assert(measurement != NULL);
1546 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1547 assert(filesystem_name != NULL);
1548 assert(block_configured >= 0.0);
1549 assert(block_used >= 0.0);
1550 assert(block_iops >= 0);
1551 assert(ephemeral_configured >= 0.0);
1552 assert(ephemeral_used >= 0.0);
1553 assert(ephemeral_iops >= 0);
1555 /***************************************************************************/
1556 /* Allocate a container for the value and push onto the list. */
1557 /***************************************************************************/
1558 EVEL_DEBUG("Adding filesystem_name=%s", filesystem_name);
1559 fsys_use = malloc(sizeof(MEASUREMENT_FSYS_USE));
1560 assert(fsys_use != NULL);
1561 memset(fsys_use, 0, sizeof(MEASUREMENT_FSYS_USE));
1562 fsys_use->filesystem_name = strdup(filesystem_name);
1563 fsys_use->block_configured = block_configured;
1564 fsys_use->block_used = block_used;
1565 fsys_use->block_iops = block_iops;
1566 fsys_use->ephemeral_configured = block_configured;
1567 fsys_use->ephemeral_used = ephemeral_used;
1568 fsys_use->ephemeral_iops = ephemeral_iops;
1570 dlist_push_last(&measurement->filesystem_usage, fsys_use);
1575 /**************************************************************************//**
1576 * Add a Feature usage value name/value pair to the Measurement.
1578 * The name is null delimited ASCII string. The library takes
1579 * a copy so the caller does not have to preserve values after the function
1582 * @param measurement Pointer to the measurement.
1583 * @param feature ASCIIZ string with the feature's name.
1584 * @param utilization Utilization of the feature.
1585 *****************************************************************************/
1586 void evel_measurement_feature_use_add(EVENT_MEASUREMENT * measurement,
1590 MEASUREMENT_FEATURE_USE * feature_use = NULL;
1593 /***************************************************************************/
1594 /* Check assumptions. */
1595 /***************************************************************************/
1596 assert(measurement != NULL);
1597 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1598 assert(feature != NULL);
1599 assert(utilization >= 0);
1601 /***************************************************************************/
1602 /* Allocate a container for the value and push onto the list. */
1603 /***************************************************************************/
1604 EVEL_DEBUG("Adding Feature=%s Use=%d", feature, utilization);
1605 feature_use = malloc(sizeof(MEASUREMENT_FEATURE_USE));
1606 assert(feature_use != NULL);
1607 memset(feature_use, 0, sizeof(MEASUREMENT_FEATURE_USE));
1608 feature_use->feature_id = strdup(feature);
1609 assert(feature_use->feature_id != NULL);
1610 feature_use->feature_utilization = utilization;
1612 dlist_push_last(&measurement->feature_usage, feature_use);
1617 /**************************************************************************//**
1618 * Add a Additional Measurement value name/value pair to the Report.
1620 * The name is null delimited ASCII string. The library takes
1621 * a copy so the caller does not have to preserve values after the function
1624 * @param measurement Pointer to the Measaurement.
1625 * @param group ASCIIZ string with the measurement group's name.
1626 * @param name ASCIIZ string containing the measurement's name.
1627 * @param value ASCIIZ string containing the measurement's value.
1628 *****************************************************************************/
1629 void evel_measurement_custom_measurement_add(EVENT_MEASUREMENT * measurement,
1630 const char * const group,
1631 const char * const name,
1632 const char * const value)
1634 MEASUREMENT_GROUP * measurement_group = NULL;
1635 CUSTOM_MEASUREMENT * custom_measurement = NULL;
1636 DLIST_ITEM * item = NULL;
1639 /***************************************************************************/
1640 /* Check assumptions. */
1641 /***************************************************************************/
1642 assert(measurement != NULL);
1643 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1644 assert(group != NULL);
1645 assert(name != NULL);
1646 assert(value != NULL);
1648 /***************************************************************************/
1649 /* Allocate a container for the name/value pair. */
1650 /***************************************************************************/
1651 EVEL_DEBUG("Adding Measurement Group=%s Name=%s Value=%s",
1652 group, name, value);
1653 custom_measurement = malloc(sizeof(CUSTOM_MEASUREMENT));
1654 assert(custom_measurement != NULL);
1655 memset(custom_measurement, 0, sizeof(CUSTOM_MEASUREMENT));
1656 custom_measurement->name = strdup(name);
1657 assert(custom_measurement->name != NULL);
1658 custom_measurement->value = strdup(value);
1659 assert(custom_measurement->value != NULL);
1661 /***************************************************************************/
1662 /* See if we have that group already. */
1663 /***************************************************************************/
1664 item = dlist_get_first(&measurement->additional_measurements);
1665 while (item != NULL)
1667 measurement_group = (MEASUREMENT_GROUP *) item->item;
1668 assert(measurement_group != NULL);
1670 EVEL_DEBUG("Got measurement group %s", measurement_group->name);
1671 if (strcmp(group, measurement_group->name) == 0)
1673 EVEL_DEBUG("Found existing Measurement Group");
1676 item = dlist_get_next(item);
1679 /***************************************************************************/
1680 /* If we didn't have the group already, create it. */
1681 /***************************************************************************/
1684 EVEL_DEBUG("Creating new Measurement Group");
1685 measurement_group = malloc(sizeof(MEASUREMENT_GROUP));
1686 assert(measurement_group != NULL);
1687 memset(measurement_group, 0, sizeof(MEASUREMENT_GROUP));
1688 measurement_group->name = strdup(group);
1689 assert(measurement_group->name != NULL);
1690 dlist_initialize(&measurement_group->measurements);
1691 dlist_push_last(&measurement->additional_measurements, measurement_group);
1694 /***************************************************************************/
1695 /* If we didn't have the group already, create it. */
1696 /***************************************************************************/
1697 dlist_push_last(&measurement_group->measurements, custom_measurement);
1702 /**************************************************************************//**
1703 * Add a Codec usage value name/value pair to the Measurement.
1705 * The name is null delimited ASCII string. The library takes
1706 * a copy so the caller does not have to preserve values after the function
1709 * @param measurement Pointer to the measurement.
1710 * @param codec ASCIIZ string with the codec's name.
1711 * @param utilization Number of codecs in use.
1712 *****************************************************************************/
1713 void evel_measurement_codec_use_add(EVENT_MEASUREMENT * measurement,
1717 MEASUREMENT_CODEC_USE * codec_use = NULL;
1720 /***************************************************************************/
1721 /* Check assumptions. */
1722 /***************************************************************************/
1723 assert(measurement != NULL);
1724 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1725 assert(codec != NULL);
1726 assert(utilization >= 0.0);
1728 /***************************************************************************/
1729 /* Allocate a container for the value and push onto the list. */
1730 /***************************************************************************/
1731 EVEL_DEBUG("Adding Codec=%s Use=%d", codec, utilization);
1732 codec_use = malloc(sizeof(MEASUREMENT_CODEC_USE));
1733 assert(codec_use != NULL);
1734 memset(codec_use, 0, sizeof(MEASUREMENT_CODEC_USE));
1735 codec_use->codec_id = strdup(codec);
1736 assert(codec_use->codec_id != NULL);
1737 codec_use->number_in_use = utilization;
1739 dlist_push_last(&measurement->codec_usage, codec_use);
1745 /**************************************************************************//**
1746 * Set the Media Ports in Use property of the Measurement.
1748 * @note The property is treated as immutable: it is only valid to call
1749 * the setter once. However, we don't assert if the caller tries to
1750 * overwrite, just ignoring the update instead.
1752 * @param measurement Pointer to the measurement.
1753 * @param media_ports_in_use The media port usage to set.
1754 *****************************************************************************/
1755 void evel_measurement_media_port_use_set(EVENT_MEASUREMENT * measurement,
1756 int media_ports_in_use)
1760 /***************************************************************************/
1761 /* Check preconditions. */
1762 /***************************************************************************/
1763 assert(measurement != NULL);
1764 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1765 assert(media_ports_in_use >= 0);
1767 evel_set_option_int(&measurement->media_ports_in_use,
1769 "Media Ports In Use");
1773 /**************************************************************************//**
1774 * Set the VNFC Scaling Metric property of the Measurement.
1776 * @note The property is treated as immutable: it is only valid to call
1777 * the setter once. However, we don't assert if the caller tries to
1778 * overwrite, just ignoring the update instead.
1780 * @param measurement Pointer to the measurement.
1781 * @param scaling_metric The scaling metric to set.
1782 *****************************************************************************/
1783 void evel_measurement_vnfc_scaling_metric_set(EVENT_MEASUREMENT * measurement,
1788 /***************************************************************************/
1789 /* Check preconditions. */
1790 /***************************************************************************/
1791 assert(measurement != NULL);
1792 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1793 assert(scaling_metric >= 0.0);
1795 evel_set_option_int(&measurement->vnfc_scaling_metric,
1797 "VNFC Scaling Metric");
1801 /**************************************************************************//**
1802 * Create a new Latency Bucket to be added to a Measurement event.
1804 * @note The mandatory fields on the ::MEASUREMENT_LATENCY_BUCKET must be
1805 * supplied to this factory function and are immutable once set.
1806 * Optional fields have explicit setter functions, but again values
1807 * may only be set once so that the ::MEASUREMENT_LATENCY_BUCKET has
1808 * immutable properties.
1810 * @param count Count of events in this bucket.
1812 * @returns pointer to the newly manufactured ::MEASUREMENT_LATENCY_BUCKET.
1813 * If the structure is not used it must be released using free.
1814 * @retval NULL Failed to create the Latency Bucket.
1815 *****************************************************************************/
1816 MEASUREMENT_LATENCY_BUCKET * evel_new_meas_latency_bucket(const int count)
1818 MEASUREMENT_LATENCY_BUCKET * bucket;
1822 /***************************************************************************/
1823 /* Check preconditions. */
1824 /***************************************************************************/
1827 /***************************************************************************/
1828 /* Allocate, then set Mandatory Parameters. */
1829 /***************************************************************************/
1830 EVEL_DEBUG("Creating bucket, count = %d", count);
1831 bucket = malloc(sizeof(MEASUREMENT_LATENCY_BUCKET));
1832 assert(bucket != NULL);
1834 /***************************************************************************/
1835 /* Set Mandatory Parameters. */
1836 /***************************************************************************/
1837 bucket->count = count;
1839 /***************************************************************************/
1840 /* Initialize Optional Parameters. */
1841 /***************************************************************************/
1842 evel_init_option_double(&bucket->high_end);
1843 evel_init_option_double(&bucket->low_end);
1850 /**************************************************************************//**
1851 * Set the High End property of the Measurement Latency Bucket.
1853 * @note The property is treated as immutable: it is only valid to call
1854 * the setter once. However, we don't assert if the caller tries to
1855 * overwrite, just ignoring the update instead.
1857 * @param bucket Pointer to the Measurement Latency Bucket.
1858 * @param high_end High end of the bucket's range.
1859 *****************************************************************************/
1860 void evel_meas_latency_bucket_high_end_set(
1861 MEASUREMENT_LATENCY_BUCKET * const bucket,
1862 const double high_end)
1866 /***************************************************************************/
1867 /* Check preconditions. */
1868 /***************************************************************************/
1869 assert(high_end >= 0.0);
1870 evel_set_option_double(&bucket->high_end, high_end, "High End");
1875 /**************************************************************************//**
1876 * Set the Low End property of the Measurement Latency Bucket.
1878 * @note The property is treated as immutable: it is only valid to call
1879 * the setter once. However, we don't assert if the caller tries to
1880 * overwrite, just ignoring the update instead.
1882 * @param bucket Pointer to the Measurement Latency Bucket.
1883 * @param low_end Low end of the bucket's range.
1884 *****************************************************************************/
1885 void evel_meas_latency_bucket_low_end_set(
1886 MEASUREMENT_LATENCY_BUCKET * const bucket,
1887 const double low_end)
1891 /***************************************************************************/
1892 /* Check preconditions. */
1893 /***************************************************************************/
1894 assert(low_end >= 0.0);
1895 evel_set_option_double(&bucket->low_end, low_end, "Low End");
1899 /**************************************************************************//**
1900 * Add an additional Measurement Latency Bucket to the specified event.
1902 * @param measurement Pointer to the Measurement event.
1903 * @param bucket Pointer to the Measurement Latency Bucket to add.
1904 *****************************************************************************/
1905 void evel_meas_latency_bucket_add(EVENT_MEASUREMENT * const measurement,
1906 MEASUREMENT_LATENCY_BUCKET * const bucket)
1910 /***************************************************************************/
1911 /* Check preconditions. */
1912 /***************************************************************************/
1913 assert(measurement != NULL);
1914 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1915 assert(bucket != NULL);
1916 dlist_push_last(&measurement->latency_distribution, bucket);
1921 /**************************************************************************//**
1922 * Add an additional Latency Distribution bucket to the Measurement.
1924 * This function implements the previous API, purely for convenience.
1926 * @param measurement Pointer to the measurement.
1927 * @param low_end Low end of the bucket's range.
1928 * @param high_end High end of the bucket's range.
1929 * @param count Count of events in this bucket.
1930 *****************************************************************************/
1931 void evel_measurement_latency_add(EVENT_MEASUREMENT * const measurement,
1932 const double low_end,
1933 const double high_end,
1936 MEASUREMENT_LATENCY_BUCKET * bucket = NULL;
1940 /***************************************************************************/
1941 /* Trust the assertions in the underlying methods. */
1942 /***************************************************************************/
1943 bucket = evel_new_meas_latency_bucket(count);
1944 evel_meas_latency_bucket_low_end_set(bucket, low_end);
1945 evel_meas_latency_bucket_high_end_set(bucket, high_end);
1946 evel_meas_latency_bucket_add(measurement, bucket);
1951 /**************************************************************************//**
1952 * Create a new vNIC Use to be added to a Measurement event.
1954 * @note The mandatory fields on the ::MEASUREMENT_VNIC_PERFORMANCE must be supplied
1955 * to this factory function and are immutable once set. Optional
1956 * fields have explicit setter functions, but again values may only be
1957 * set once so that the ::MEASUREMENT_VNIC_PERFORMANCE has immutable
1960 * @param vnic_id ASCIIZ string with the vNIC's ID.
1961 * @param val_suspect True or false confidence in data.
1963 * @returns pointer to the newly manufactured ::MEASUREMENT_VNIC_PERFORMANCE.
1964 * If the structure is not used it must be released using
1965 * ::evel_measurement_free_vnic_performance.
1966 * @retval NULL Failed to create the vNIC Use.
1967 *****************************************************************************/
1968 MEASUREMENT_VNIC_PERFORMANCE * evel_measurement_new_vnic_performance(char * const vnic_id,
1969 char * const val_suspect)
1971 MEASUREMENT_VNIC_PERFORMANCE * vnic_performance;
1975 /***************************************************************************/
1976 /* Check preconditions. */
1977 /***************************************************************************/
1978 assert(vnic_id != NULL);
1979 assert(!strcmp(val_suspect,"true") || !strcmp(val_suspect,"false"));
1981 /***************************************************************************/
1982 /* Allocate, then set Mandatory Parameters. */
1983 /***************************************************************************/
1984 EVEL_DEBUG("Adding VNIC ID=%s", vnic_id);
1985 vnic_performance = malloc(sizeof(MEASUREMENT_VNIC_PERFORMANCE));
1986 assert(vnic_performance != NULL);
1987 vnic_performance->vnic_id = strdup(vnic_id);
1988 vnic_performance->valuesaresuspect = strdup(val_suspect);
1990 /***************************************************************************/
1991 /* Initialize Optional Parameters. */
1992 /***************************************************************************/
1993 evel_init_option_double(&vnic_performance-> recvd_bcast_packets_acc);
1994 evel_init_option_double(&vnic_performance-> recvd_bcast_packets_delta);
1995 evel_init_option_double(&vnic_performance-> recvd_discarded_packets_acc);
1996 evel_init_option_double(&vnic_performance-> recvd_discarded_packets_delta);
1997 evel_init_option_double(&vnic_performance-> recvd_error_packets_acc);
1998 evel_init_option_double(&vnic_performance-> recvd_error_packets_delta);
1999 evel_init_option_double(&vnic_performance-> recvd_mcast_packets_acc);
2000 evel_init_option_double(&vnic_performance-> recvd_mcast_packets_delta);
2001 evel_init_option_double(&vnic_performance-> recvd_octets_acc);
2002 evel_init_option_double(&vnic_performance-> recvd_octets_delta);
2003 evel_init_option_double(&vnic_performance-> recvd_total_packets_acc);
2004 evel_init_option_double(&vnic_performance-> recvd_total_packets_delta);
2005 evel_init_option_double(&vnic_performance-> recvd_ucast_packets_acc);
2006 evel_init_option_double(&vnic_performance-> recvd_ucast_packets_delta);
2007 evel_init_option_double(&vnic_performance-> tx_bcast_packets_acc);
2008 evel_init_option_double(&vnic_performance-> tx_bcast_packets_delta);
2009 evel_init_option_double(&vnic_performance-> tx_discarded_packets_acc);
2010 evel_init_option_double(&vnic_performance-> tx_discarded_packets_delta);
2011 evel_init_option_double(&vnic_performance-> tx_error_packets_acc);
2012 evel_init_option_double(&vnic_performance-> tx_error_packets_delta);
2013 evel_init_option_double(&vnic_performance-> tx_mcast_packets_acc);
2014 evel_init_option_double(&vnic_performance-> tx_mcast_packets_delta);
2015 evel_init_option_double(&vnic_performance-> tx_octets_acc);
2016 evel_init_option_double(&vnic_performance-> tx_octets_delta);
2017 evel_init_option_double(&vnic_performance-> tx_total_packets_acc);
2018 evel_init_option_double(&vnic_performance-> tx_total_packets_delta);
2019 evel_init_option_double(&vnic_performance-> tx_ucast_packets_acc);
2020 evel_init_option_double(&vnic_performance-> tx_ucast_packets_delta);
2024 return vnic_performance;
2027 /**************************************************************************//**
2030 * Free off the ::MEASUREMENT_VNIC_PERFORMANCE supplied. Will free all the contained
2033 * @note It does not free the vNIC Use itself, since that may be part of a
2035 *****************************************************************************/
2036 void evel_measurement_free_vnic_performance(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance)
2040 /***************************************************************************/
2041 /* Check preconditions. */
2042 /***************************************************************************/
2043 assert(vnic_performance != NULL);
2044 assert(vnic_performance->vnic_id != NULL);
2045 assert(vnic_performance->valuesaresuspect != NULL);
2047 /***************************************************************************/
2048 /* Free the duplicated string. */
2049 /***************************************************************************/
2050 free(vnic_performance->vnic_id);
2051 free(vnic_performance->valuesaresuspect);
2052 vnic_performance->vnic_id = NULL;
2057 /**************************************************************************//**
2058 * Set the Accumulated Broadcast Packets Received in measurement interval
2059 * property of the vNIC performance.
2061 * @note The property is treated as immutable: it is only valid to call
2062 * the setter once. However, we don't assert if the caller tries to
2063 * overwrite, just ignoring the update instead.
2065 * @param vnic_performance Pointer to the vNIC Use.
2066 * @param recvd_bcast_packets_acc
2067 *****************************************************************************/
2068 void evel_vnic_performance_rx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2069 const double recvd_bcast_packets_acc)
2073 /***************************************************************************/
2074 /* Check preconditions. */
2075 /***************************************************************************/
2076 assert(recvd_bcast_packets_acc >= 0.0);
2078 evel_set_option_double(&vnic_performance->recvd_bcast_packets_acc,
2079 recvd_bcast_packets_acc,
2080 "Broadcast Packets accumulated");
2085 /**************************************************************************//**
2086 * Set the Delta Broadcast Packets Received in measurement interval
2087 * property of the vNIC performance.
2089 * @note The property is treated as immutable: it is only valid to call
2090 * the setter once. However, we don't assert if the caller tries to
2091 * overwrite, just ignoring the update instead.
2093 * @param vnic_performance Pointer to the vNIC Use.
2094 * @param recvd_bcast_packets_delta
2095 *****************************************************************************/
2096 void evel_vnic_performance_rx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2097 const double recvd_bcast_packets_delta)
2101 /***************************************************************************/
2102 /* Check preconditions. */
2103 /***************************************************************************/
2104 assert(recvd_bcast_packets_delta >= 0.0);
2106 evel_set_option_double(&vnic_performance->recvd_bcast_packets_delta,
2107 recvd_bcast_packets_delta,
2108 "Delta Broadcast Packets recieved");
2114 /**************************************************************************//**
2115 * Set the Discarded Packets Received in measurement interval
2116 * property of the vNIC performance.
2118 * @note The property is treated as immutable: it is only valid to call
2119 * the setter once. However, we don't assert if the caller tries to
2120 * overwrite, just ignoring the update instead.
2122 * @param vnic_performance Pointer to the vNIC Use.
2123 * @param recvd_discard_packets_acc
2124 *****************************************************************************/
2125 void evel_vnic_performance_rx_discard_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2126 const double recvd_discard_packets_acc)
2130 /***************************************************************************/
2131 /* Check preconditions. */
2132 /***************************************************************************/
2133 assert(recvd_discard_packets_acc >= 0.0);
2135 evel_set_option_double(&vnic_performance->recvd_discarded_packets_acc,
2136 recvd_discard_packets_acc,
2137 "Discarded Packets accumulated");
2142 /**************************************************************************//**
2143 * Set the Delta Discarded Packets Received in measurement interval
2144 * property of the vNIC performance.
2146 * @note The property is treated as immutable: it is only valid to call
2147 * the setter once. However, we don't assert if the caller tries to
2148 * overwrite, just ignoring the update instead.
2150 * @param vnic_performance Pointer to the vNIC Use.
2151 * @param recvd_discard_packets_delta
2152 *****************************************************************************/
2153 void evel_vnic_performance_rx_discard_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2154 const double recvd_discard_packets_delta)
2158 /***************************************************************************/
2159 /* Check preconditions. */
2160 /***************************************************************************/
2161 assert(recvd_discard_packets_delta >= 0.0);
2163 evel_set_option_double(&vnic_performance->recvd_discarded_packets_delta,
2164 recvd_discard_packets_delta,
2165 "Delta Discarded Packets recieved");
2171 /**************************************************************************//**
2172 * Set the Error Packets Received in measurement interval
2173 * property of the vNIC performance.
2175 * @note The property is treated as immutable: it is only valid to call
2176 * the setter once. However, we don't assert if the caller tries to
2177 * overwrite, just ignoring the update instead.
2179 * @param vnic_performance Pointer to the vNIC Use.
2180 * @param recvd_error_packets_acc
2181 *****************************************************************************/
2182 void evel_vnic_performance_rx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2183 const double recvd_error_packets_acc)
2187 /***************************************************************************/
2188 /* Check preconditions. */
2189 /***************************************************************************/
2190 assert(recvd_error_packets_acc >= 0.0);
2192 evel_set_option_double(&vnic_performance->recvd_error_packets_acc,
2193 recvd_error_packets_acc,
2194 "Error Packets received accumulated");
2199 /**************************************************************************//**
2200 * Set the Delta Error Packets Received in measurement interval
2201 * property of the vNIC performance.
2203 * @note The property is treated as immutable: it is only valid to call
2204 * the setter once. However, we don't assert if the caller tries to
2205 * overwrite, just ignoring the update instead.
2207 * @param vnic_performance Pointer to the vNIC Use.
2208 * @param recvd_error_packets_delta
2209 *****************************************************************************/
2210 void evel_vnic_performance_rx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2211 const double recvd_error_packets_delta)
2215 /***************************************************************************/
2216 /* Check preconditions. */
2217 /***************************************************************************/
2218 assert(recvd_error_packets_delta >= 0.0);
2220 evel_set_option_double(&vnic_performance->recvd_error_packets_delta,
2221 recvd_error_packets_delta,
2222 "Delta Error Packets recieved");
2227 /**************************************************************************//**
2228 * Set the Accumulated Multicast Packets Received in measurement interval
2229 * property of the vNIC performance.
2231 * @note The property is treated as immutable: it is only valid to call
2232 * the setter once. However, we don't assert if the caller tries to
2233 * overwrite, just ignoring the update instead.
2235 * @param vnic_performance Pointer to the vNIC Use.
2236 * @param recvd_mcast_packets_acc
2237 *****************************************************************************/
2238 void evel_vnic_performance_rx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2239 const double recvd_mcast_packets_acc)
2243 /***************************************************************************/
2244 /* Check preconditions. */
2245 /***************************************************************************/
2246 assert(recvd_mcast_packets_acc >= 0.0);
2248 evel_set_option_double(&vnic_performance->recvd_mcast_packets_acc,
2249 recvd_mcast_packets_acc,
2250 "Multicast Packets accumulated");
2255 /**************************************************************************//**
2256 * Set the Delta Multicast Packets Received in measurement interval
2257 * property of the vNIC performance.
2259 * @note The property is treated as immutable: it is only valid to call
2260 * the setter once. However, we don't assert if the caller tries to
2261 * overwrite, just ignoring the update instead.
2263 * @param vnic_performance Pointer to the vNIC Use.
2264 * @param recvd_mcast_packets_delta
2265 *****************************************************************************/
2266 void evel_vnic_performance_rx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2267 const double recvd_mcast_packets_delta)
2271 /***************************************************************************/
2272 /* Check preconditions. */
2273 /***************************************************************************/
2274 assert(recvd_mcast_packets_delta >= 0.0);
2276 evel_set_option_double(&vnic_performance->recvd_mcast_packets_delta,
2277 recvd_mcast_packets_delta,
2278 "Delta Multicast Packets recieved");
2283 /**************************************************************************//**
2284 * Set the Accumulated Octets Received in measurement interval
2285 * property of the vNIC performance.
2287 * @note The property is treated as immutable: it is only valid to call
2288 * the setter once. However, we don't assert if the caller tries to
2289 * overwrite, just ignoring the update instead.
2291 * @param vnic_performance Pointer to the vNIC Use.
2292 * @param recvd_octets_acc
2293 *****************************************************************************/
2294 void evel_vnic_performance_rx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2295 const double recvd_octets_acc)
2299 /***************************************************************************/
2300 /* Check preconditions. */
2301 /***************************************************************************/
2302 assert(recvd_octets_acc >= 0.0);
2304 evel_set_option_double(&vnic_performance->recvd_octets_acc,
2306 "Octets received accumulated");
2311 /**************************************************************************//**
2312 * Set the Delta Octets Received in measurement interval
2313 * property of the vNIC performance.
2315 * @note The property is treated as immutable: it is only valid to call
2316 * the setter once. However, we don't assert if the caller tries to
2317 * overwrite, just ignoring the update instead.
2319 * @param vnic_performance Pointer to the vNIC Use.
2320 * @param recvd_octets_delta
2321 *****************************************************************************/
2322 void evel_vnic_performance_rx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2323 const double recvd_octets_delta)
2327 /***************************************************************************/
2328 /* Check preconditions. */
2329 /***************************************************************************/
2330 assert(recvd_octets_delta >= 0.0);
2332 evel_set_option_double(&vnic_performance->recvd_octets_delta,
2334 "Delta Octets recieved");
2339 /**************************************************************************//**
2340 * Set the Accumulated Total Packets Received in measurement interval
2341 * property of the vNIC performance.
2343 * @note The property is treated as immutable: it is only valid to call
2344 * the setter once. However, we don't assert if the caller tries to
2345 * overwrite, just ignoring the update instead.
2347 * @param vnic_performance Pointer to the vNIC Use.
2348 * @param recvd_total_packets_acc
2349 *****************************************************************************/
2350 void evel_vnic_performance_rx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2351 const double recvd_total_packets_acc)
2355 /***************************************************************************/
2356 /* Check preconditions. */
2357 /***************************************************************************/
2358 assert(recvd_total_packets_acc >= 0.0);
2360 evel_set_option_double(&vnic_performance->recvd_total_packets_acc,
2361 recvd_total_packets_acc,
2362 "Total Packets accumulated");
2367 /**************************************************************************//**
2368 * Set the Delta Total Packets Received in measurement interval
2369 * property of the vNIC performance.
2371 * @note The property is treated as immutable: it is only valid to call
2372 * the setter once. However, we don't assert if the caller tries to
2373 * overwrite, just ignoring the update instead.
2375 * @param vnic_performance Pointer to the vNIC Use.
2376 * @param recvd_total_packets_delta
2377 *****************************************************************************/
2378 void evel_vnic_performance_rx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2379 const double recvd_total_packets_delta)
2383 /***************************************************************************/
2384 /* Check preconditions. */
2385 /***************************************************************************/
2386 assert(recvd_total_packets_delta >= 0.0);
2388 evel_set_option_double(&vnic_performance->recvd_total_packets_delta,
2389 recvd_total_packets_delta,
2390 "Delta Total Packets recieved");
2395 /**************************************************************************//**
2396 * Set the Accumulated Unicast Packets Received in measurement interval
2397 * property of the vNIC performance.
2399 * @note The property is treated as immutable: it is only valid to call
2400 * the setter once. However, we don't assert if the caller tries to
2401 * overwrite, just ignoring the update instead.
2403 * @param vnic_performance Pointer to the vNIC Use.
2404 * @param recvd_ucast_packets_acc
2405 *****************************************************************************/
2406 void evel_vnic_performance_rx_ucast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2407 const double recvd_ucast_packets_acc)
2411 /***************************************************************************/
2412 /* Check preconditions. */
2413 /***************************************************************************/
2414 assert(recvd_ucast_packets_acc >= 0.0);
2416 evel_set_option_double(&vnic_performance->recvd_ucast_packets_acc,
2417 recvd_ucast_packets_acc,
2418 "Unicast Packets received accumulated");
2423 /**************************************************************************//**
2424 * Set the Delta Unicast packets Received in measurement interval
2425 * property of the vNIC performance.
2427 * @note The property is treated as immutable: it is only valid to call
2428 * the setter once. However, we don't assert if the caller tries to
2429 * overwrite, just ignoring the update instead.
2431 * @param vnic_performance Pointer to the vNIC Use.
2432 * @param recvd_ucast_packets_delta
2433 *****************************************************************************/
2434 void evel_vnic_performance_rx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2435 const double recvd_ucast_packets_delta)
2439 /***************************************************************************/
2440 /* Check preconditions. */
2441 /***************************************************************************/
2442 assert(recvd_ucast_packets_delta >= 0.0);
2444 evel_set_option_double(&vnic_performance->recvd_ucast_packets_delta,
2445 recvd_ucast_packets_delta,
2446 "Delta Unicast packets recieved");
2451 /**************************************************************************//**
2452 * Set the Transmitted Broadcast Packets in measurement interval
2453 * property of the vNIC performance.
2455 * @note The property is treated as immutable: it is only valid to call
2456 * the setter once. However, we don't assert if the caller tries to
2457 * overwrite, just ignoring the update instead.
2459 * @param vnic_performance Pointer to the vNIC Use.
2460 * @param tx_bcast_packets_acc
2461 *****************************************************************************/
2462 void evel_vnic_performance_tx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2463 const double tx_bcast_packets_acc)
2467 /***************************************************************************/
2468 /* Check preconditions. */
2469 /***************************************************************************/
2470 assert(tx_bcast_packets_acc >= 0.0);
2472 evel_set_option_double(&vnic_performance->tx_bcast_packets_acc,
2473 tx_bcast_packets_acc,
2474 "Transmitted Broadcast Packets accumulated");
2479 /**************************************************************************//**
2480 * Set the Delta Broadcast packets Transmitted in measurement interval
2481 * property of the vNIC performance.
2483 * @note The property is treated as immutable: it is only valid to call
2484 * the setter once. However, we don't assert if the caller tries to
2485 * overwrite, just ignoring the update instead.
2487 * @param vnic_performance Pointer to the vNIC Use.
2488 * @param tx_bcast_packets_delta
2489 *****************************************************************************/
2490 void evel_vnic_performance_tx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2491 const double tx_bcast_packets_delta)
2495 /***************************************************************************/
2496 /* Check preconditions. */
2497 /***************************************************************************/
2498 assert(tx_bcast_packets_delta >= 0.0);
2500 evel_set_option_double(&vnic_performance->tx_bcast_packets_delta,
2501 tx_bcast_packets_delta,
2502 "Delta Transmitted Broadcast packets ");
2507 /**************************************************************************//**
2508 * Set the Transmitted Discarded Packets in measurement interval
2509 * property of the vNIC performance.
2511 * @note The property is treated as immutable: it is only valid to call
2512 * the setter once. However, we don't assert if the caller tries to
2513 * overwrite, just ignoring the update instead.
2515 * @param vnic_performance Pointer to the vNIC Use.
2516 * @param tx_discarded_packets_acc
2517 *****************************************************************************/
2518 void evel_vnic_performance_tx_discarded_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2519 const double tx_discarded_packets_acc)
2523 /***************************************************************************/
2524 /* Check preconditions. */
2525 /***************************************************************************/
2526 assert(tx_discarded_packets_acc >= 0.0);
2528 evel_set_option_double(&vnic_performance->tx_discarded_packets_acc,
2529 tx_discarded_packets_acc,
2530 "Transmitted Discarded Packets accumulated");
2535 /**************************************************************************//**
2536 * Set the Delta Discarded packets Transmitted in measurement interval
2537 * property of the vNIC performance.
2539 * @note The property is treated as immutable: it is only valid to call
2540 * the setter once. However, we don't assert if the caller tries to
2541 * overwrite, just ignoring the update instead.
2543 * @param vnic_performance Pointer to the vNIC Use.
2544 * @param tx_discarded_packets_delta
2545 *****************************************************************************/
2546 void evel_vnic_performance_tx_discarded_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2547 const double tx_discarded_packets_delta)
2551 /***************************************************************************/
2552 /* Check preconditions. */
2553 /***************************************************************************/
2554 assert(tx_discarded_packets_delta >= 0.0);
2556 evel_set_option_double(&vnic_performance->tx_discarded_packets_delta,
2557 tx_discarded_packets_delta,
2558 "Delta Transmitted Discarded packets ");
2563 /**************************************************************************//**
2564 * Set the Transmitted Errored Packets in measurement interval
2565 * property of the vNIC performance.
2567 * @note The property is treated as immutable: it is only valid to call
2568 * the setter once. However, we don't assert if the caller tries to
2569 * overwrite, just ignoring the update instead.
2571 * @param vnic_performance Pointer to the vNIC Use.
2572 * @param tx_error_packets_acc
2573 *****************************************************************************/
2574 void evel_vnic_performance_tx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2575 const double tx_error_packets_acc)
2579 /***************************************************************************/
2580 /* Check preconditions. */
2581 /***************************************************************************/
2582 assert(tx_error_packets_acc >= 0.0);
2584 evel_set_option_double(&vnic_performance->tx_error_packets_acc,
2585 tx_error_packets_acc,
2586 "Transmitted Error Packets accumulated");
2591 /**************************************************************************//**
2592 * Set the Delta Errored packets Transmitted in measurement interval
2593 * property of the vNIC performance.
2595 * @note The property is treated as immutable: it is only valid to call
2596 * the setter once. However, we don't assert if the caller tries to
2597 * overwrite, just ignoring the update instead.
2599 * @param vnic_performance Pointer to the vNIC Use.
2600 * @param tx_error_packets_delta
2601 *****************************************************************************/
2602 void evel_vnic_performance_tx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2603 const double tx_error_packets_delta)
2607 /***************************************************************************/
2608 /* Check preconditions. */
2609 /***************************************************************************/
2610 assert(tx_error_packets_delta >= 0.0);
2612 evel_set_option_double(&vnic_performance->tx_error_packets_delta,
2613 tx_error_packets_delta,
2614 "Delta Transmitted Error packets ");
2619 /**************************************************************************//**
2620 * Set the Transmitted Multicast Packets in measurement interval
2621 * property of the vNIC performance.
2623 * @note The property is treated as immutable: it is only valid to call
2624 * the setter once. However, we don't assert if the caller tries to
2625 * overwrite, just ignoring the update instead.
2627 * @param vnic_performance Pointer to the vNIC Use.
2628 * @param tx_mcast_packets_acc
2629 *****************************************************************************/
2630 void evel_vnic_performance_tx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2631 const double tx_mcast_packets_acc)
2635 /***************************************************************************/
2636 /* Check preconditions. */
2637 /***************************************************************************/
2638 assert(tx_mcast_packets_acc >= 0.0);
2640 evel_set_option_double(&vnic_performance->tx_mcast_packets_acc,
2641 tx_mcast_packets_acc,
2642 "Transmitted Multicast Packets accumulated");
2647 /**************************************************************************//**
2648 * Set the Delta Multicast packets Transmitted in measurement interval
2649 * property of the vNIC performance.
2651 * @note The property is treated as immutable: it is only valid to call
2652 * the setter once. However, we don't assert if the caller tries to
2653 * overwrite, just ignoring the update instead.
2655 * @param vnic_performance Pointer to the vNIC Use.
2656 * @param tx_mcast_packets_delta
2657 *****************************************************************************/
2658 void evel_vnic_performance_tx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2659 const double tx_mcast_packets_delta)
2663 /***************************************************************************/
2664 /* Check preconditions. */
2665 /***************************************************************************/
2666 assert(tx_mcast_packets_delta >= 0.0);
2668 evel_set_option_double(&vnic_performance->tx_mcast_packets_delta,
2669 tx_mcast_packets_delta,
2670 "Delta Transmitted Multicast packets ");
2675 /**************************************************************************//**
2676 * Set the Transmitted Octets in measurement interval
2677 * property of the vNIC performance.
2679 * @note The property is treated as immutable: it is only valid to call
2680 * the setter once. However, we don't assert if the caller tries to
2681 * overwrite, just ignoring the update instead.
2683 * @param vnic_performance Pointer to the vNIC Use.
2684 * @param tx_octets_acc
2685 *****************************************************************************/
2686 void evel_vnic_performance_tx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2687 const double tx_octets_acc)
2691 /***************************************************************************/
2692 /* Check preconditions. */
2693 /***************************************************************************/
2694 assert(tx_octets_acc >= 0.0);
2696 evel_set_option_double(&vnic_performance->tx_octets_acc,
2698 "Transmitted Octets accumulated");
2703 /**************************************************************************//**
2704 * Set the Delta Octets Transmitted in measurement interval
2705 * property of the vNIC performance.
2707 * @note The property is treated as immutable: it is only valid to call
2708 * the setter once. However, we don't assert if the caller tries to
2709 * overwrite, just ignoring the update instead.
2711 * @param vnic_performance Pointer to the vNIC Use.
2712 * @param tx_octets_delta
2713 *****************************************************************************/
2714 void evel_vnic_performance_tx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2715 const double tx_octets_delta)
2719 /***************************************************************************/
2720 /* Check preconditions. */
2721 /***************************************************************************/
2722 assert(tx_octets_delta >= 0.0);
2724 evel_set_option_double(&vnic_performance->tx_octets_delta,
2726 "Delta Transmitted Octets ");
2732 /**************************************************************************//**
2733 * Set the Transmitted Total Packets in measurement interval
2734 * property of the vNIC performance.
2736 * @note The property is treated as immutable: it is only valid to call
2737 * the setter once. However, we don't assert if the caller tries to
2738 * overwrite, just ignoring the update instead.
2740 * @param vnic_performance Pointer to the vNIC Use.
2741 * @param tx_total_packets_acc
2742 *****************************************************************************/
2743 void evel_vnic_performance_tx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2744 const double tx_total_packets_acc)
2748 /***************************************************************************/
2749 /* Check preconditions. */
2750 /***************************************************************************/
2751 assert(tx_total_packets_acc >= 0.0);
2753 evel_set_option_double(&vnic_performance->tx_total_packets_acc,
2754 tx_total_packets_acc,
2755 "Transmitted Total Packets accumulated");
2760 /**************************************************************************//**
2761 * Set the Delta Total Packets Transmitted in measurement interval
2762 * property of the vNIC performance.
2764 * @note The property is treated as immutable: it is only valid to call
2765 * the setter once. However, we don't assert if the caller tries to
2766 * overwrite, just ignoring the update instead.
2768 * @param vnic_performance Pointer to the vNIC Use.
2769 * @param tx_total_packets_delta
2770 *****************************************************************************/
2771 void evel_vnic_performance_tx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2772 const double tx_total_packets_delta)
2776 /***************************************************************************/
2777 /* Check preconditions. */
2778 /***************************************************************************/
2779 assert(tx_total_packets_delta >= 0.0);
2781 evel_set_option_double(&vnic_performance->tx_total_packets_delta,
2782 tx_total_packets_delta,
2783 "Delta Transmitted Total Packets ");
2789 /**************************************************************************//**
2790 * Set the Transmitted Unicast Packets in measurement interval
2791 * property of the vNIC performance.
2793 * @note The property is treated as immutable: it is only valid to call
2794 * the setter once. However, we don't assert if the caller tries to
2795 * overwrite, just ignoring the update instead.
2797 * @param vnic_performance Pointer to the vNIC Use.
2798 * @param tx_ucast_packets_acc
2799 *****************************************************************************/
2800 void evel_vnic_performance_tx_ucast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2801 const double tx_ucast_packets_acc)
2805 /***************************************************************************/
2806 /* Check preconditions. */
2807 /***************************************************************************/
2808 assert(tx_ucast_packets_acc >= 0.0);
2810 evel_set_option_double(&vnic_performance->tx_ucast_packets_acc,
2811 tx_ucast_packets_acc,
2812 "Transmitted Unicast Packets accumulated");
2817 /**************************************************************************//**
2818 * Set the Delta Octets Transmitted in measurement interval
2819 * property of the vNIC performance.
2821 * @note The property is treated as immutable: it is only valid to call
2822 * the setter once. However, we don't assert if the caller tries to
2823 * overwrite, just ignoring the update instead.
2825 * @param vnic_performance Pointer to the vNIC Use.
2826 * @param tx_ucast_packets_delta
2827 *****************************************************************************/
2828 void evel_vnic_performance_tx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2829 const double tx_ucast_packets_delta)
2833 /***************************************************************************/
2834 /* Check preconditions. */
2835 /***************************************************************************/
2836 assert(tx_ucast_packets_delta >= 0.0);
2838 evel_set_option_double(&vnic_performance->tx_ucast_packets_delta,
2839 tx_ucast_packets_delta,
2840 "Delta Transmitted Unicast Packets ");
2846 /**************************************************************************//**
2847 * Add an additional vNIC Use to the specified Measurement event.
2849 * @param measurement Pointer to the measurement.
2850 * @param vnic_performance Pointer to the vNIC Use to add.
2851 *****************************************************************************/
2852 void evel_meas_vnic_performance_add(EVENT_MEASUREMENT * const measurement,
2853 MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance)
2857 /***************************************************************************/
2858 /* Check preconditions. */
2859 /***************************************************************************/
2860 assert(measurement != NULL);
2861 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
2862 assert(vnic_performance != NULL);
2864 dlist_push_last(&measurement->vnic_usage, vnic_performance);
2869 /**************************************************************************//**
2870 * Add an additional vNIC usage record Measurement.
2872 * This function implements the previous API, purely for convenience.
2874 * The ID is null delimited ASCII string. The library takes a copy so the
2875 * caller does not have to preserve values after the function returns.
2877 * @param measurement Pointer to the measurement.
2878 * @param vnic_id ASCIIZ string with the vNIC's ID.
2879 * @param valset true or false confidence level
2880 * @param recvd_bcast_packets_acc Recieved broadcast packets
2881 * @param recvd_bcast_packets_delta Received delta broadcast packets
2882 * @param recvd_discarded_packets_acc Recieved discarded packets
2883 * @param recvd_discarded_packets_delta Received discarded delta packets
2884 * @param recvd_error_packets_acc Received error packets
2885 * @param recvd_error_packets_delta, Received delta error packets
2886 * @param recvd_mcast_packets_acc Received multicast packets
2887 * @param recvd_mcast_packets_delta Received delta multicast packets
2888 * @param recvd_octets_acc Received octets
2889 * @param recvd_octets_delta Received delta octets
2890 * @param recvd_total_packets_acc Received total packets
2891 * @param recvd_total_packets_delta Received delta total packets
2892 * @param recvd_ucast_packets_acc Received Unicast packets
2893 * @param recvd_ucast_packets_delta Received delta unicast packets
2894 * @param tx_bcast_packets_acc Transmitted broadcast packets
2895 * @param tx_bcast_packets_delta Transmitted delta broadcast packets
2896 * @param tx_discarded_packets_acc Transmitted packets discarded
2897 * @param tx_discarded_packets_delta Transmitted delta discarded packets
2898 * @param tx_error_packets_acc Transmitted error packets
2899 * @param tx_error_packets_delta Transmitted delta error packets
2900 * @param tx_mcast_packets_acc Transmitted multicast packets accumulated
2901 * @param tx_mcast_packets_delta Transmitted delta multicast packets
2902 * @param tx_octets_acc Transmitted octets
2903 * @param tx_octets_delta Transmitted delta octets
2904 * @param tx_total_packets_acc Transmitted total packets
2905 * @param tx_total_packets_delta Transmitted delta total packets
2906 * @param tx_ucast_packets_acc Transmitted Unicast packets
2907 * @param tx_ucast_packets_delta Transmitted delta Unicast packets
2908 *****************************************************************************/
2909 void evel_measurement_vnic_performance_add(EVENT_MEASUREMENT * const measurement,
2910 char * const vnic_id,
2912 double recvd_bcast_packets_acc,
2913 double recvd_bcast_packets_delta,
2914 double recvd_discarded_packets_acc,
2915 double recvd_discarded_packets_delta,
2916 double recvd_error_packets_acc,
2917 double recvd_error_packets_delta,
2918 double recvd_mcast_packets_acc,
2919 double recvd_mcast_packets_delta,
2920 double recvd_octets_acc,
2921 double recvd_octets_delta,
2922 double recvd_total_packets_acc,
2923 double recvd_total_packets_delta,
2924 double recvd_ucast_packets_acc,
2925 double recvd_ucast_packets_delta,
2926 double tx_bcast_packets_acc,
2927 double tx_bcast_packets_delta,
2928 double tx_discarded_packets_acc,
2929 double tx_discarded_packets_delta,
2930 double tx_error_packets_acc,
2931 double tx_error_packets_delta,
2932 double tx_mcast_packets_acc,
2933 double tx_mcast_packets_delta,
2934 double tx_octets_acc,
2935 double tx_octets_delta,
2936 double tx_total_packets_acc,
2937 double tx_total_packets_delta,
2938 double tx_ucast_packets_acc,
2939 double tx_ucast_packets_delta)
2941 MEASUREMENT_VNIC_PERFORMANCE * vnic_performance = NULL;
2944 /***************************************************************************/
2945 /* Trust the assertions in the underlying methods. */
2946 /***************************************************************************/
2947 vnic_performance = evel_measurement_new_vnic_performance(vnic_id, valset);
2949 evel_vnic_performance_rx_bcast_pkt_acc_set(vnic_performance, recvd_bcast_packets_acc);
2950 evel_vnic_performance_rx_bcast_pkt_delta_set(vnic_performance, recvd_bcast_packets_delta);
2951 evel_vnic_performance_rx_discard_pkt_acc_set(vnic_performance, recvd_discarded_packets_acc);
2952 evel_vnic_performance_rx_discard_pkt_delta_set(vnic_performance, recvd_discarded_packets_delta);
2953 evel_vnic_performance_rx_error_pkt_acc_set(vnic_performance, recvd_error_packets_acc);
2954 evel_vnic_performance_rx_error_pkt_delta_set(vnic_performance, recvd_error_packets_delta);
2955 evel_vnic_performance_rx_mcast_pkt_acc_set(vnic_performance, recvd_mcast_packets_acc);
2956 evel_vnic_performance_rx_mcast_pkt_delta_set(vnic_performance, recvd_mcast_packets_delta);
2957 evel_vnic_performance_rx_octets_acc_set(vnic_performance, recvd_octets_acc);
2958 evel_vnic_performance_rx_octets_delta_set(vnic_performance, recvd_octets_delta);
2959 evel_vnic_performance_rx_total_pkt_acc_set(vnic_performance, recvd_total_packets_acc);
2960 evel_vnic_performance_rx_total_pkt_delta_set(vnic_performance, recvd_total_packets_delta);
2961 evel_vnic_performance_rx_ucast_pkt_acc_set(vnic_performance, recvd_ucast_packets_acc);
2962 evel_vnic_performance_rx_ucast_pkt_delta_set(vnic_performance, recvd_ucast_packets_delta);
2963 evel_vnic_performance_tx_bcast_pkt_acc_set(vnic_performance, tx_bcast_packets_acc);
2964 evel_vnic_performance_tx_bcast_pkt_delta_set(vnic_performance, tx_bcast_packets_delta);
2965 evel_vnic_performance_tx_discarded_pkt_acc_set(vnic_performance, tx_discarded_packets_acc);
2966 evel_vnic_performance_tx_discarded_pkt_delta_set(vnic_performance, tx_discarded_packets_delta);
2967 evel_vnic_performance_tx_error_pkt_acc_set(vnic_performance, tx_error_packets_acc);
2968 evel_vnic_performance_tx_error_pkt_delta_set(vnic_performance, tx_error_packets_delta);
2969 evel_vnic_performance_tx_mcast_pkt_acc_set(vnic_performance, tx_mcast_packets_acc);
2970 evel_vnic_performance_tx_mcast_pkt_delta_set(vnic_performance, tx_mcast_packets_delta);
2971 evel_vnic_performance_tx_octets_acc_set(vnic_performance, tx_octets_acc);
2972 evel_vnic_performance_tx_octets_delta_set(vnic_performance, tx_octets_delta);
2973 evel_vnic_performance_tx_total_pkt_acc_set(vnic_performance, tx_total_packets_acc);
2974 evel_vnic_performance_tx_total_pkt_delta_set(vnic_performance, tx_total_packets_delta);
2975 evel_vnic_performance_tx_ucast_pkt_acc_set(vnic_performance, tx_ucast_packets_acc);
2976 evel_vnic_performance_tx_ucast_pkt_delta_set(vnic_performance, tx_ucast_packets_delta);
2977 evel_meas_vnic_performance_add(measurement, vnic_performance);
2980 /**************************************************************************//**
2981 * Encode the measurement as a JSON measurement.
2983 * @param jbuf Pointer to the ::EVEL_JSON_BUFFER to encode into.
2984 * @param event Pointer to the ::EVENT_HEADER to encode.
2985 *****************************************************************************/
2986 void evel_json_encode_measurement(EVEL_JSON_BUFFER * jbuf,
2987 EVENT_MEASUREMENT * event)
2989 MEASUREMENT_CPU_USE * cpu_use = NULL;
2990 MEASUREMENT_MEM_USE * mem_use = NULL;
2991 MEASUREMENT_DISK_USE * disk_use = NULL;
2992 MEASUREMENT_FSYS_USE * fsys_use = NULL;
2993 MEASUREMENT_LATENCY_BUCKET * bucket = NULL;
2994 MEASUREMENT_VNIC_PERFORMANCE * vnic_performance = NULL;
2995 MEASUREMENT_ERRORS * errors = NULL;
2996 MEASUREMENT_FEATURE_USE * feature_use = NULL;
2997 MEASUREMENT_CODEC_USE * codec_use = NULL;
2998 MEASUREMENT_GROUP * measurement_group = NULL;
2999 CUSTOM_MEASUREMENT * custom_measurement = NULL;
3000 DLIST_ITEM * item = NULL;
3001 DLIST_ITEM * nested_item = NULL;
3002 DLIST_ITEM * addl_info_item = NULL;
3003 OTHER_FIELD *addl_info = NULL;
3007 /***************************************************************************/
3008 /* Check preconditions. */
3009 /***************************************************************************/
3010 assert(event != NULL);
3011 assert(event->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
3013 evel_json_encode_header(jbuf, &event->header);
3014 evel_json_open_named_object(jbuf, "measurementsForVfScalingFields");
3016 /***************************************************************************/
3017 /* Mandatory fields. */
3018 /***************************************************************************/
3019 evel_enc_kv_int(jbuf, "measurementInterval", event->measurement_interval);
3021 /***************************************************************************/
3022 /* Optional fields. */
3023 /***************************************************************************/
3024 // additional fields
3025 evel_json_checkpoint(jbuf);
3026 if (evel_json_open_opt_named_list(jbuf, "additionalFields"))
3028 bool item_added = false;
3030 addl_info_item = dlist_get_first(&event->additional_info);
3031 while (addl_info_item != NULL)
3033 addl_info = (OTHER_FIELD*) addl_info_item->item;
3034 assert(addl_info != NULL);
3036 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3040 evel_json_open_object(jbuf);
3041 evel_enc_kv_string(jbuf, "name", addl_info->name);
3042 evel_enc_kv_string(jbuf, "value", addl_info->value);
3043 evel_json_close_object(jbuf);
3046 addl_info_item = dlist_get_next(addl_info_item);
3048 evel_json_close_list(jbuf);
3050 /*************************************************************************/
3051 /* If we've not written anything, rewind to before we opened the list. */
3052 /*************************************************************************/
3055 evel_json_rewind(jbuf);
3059 // TBD additional json objects
3060 evel_enc_kv_opt_int(jbuf, "concurrentSessions", &event->concurrent_sessions);
3061 evel_enc_kv_opt_int(jbuf, "configuredEntities", &event->configured_entities);
3063 /***************************************************************************/
3065 /***************************************************************************/
3066 evel_json_checkpoint(jbuf);
3067 if (evel_json_open_opt_named_list(jbuf, "cpuUsageArray"))
3069 bool item_added = false;
3071 item = dlist_get_first(&event->cpu_usage);
3072 while (item != NULL)
3074 cpu_use = (MEASUREMENT_CPU_USE*) item->item;
3075 assert(cpu_use != NULL);
3077 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3081 evel_json_open_object(jbuf);
3082 evel_enc_kv_string(jbuf, "cpuIdentifier", cpu_use->id);
3083 evel_enc_kv_opt_double(jbuf, "cpuIdle", &cpu_use->idle);
3084 evel_enc_kv_opt_double(jbuf, "cpuUsageInterrupt", &cpu_use->intrpt);
3085 evel_enc_kv_opt_double(jbuf, "cpuUsageNice", &cpu_use->nice);
3086 evel_enc_kv_opt_double(jbuf, "cpuUsageSoftIrq", &cpu_use->softirq);
3087 evel_enc_kv_opt_double(jbuf, "cpuUsageSteal", &cpu_use->steal);
3088 evel_enc_kv_opt_double(jbuf, "cpuUsageSystem", &cpu_use->sys);
3089 evel_enc_kv_opt_double(jbuf, "cpuUsageUser", &cpu_use->user);
3090 evel_enc_kv_opt_double(jbuf, "cpuWait", &cpu_use->wait);
3091 evel_enc_kv_double(jbuf, "percentUsage",cpu_use->usage);
3092 evel_json_close_object(jbuf);
3095 item = dlist_get_next(item);
3097 evel_json_close_list(jbuf);
3099 /*************************************************************************/
3100 /* If we've not written anything, rewind to before we opened the list. */
3101 /*************************************************************************/
3104 evel_json_rewind(jbuf);
3109 /***************************************************************************/
3110 /* Disk Use list. */
3111 /***************************************************************************/
3112 evel_json_checkpoint(jbuf);
3113 if (evel_json_open_opt_named_list(jbuf, "diskUsageArray"))
3115 bool item_added = false;
3117 item = dlist_get_first(&event->disk_usage);
3118 while (item != NULL)
3120 disk_use = (MEASUREMENT_DISK_USE*) item->item;
3121 assert(disk_use != NULL);
3123 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3127 evel_json_open_object(jbuf);
3128 evel_enc_kv_string(jbuf, "diskIdentifier", disk_use->id);
3129 evel_enc_kv_opt_double(jbuf, "diskIoTimeAvg", &disk_use->iotimeavg);
3130 evel_enc_kv_opt_double(jbuf, "diskIoTimeLast", &disk_use->iotimelast);
3131 evel_enc_kv_opt_double(jbuf, "diskIoTimeMax", &disk_use->iotimemax);
3132 evel_enc_kv_opt_double(jbuf, "diskIoTimeMin", &disk_use->iotimemin);
3133 evel_enc_kv_opt_double(jbuf, "diskMergedReadAvg", &disk_use->mergereadavg);
3134 evel_enc_kv_opt_double(jbuf, "diskMergedReadLast", &disk_use->mergereadlast);
3135 evel_enc_kv_opt_double(jbuf, "diskMergedReadMax", &disk_use->mergereadmax);
3136 evel_enc_kv_opt_double(jbuf, "diskMergedReadMin", &disk_use->mergereadmin);
3137 evel_enc_kv_opt_double(jbuf, "diskMergedWriteAvg", &disk_use->mergewriteavg);
3138 evel_enc_kv_opt_double(jbuf, "diskMergedWriteLast", &disk_use->mergewritelast);
3139 evel_enc_kv_opt_double(jbuf, "diskMergedWriteMax", &disk_use->mergewritemax);
3140 evel_enc_kv_opt_double(jbuf, "diskMergedWriteMin", &disk_use->mergewritemin);
3141 evel_enc_kv_opt_double(jbuf, "diskOctetsReadAvg", &disk_use->octetsreadavg);
3142 evel_enc_kv_opt_double(jbuf, "diskOctetsReadLast", &disk_use->octetsreadlast);
3143 evel_enc_kv_opt_double(jbuf, "diskOctetsReadMax", &disk_use->octetsreadmax);
3144 evel_enc_kv_opt_double(jbuf, "diskOctetsReadMin", &disk_use->octetsreadmin);
3145 evel_enc_kv_opt_double(jbuf, "diskOctetsWriteAvg", &disk_use->octetswriteavg);
3146 evel_enc_kv_opt_double(jbuf, "diskOctetsWriteLast", &disk_use->octetswritelast);
3147 evel_enc_kv_opt_double(jbuf, "diskOctetsWriteMax", &disk_use->octetswritemax);
3148 evel_enc_kv_opt_double(jbuf, "diskOctetsWriteMin", &disk_use->octetswritemin);
3149 evel_enc_kv_opt_double(jbuf, "diskOpsReadAvg", &disk_use->opsreadavg);
3150 evel_enc_kv_opt_double(jbuf, "diskOpsReadLast", &disk_use->opsreadlast);
3151 evel_enc_kv_opt_double(jbuf, "diskOpsReadMax", &disk_use->opsreadmax);
3152 evel_enc_kv_opt_double(jbuf, "diskOpsReadMin", &disk_use->opsreadmin);
3153 evel_enc_kv_opt_double(jbuf, "diskOpsWriteAvg", &disk_use->opswriteavg);
3154 evel_enc_kv_opt_double(jbuf, "diskOpsWriteLast", &disk_use->opswritelast);
3155 evel_enc_kv_opt_double(jbuf, "diskOpsWriteMax", &disk_use->opswritemax);
3156 evel_enc_kv_opt_double(jbuf, "diskOpsWriteMin", &disk_use->opswritemin);
3157 evel_enc_kv_opt_double(jbuf, "diskPendingOperationsAvg", &disk_use->pendingopsavg);
3158 evel_enc_kv_opt_double(jbuf, "diskPendingOperationsLast", &disk_use->pendingopslast);
3159 evel_enc_kv_opt_double(jbuf, "diskPendingOperationsMax", &disk_use->pendingopsmax);
3160 evel_enc_kv_opt_double(jbuf, "diskPendingOperationsMin", &disk_use->pendingopsmin);
3161 evel_enc_kv_opt_double(jbuf, "diskTimeReadAvg", &disk_use->timereadavg);
3162 evel_enc_kv_opt_double(jbuf, "diskTimeReadLast", &disk_use->timereadlast);
3163 evel_enc_kv_opt_double(jbuf, "diskTimeReadMax", &disk_use->timereadmax);
3164 evel_enc_kv_opt_double(jbuf, "diskTimeReadMin", &disk_use->timereadmin);
3165 evel_enc_kv_opt_double(jbuf, "diskTimeWriteAvg", &disk_use->timewriteavg);
3166 evel_enc_kv_opt_double(jbuf, "diskTimeWriteLast", &disk_use->timewritelast);
3167 evel_enc_kv_opt_double(jbuf, "diskTimeWriteMax", &disk_use->timewritemax);
3168 evel_enc_kv_opt_double(jbuf, "diskTimeWriteMin", &disk_use->timewritemin);
3169 evel_json_close_object(jbuf);
3172 item = dlist_get_next(item);
3174 evel_json_close_list(jbuf);
3176 /*************************************************************************/
3177 /* If we've not written anything, rewind to before we opened the list. */
3178 /*************************************************************************/
3181 evel_json_rewind(jbuf);
3185 /***************************************************************************/
3186 /* Filesystem Usage list. */
3187 /***************************************************************************/
3188 evel_json_checkpoint(jbuf);
3189 if (evel_json_open_opt_named_list(jbuf, "filesystemUsageArray"))
3191 bool item_added = false;
3193 item = dlist_get_first(&event->filesystem_usage);
3194 while (item != NULL)
3196 fsys_use = (MEASUREMENT_FSYS_USE *) item->item;
3197 assert(fsys_use != NULL);
3199 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3200 "filesystemUsageArray",
3201 fsys_use->filesystem_name))
3203 evel_json_open_object(jbuf);
3205 jbuf, "blockConfigured", fsys_use->block_configured);
3206 evel_enc_kv_int(jbuf, "blockIops", fsys_use->block_iops);
3207 evel_enc_kv_double(jbuf, "blockUsed", fsys_use->block_used);
3209 jbuf, "ephemeralConfigured", fsys_use->ephemeral_configured);
3210 evel_enc_kv_int(jbuf, "ephemeralIops", fsys_use->ephemeral_iops);
3211 evel_enc_kv_double(jbuf, "ephemeralUsed", fsys_use->ephemeral_used);
3212 evel_enc_kv_string(jbuf, "filesystemName", fsys_use->filesystem_name);
3213 evel_json_close_object(jbuf);
3216 item = dlist_get_next(item);
3218 evel_json_close_list(jbuf);
3220 /*************************************************************************/
3221 /* If we've not written anything, rewind to before we opened the list. */
3222 /*************************************************************************/
3225 evel_json_rewind(jbuf);
3229 /***************************************************************************/
3230 /* Latency distribution. */
3231 /***************************************************************************/
3232 item = dlist_get_first(&event->latency_distribution);
3233 if ((item != NULL) &&
3234 evel_json_open_opt_named_list(jbuf, "latencyDistribution"))
3236 while (item != NULL)
3238 bucket = (MEASUREMENT_LATENCY_BUCKET*) item->item;
3239 assert(bucket != NULL);
3241 evel_json_open_object(jbuf);
3242 evel_enc_kv_opt_double(
3243 jbuf, "lowEndOfLatencyBucket", &bucket->low_end);
3244 evel_enc_kv_opt_double(
3245 jbuf, "highEndOfLatencyBucket", &bucket->high_end);
3246 evel_enc_kv_int(jbuf, "countsInTheBucket", bucket->count);
3247 evel_json_close_object(jbuf);
3248 item = dlist_get_next(item);
3250 evel_json_close_list(jbuf);
3253 evel_enc_kv_opt_double(
3254 jbuf, "meanRequestLatency", &event->mean_request_latency);
3255 evel_enc_kv_opt_int(jbuf, "requestRate", &event->request_rate);
3257 /***************************************************************************/
3258 /* vNIC Usage TBD Performance array */
3259 /***************************************************************************/
3260 evel_json_checkpoint(jbuf);
3261 if (evel_json_open_opt_named_list(jbuf, "vNicUsageArray"))
3263 bool item_added = false;
3265 item = dlist_get_first(&event->vnic_usage);
3266 while (item != NULL)
3268 vnic_performance = (MEASUREMENT_VNIC_PERFORMANCE *) item->item;
3269 assert(vnic_performance != NULL);
3271 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3272 "vNicPerformanceArray",
3273 vnic_performance->vnic_id))
3275 evel_json_open_object(jbuf);
3277 /*********************************************************************/
3278 /* Optional fields. */
3279 /*********************************************************************/
3280 evel_enc_kv_opt_double( jbuf,
3281 "receivedBroadcastPacketsAccumulated", &vnic_performance->recvd_bcast_packets_acc);
3282 evel_enc_kv_opt_double( jbuf,
3283 "receivedBroadcastPacketsDelta", &vnic_performance->recvd_bcast_packets_delta);
3284 evel_enc_kv_opt_double( jbuf,
3285 "receivedDiscardedPacketsAccumulated", &vnic_performance->recvd_discarded_packets_acc);
3286 evel_enc_kv_opt_double( jbuf,
3287 "receivedDiscardedPacketsDelta", &vnic_performance->recvd_discarded_packets_delta);
3288 evel_enc_kv_opt_double( jbuf,
3289 "receivedErrorPacketsAccumulated", &vnic_performance->recvd_error_packets_acc);
3290 evel_enc_kv_opt_double( jbuf,
3291 "receivedErrorPacketsDelta", &vnic_performance->recvd_error_packets_delta);
3292 evel_enc_kv_opt_double( jbuf,
3293 "receivedMulticastPacketsAccumulated", &vnic_performance->recvd_mcast_packets_acc);
3294 evel_enc_kv_opt_double( jbuf,
3295 "receivedMulticastPacketsDelta", &vnic_performance->recvd_mcast_packets_delta);
3296 evel_enc_kv_opt_double( jbuf,
3297 "receivedOctetsAccumulated", &vnic_performance->recvd_octets_acc);
3298 evel_enc_kv_opt_double( jbuf,
3299 "receivedOctetsDelta", &vnic_performance->recvd_octets_delta);
3300 evel_enc_kv_opt_double( jbuf,
3301 "receivedTotalPacketsAccumulated", &vnic_performance->recvd_total_packets_acc);
3302 evel_enc_kv_opt_double( jbuf,
3303 "receivedTotalPacketsDelta", &vnic_performance->recvd_total_packets_delta);
3304 evel_enc_kv_opt_double( jbuf,
3305 "receivedUnicastPacketsAccumulated", &vnic_performance->recvd_ucast_packets_acc);
3306 evel_enc_kv_opt_double( jbuf,
3307 "receivedUnicastPacketsDelta", &vnic_performance->recvd_ucast_packets_delta);
3308 evel_enc_kv_opt_double( jbuf,
3309 "transmittedBroadcastPacketsAccumulated", &vnic_performance->tx_bcast_packets_acc);
3310 evel_enc_kv_opt_double( jbuf,
3311 "transmittedBroadcastPacketsDelta", &vnic_performance->tx_bcast_packets_delta);
3312 evel_enc_kv_opt_double( jbuf,
3313 "transmittedDiscardedPacketsAccumulated", &vnic_performance->tx_discarded_packets_acc);
3314 evel_enc_kv_opt_double( jbuf,
3315 "transmittedDiscardedPacketsDelta", &vnic_performance->tx_discarded_packets_delta);
3316 evel_enc_kv_opt_double( jbuf,
3317 "transmittedErrorPacketsAccumulated", &vnic_performance->tx_error_packets_acc);
3318 evel_enc_kv_opt_double( jbuf,
3319 "transmittedErrorPacketsDelta", &vnic_performance->tx_error_packets_delta);
3320 evel_enc_kv_opt_double( jbuf,
3321 "transmittedMulticastPacketsAccumulated", &vnic_performance->tx_mcast_packets_acc);
3322 evel_enc_kv_opt_double( jbuf,
3323 "transmittedMulticastPacketsDelta", &vnic_performance->tx_mcast_packets_delta);
3324 evel_enc_kv_opt_double( jbuf,
3325 "transmittedOctetsAccumulated", &vnic_performance->tx_octets_acc);
3326 evel_enc_kv_opt_double( jbuf,
3327 "transmittedOctetsDelta", &vnic_performance->tx_octets_delta);
3328 evel_enc_kv_opt_double( jbuf,
3329 "transmittedTotalPacketsAccumulated", &vnic_performance->tx_total_packets_acc);
3330 evel_enc_kv_opt_double( jbuf,
3331 "transmittedTotalPacketsDelta", &vnic_performance->tx_total_packets_delta);
3332 evel_enc_kv_opt_double( jbuf,
3333 "transmittedUnicastPacketsAccumulated", &vnic_performance->tx_ucast_packets_acc);
3334 evel_enc_kv_opt_double( jbuf,
3335 "transmittedUnicastPacketsDelta", &vnic_performance->tx_ucast_packets_delta);
3337 /*********************************************************************/
3338 /* Mandatory fields. */
3339 /*********************************************************************/
3340 evel_enc_kv_string(jbuf, "valuesAreSuspect", vnic_performance->valuesaresuspect);
3341 evel_enc_kv_string(jbuf, "vNicIdentifier", vnic_performance->vnic_id);
3343 evel_json_close_object(jbuf);
3346 item = dlist_get_next(item);
3349 evel_json_close_list(jbuf);
3351 /*************************************************************************/
3352 /* If we've not written anything, rewind to before we opened the list. */
3353 /*************************************************************************/
3356 evel_json_rewind(jbuf);
3361 /***************************************************************************/
3362 /* Memory Use list. */
3363 /***************************************************************************/
3364 evel_json_checkpoint(jbuf);
3365 if (evel_json_open_opt_named_list(jbuf, "memoryUsageArray"))
3367 bool item_added = false;
3369 item = dlist_get_first(&event->mem_usage);
3370 while (item != NULL)
3372 mem_use = (MEASUREMENT_MEM_USE*) item->item;
3373 assert(mem_use != NULL);
3375 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3379 evel_json_open_object(jbuf);
3380 evel_enc_kv_double(jbuf, "memoryBuffered", mem_use->membuffsz);
3381 evel_enc_kv_opt_double(jbuf, "memoryCached", &mem_use->memcache);
3382 evel_enc_kv_opt_double(jbuf, "memoryConfigured", &mem_use->memconfig);
3383 evel_enc_kv_opt_double(jbuf, "memoryFree", &mem_use->memfree);
3384 evel_enc_kv_opt_double(jbuf, "memorySlabRecl", &mem_use->slabrecl);
3385 evel_enc_kv_opt_double(jbuf, "memorySlabUnrecl", &mem_use->slabunrecl);
3386 evel_enc_kv_opt_double(jbuf, "memoryUsed", &mem_use->memused);
3387 evel_enc_kv_string(jbuf, "vmIdentifier", mem_use->id);
3388 evel_json_close_object(jbuf);
3391 item = dlist_get_next(item);
3393 evel_json_close_list(jbuf);
3395 /*************************************************************************/
3396 /* If we've not written anything, rewind to before we opened the list. */
3397 /*************************************************************************/
3400 evel_json_rewind(jbuf);
3405 evel_enc_kv_opt_int(
3406 jbuf, "numberOfMediaPortsInUse", &event->media_ports_in_use);
3407 evel_enc_kv_opt_int(
3408 jbuf, "vnfcScalingMetric", &event->vnfc_scaling_metric);
3410 /***************************************************************************/
3412 /***************************************************************************/
3413 if ((event->errors != NULL) &&
3414 evel_json_open_opt_named_object(jbuf, "errors"))
3416 errors = event->errors;
3417 evel_enc_kv_int(jbuf, "receiveDiscards", errors->receive_discards);
3418 evel_enc_kv_int(jbuf, "receiveErrors", errors->receive_errors);
3419 evel_enc_kv_int(jbuf, "transmitDiscards", errors->transmit_discards);
3420 evel_enc_kv_int(jbuf, "transmitErrors", errors->transmit_errors);
3421 evel_json_close_object(jbuf);
3424 /***************************************************************************/
3425 /* Feature Utilization list. */
3426 /***************************************************************************/
3427 evel_json_checkpoint(jbuf);
3428 if (evel_json_open_opt_named_list(jbuf, "featureUsageArray"))
3430 bool item_added = false;
3432 item = dlist_get_first(&event->feature_usage);
3433 while (item != NULL)
3435 feature_use = (MEASUREMENT_FEATURE_USE*) item->item;
3436 assert(feature_use != NULL);
3438 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3439 "featureUsageArray",
3440 feature_use->feature_id))
3442 evel_json_open_object(jbuf);
3443 evel_enc_kv_string(jbuf, "featureIdentifier", feature_use->feature_id);
3445 jbuf, "featureUtilization", feature_use->feature_utilization);
3446 evel_json_close_object(jbuf);
3449 item = dlist_get_next(item);
3451 evel_json_close_list(jbuf);
3453 /*************************************************************************/
3454 /* If we've not written anything, rewind to before we opened the list. */
3455 /*************************************************************************/
3458 evel_json_rewind(jbuf);
3462 /***************************************************************************/
3463 /* Codec Utilization list. */
3464 /***************************************************************************/
3465 evel_json_checkpoint(jbuf);
3466 if (evel_json_open_opt_named_list(jbuf, "codecUsageArray"))
3468 bool item_added = false;
3470 item = dlist_get_first(&event->codec_usage);
3471 while (item != NULL)
3473 codec_use = (MEASUREMENT_CODEC_USE*) item->item;
3474 assert(codec_use != NULL);
3476 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3478 codec_use->codec_id))
3480 evel_json_open_object(jbuf);
3481 evel_enc_kv_string(jbuf, "codecIdentifier", codec_use->codec_id);
3482 evel_enc_kv_int(jbuf, "numberInUse", codec_use->number_in_use);
3483 evel_json_close_object(jbuf);
3486 item = dlist_get_next(item);
3488 evel_json_close_list(jbuf);
3490 /*************************************************************************/
3491 /* If we've not written anything, rewind to before we opened the list. */
3492 /*************************************************************************/
3495 evel_json_rewind(jbuf);
3499 /***************************************************************************/
3500 /* Additional Measurement Groups list. */
3501 /***************************************************************************/
3502 evel_json_checkpoint(jbuf);
3503 if (evel_json_open_opt_named_list(jbuf, "additionalMeasurements"))
3505 bool item_added = false;
3507 item = dlist_get_first(&event->additional_measurements);
3508 while (item != NULL)
3510 measurement_group = (MEASUREMENT_GROUP *) item->item;
3511 assert(measurement_group != NULL);
3513 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3514 "additionalMeasurements",
3515 measurement_group->name))
3517 evel_json_open_object(jbuf);
3518 evel_enc_kv_string(jbuf, "name", measurement_group->name);
3519 evel_json_open_opt_named_list(jbuf, "measurements");
3521 /*********************************************************************/
3522 /* Measurements list. */
3523 /*********************************************************************/
3524 nested_item = dlist_get_first(&measurement_group->measurements);
3525 while (nested_item != NULL)
3527 custom_measurement = (CUSTOM_MEASUREMENT *) nested_item->item;
3528 assert(custom_measurement != NULL);
3530 evel_json_open_object(jbuf);
3531 evel_enc_kv_string(jbuf, "name", custom_measurement->name);
3532 evel_enc_kv_string(jbuf, "value", custom_measurement->value);
3533 evel_json_close_object(jbuf);
3534 nested_item = dlist_get_next(nested_item);
3536 evel_json_close_list(jbuf);
3537 evel_json_close_object(jbuf);
3540 item = dlist_get_next(item);
3542 evel_json_close_list(jbuf);
3544 /*************************************************************************/
3545 /* If we've not written anything, rewind to before we opened the list. */
3546 /*************************************************************************/
3549 evel_json_rewind(jbuf);
3553 /***************************************************************************/
3554 /* Although optional, we always generate the version. Note that this */
3555 /* closes the object, too. */
3556 /***************************************************************************/
3557 evel_enc_version(jbuf,
3558 "measurementsForVfScalingVersion",
3559 event->major_version,
3560 event->minor_version);
3561 evel_json_close_object(jbuf);
3566 /**************************************************************************//**
3567 * Free a Measurement.
3569 * Free off the Measurement supplied. Will free all the contained allocated
3572 * @note It does not free the Measurement itself, since that may be part of a
3574 *****************************************************************************/
3575 void evel_free_measurement(EVENT_MEASUREMENT * event)
3577 MEASUREMENT_CPU_USE * cpu_use = NULL;
3578 MEASUREMENT_DISK_USE * disk_use = NULL;
3579 MEASUREMENT_FSYS_USE * fsys_use = NULL;
3580 MEASUREMENT_LATENCY_BUCKET * bucket = NULL;
3581 MEASUREMENT_MEM_USE * mem_use = NULL;
3582 MEASUREMENT_VNIC_PERFORMANCE * vnic_performance = NULL;
3583 MEASUREMENT_FEATURE_USE * feature_use = NULL;
3584 MEASUREMENT_CODEC_USE * codec_use = NULL;
3585 MEASUREMENT_GROUP * measurement_group = NULL;
3586 CUSTOM_MEASUREMENT * measurement = NULL;
3587 OTHER_FIELD *addl_info = NULL;
3591 /***************************************************************************/
3592 /* Check preconditions. As an internal API we don't allow freeing NULL */
3593 /* events as we do on the public API. */
3594 /***************************************************************************/
3595 assert(event != NULL);
3596 assert(event->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
3598 /***************************************************************************/
3599 /* Free all internal strings then the header itself. */
3600 /***************************************************************************/
3601 addl_info = dlist_pop_last(&event->additional_info);
3602 while (addl_info != NULL)
3604 EVEL_DEBUG("Freeing Additional Info (%s, %s)",
3607 free(addl_info->name);
3608 free(addl_info->value);
3610 addl_info = dlist_pop_last(&event->additional_info);
3615 cpu_use = dlist_pop_last(&event->cpu_usage);
3616 while (cpu_use != NULL)
3618 EVEL_DEBUG("Freeing CPU use Info (%s)", cpu_use->id);
3621 cpu_use = dlist_pop_last(&event->cpu_usage);
3623 disk_use = dlist_pop_last(&event->disk_usage);
3624 while (disk_use != NULL)
3626 EVEL_DEBUG("Freeing Disk use Info (%s)", disk_use->id);
3629 disk_use = dlist_pop_last(&event->disk_usage);
3631 mem_use = dlist_pop_last(&event->mem_usage);
3632 while (mem_use != NULL)
3634 EVEL_DEBUG("Freeing Memory use Info (%s)", mem_use->id);
3636 free(mem_use->vmid);
3638 mem_use = dlist_pop_last(&event->mem_usage);
3641 fsys_use = dlist_pop_last(&event->filesystem_usage);
3642 while (fsys_use != NULL)
3644 EVEL_DEBUG("Freeing Filesystem Use info (%s)", fsys_use->filesystem_name);
3645 free(fsys_use->filesystem_name);
3647 fsys_use = dlist_pop_last(&event->filesystem_usage);
3650 bucket = dlist_pop_last(&event->latency_distribution);
3651 while (bucket != NULL)
3653 EVEL_DEBUG("Freeing Latency Bucket");
3655 bucket = dlist_pop_last(&event->latency_distribution);
3658 vnic_performance = dlist_pop_last(&event->vnic_usage);
3659 while (vnic_performance != NULL)
3661 EVEL_DEBUG("Freeing vNIC performance Info (%s)", vnic_performance->vnic_id);
3662 evel_measurement_free_vnic_performance(vnic_performance);
3663 free(vnic_performance);
3664 vnic_performance = dlist_pop_last(&event->vnic_usage);
3667 codec_use = dlist_pop_last(&event->codec_usage);
3668 while (codec_use != NULL)
3670 EVEL_DEBUG("Freeing Codec use Info (%s)", codec_use->codec_id);
3671 free(codec_use->codec_id);
3673 codec_use = dlist_pop_last(&event->codec_usage);
3676 if (event->errors != NULL)
3678 EVEL_DEBUG("Freeing Errors");
3679 free(event->errors);
3682 feature_use = dlist_pop_last(&event->feature_usage);
3683 while (feature_use != NULL)
3685 EVEL_DEBUG("Freeing Feature use Info (%s)", feature_use->feature_id);
3686 free(feature_use->feature_id);
3688 feature_use = dlist_pop_last(&event->feature_usage);
3691 measurement_group = dlist_pop_last(&event->additional_measurements);
3692 while (measurement_group != NULL)
3694 EVEL_DEBUG("Freeing Measurement Group (%s)", measurement_group->name);
3696 measurement = dlist_pop_last(&measurement_group->measurements);
3697 while (measurement != NULL)
3699 EVEL_DEBUG("Freeing Measurement (%s)", measurement->name);
3700 free(measurement->name);
3701 free(measurement->value);
3703 measurement = dlist_pop_last(&measurement_group->measurements);
3705 free(measurement_group->name);
3706 free(measurement_group);
3707 measurement_group = dlist_pop_last(&event->additional_measurements);
3710 evel_free_header(&event->header);