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
40 * @param event_name Unique Event Name confirming Domain AsdcModel Description
41 * @param event_id A universal identifier of the event for: troubleshooting correlation, analysis, etc
43 * @returns pointer to the newly manufactured ::EVENT_MEASUREMENT. If the
44 * event is not used (i.e. posted) it must be released using
46 * @retval NULL Failed to create the event.
47 *****************************************************************************/
48 EVENT_MEASUREMENT * evel_new_measurement(double measurement_interval, const char* ev_name, const char *ev_id)
50 EVENT_MEASUREMENT * measurement = NULL;
54 /***************************************************************************/
55 /* Check preconditions. */
56 /***************************************************************************/
57 assert(measurement_interval >= 0.0);
59 /***************************************************************************/
60 /* Allocate the measurement. */
61 /***************************************************************************/
62 measurement = malloc(sizeof(EVENT_MEASUREMENT));
63 if (measurement == NULL)
65 log_error_state("Out of memory for Measurement");
68 memset(measurement, 0, sizeof(EVENT_MEASUREMENT));
69 EVEL_DEBUG("New measurement is at %lp", measurement);
71 /***************************************************************************/
72 /* Initialize the header & the measurement fields. */
73 /***************************************************************************/
74 evel_init_header_nameid(&measurement->header,ev_name,ev_id);
75 measurement->header.event_domain = EVEL_DOMAIN_MEASUREMENT;
76 measurement->measurement_interval = measurement_interval;
77 dlist_initialize(&measurement->additional_info);
78 dlist_initialize(&measurement->additional_measurements);
79 dlist_initialize(&measurement->additional_objects);
80 dlist_initialize(&measurement->cpu_usage);
81 dlist_initialize(&measurement->disk_usage);
82 dlist_initialize(&measurement->mem_usage);
83 dlist_initialize(&measurement->filesystem_usage);
84 dlist_initialize(&measurement->latency_distribution);
85 dlist_initialize(&measurement->vnic_usage);
86 dlist_initialize(&measurement->codec_usage);
87 dlist_initialize(&measurement->feature_usage);
88 evel_init_option_double(&measurement->mean_request_latency);
89 evel_init_option_int(&measurement->vnfc_scaling_metric);
90 evel_init_option_int(&measurement->concurrent_sessions);
91 evel_init_option_int(&measurement->configured_entities);
92 evel_init_option_int(&measurement->media_ports_in_use);
93 evel_init_option_int(&measurement->request_rate);
94 measurement->major_version = EVEL_MEASUREMENT_MAJOR_VERSION;
95 measurement->minor_version = EVEL_MEASUREMENT_MINOR_VERSION;
102 /**************************************************************************//**
103 * Set the Event Type property of the Measurement.
105 * @note The property is treated as immutable: it is only valid to call
106 * the setter once. However, we don't assert if the caller tries to
107 * overwrite, just ignoring the update instead.
109 * @param measurement Pointer to the Measurement.
110 * @param type The Event Type to be set. ASCIIZ string. The caller
111 * does not need to preserve the value once the function
113 *****************************************************************************/
114 void evel_measurement_type_set(EVENT_MEASUREMENT * measurement,
115 const char * const type)
119 /***************************************************************************/
120 /* Check preconditions and call evel_header_type_set. */
121 /***************************************************************************/
122 assert(measurement != NULL);
123 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
124 evel_header_type_set(&measurement->header, type);
129 /**************************************************************************//**
130 * Add an additional value name/value pair to the Measurement.
132 * The name and value are null delimited ASCII strings. The library takes
133 * a copy so the caller does not have to preserve values after the function
136 * @param measurement Pointer to the measurement.
137 * @param name ASCIIZ string with the attribute's name. The caller
138 * does not need to preserve the value once the function
140 * @param value ASCIIZ string with the attribute's value. The caller
141 * does not need to preserve the value once the function
143 *****************************************************************************/
144 void evel_measurement_addl_info_add(EVENT_MEASUREMENT * measurement, char * name, char * value)
146 OTHER_FIELD * addl_info = NULL;
149 /***************************************************************************/
150 /* Check preconditions. */
151 /***************************************************************************/
152 assert(measurement != NULL);
153 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
154 assert(name != NULL);
155 assert(value != NULL);
157 EVEL_DEBUG("Adding name=%s value=%s", name, value);
158 addl_info = malloc(sizeof(OTHER_FIELD));
159 assert(addl_info != NULL);
160 memset(addl_info, 0, sizeof(OTHER_FIELD));
161 addl_info->name = strdup(name);
162 addl_info->value = strdup(value);
163 assert(addl_info->name != NULL);
164 assert(addl_info->value != NULL);
166 dlist_push_last(&measurement->additional_info, addl_info);
171 /**************************************************************************//**
172 * Set the Concurrent Sessions property of the Measurement.
174 * @note The property is treated as immutable: it is only valid to call
175 * the setter once. However, we don't assert if the caller tries to
176 * overwrite, just ignoring the update instead.
178 * @param measurement Pointer to the Measurement.
179 * @param concurrent_sessions The Concurrent Sessions to be set.
180 *****************************************************************************/
181 void evel_measurement_conc_sess_set(EVENT_MEASUREMENT * measurement,
182 int concurrent_sessions)
186 /***************************************************************************/
187 /* Check preconditions. */
188 /***************************************************************************/
189 assert(measurement != NULL);
190 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
191 assert(concurrent_sessions >= 0);
193 evel_set_option_int(&measurement->concurrent_sessions,
195 "Concurrent Sessions");
199 /**************************************************************************//**
200 * Set the Configured Entities property of the Measurement.
202 * @note The property is treated as immutable: it is only valid to call
203 * the setter once. However, we don't assert if the caller tries to
204 * overwrite, just ignoring the update instead.
206 * @param measurement Pointer to the Measurement.
207 * @param configured_entities The Configured Entities to be set.
208 *****************************************************************************/
209 void evel_measurement_cfg_ents_set(EVENT_MEASUREMENT * measurement,
210 int configured_entities)
214 /***************************************************************************/
215 /* Check preconditions. */
216 /***************************************************************************/
217 assert(measurement != NULL);
218 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
219 assert(configured_entities >= 0);
221 evel_set_option_int(&measurement->configured_entities,
223 "Configured Entities");
227 /**************************************************************************//**
228 * Add an additional set of Errors to the Measurement.
230 * @note The property is treated as immutable: it is only valid to call
231 * the setter once. However, we don't assert if the caller tries to
232 * overwrite, just ignoring the update instead.
234 * @param measurement Pointer to the measurement.
235 * @param receive_discards The number of receive discards.
236 * @param receive_errors The number of receive errors.
237 * @param transmit_discards The number of transmit discards.
238 * @param transmit_errors The number of transmit errors.
239 *****************************************************************************/
240 void evel_measurement_errors_set(EVENT_MEASUREMENT * measurement,
241 int receive_discards,
243 int transmit_discards,
246 MEASUREMENT_ERRORS * errors = NULL;
249 /***************************************************************************/
250 /* Check preconditions. */
251 /***************************************************************************/
252 assert(measurement != NULL);
253 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
254 assert(receive_discards >= 0);
255 assert(receive_errors >= 0);
256 assert(transmit_discards >= 0);
257 assert(transmit_errors >= 0);
259 if (measurement->errors == NULL)
261 EVEL_DEBUG("Adding Errors: %d, %d; %d, %d",
266 errors = malloc(sizeof(MEASUREMENT_ERRORS));
267 assert(errors != NULL);
268 memset(errors, 0, sizeof(MEASUREMENT_ERRORS));
269 errors->receive_discards = receive_discards;
270 errors->receive_errors = receive_errors;
271 errors->transmit_discards = transmit_discards;
272 errors->transmit_errors = transmit_errors;
273 measurement->errors = errors;
277 errors = measurement->errors;
278 EVEL_DEBUG("Ignoring attempt to add Errors: %d, %d; %d, %d\n"
279 "Errors already set: %d, %d; %d, %d",
284 errors->receive_discards,
285 errors->receive_errors,
286 errors->transmit_discards,
287 errors->transmit_errors);
293 /**************************************************************************//**
294 * Set the Mean Request Latency property of the Measurement.
296 * @note The property is treated as immutable: it is only valid to call
297 * the setter once. However, we don't assert if the caller tries to
298 * overwrite, just ignoring the update instead.
300 * @param measurement Pointer to the Measurement.
301 * @param mean_request_latency The Mean Request Latency to be set.
302 *****************************************************************************/
303 void evel_measurement_mean_req_lat_set(EVENT_MEASUREMENT * measurement,
304 double mean_request_latency)
308 /***************************************************************************/
309 /* Check preconditions. */
310 /***************************************************************************/
311 assert(measurement != NULL);
312 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
313 assert(mean_request_latency >= 0.0);
315 evel_set_option_double(&measurement->mean_request_latency,
316 mean_request_latency,
317 "Mean Request Latency");
322 /**************************************************************************//**
323 * Set the Request Rate property of the Measurement.
325 * @note The property is treated as immutable: it is only valid to call
326 * the setter once. However, we don't assert if the caller tries to
327 * overwrite, just ignoring the update instead.
329 * @param measurement Pointer to the Measurement.
330 * @param request_rate The Request Rate to be set.
331 *****************************************************************************/
332 void evel_measurement_request_rate_set(EVENT_MEASUREMENT * measurement,
337 /***************************************************************************/
338 /* Check preconditions. */
339 /***************************************************************************/
340 assert(measurement != NULL);
341 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
342 assert(request_rate >= 0);
344 evel_set_option_int(&measurement->request_rate,
350 /**************************************************************************//**
351 * Add an additional CPU usage value name/value pair to the Measurement.
353 * The name and value are null delimited ASCII strings. The library takes
354 * a copy so the caller does not have to preserve values after the function
357 * @param measurement Pointer to the measurement.
358 * @param id ASCIIZ string with the CPU's identifier.
359 * @param usage CPU utilization.
360 *****************************************************************************/
361 MEASUREMENT_CPU_USE *evel_measurement_new_cpu_use_add(EVENT_MEASUREMENT * measurement,
362 char * id, double usage)
364 MEASUREMENT_CPU_USE * cpu_use = NULL;
367 /***************************************************************************/
368 /* Check assumptions. */
369 /***************************************************************************/
370 assert(measurement != NULL);
371 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
373 assert(usage >= 0.0);
375 /***************************************************************************/
376 /* Allocate a container for the value and push onto the list. */
377 /***************************************************************************/
378 EVEL_DEBUG("Adding id=%s usage=%lf", id, usage);
379 cpu_use = malloc(sizeof(MEASUREMENT_CPU_USE));
380 assert(cpu_use != NULL);
381 memset(cpu_use, 0, sizeof(MEASUREMENT_CPU_USE));
382 cpu_use->id = strdup(id);
383 cpu_use->usage = usage;
384 evel_init_option_double(&cpu_use->idle);
385 evel_init_option_double(&cpu_use->intrpt);
386 evel_init_option_double(&cpu_use->nice);
387 evel_init_option_double(&cpu_use->softirq);
388 evel_init_option_double(&cpu_use->steal);
389 evel_init_option_double(&cpu_use->sys);
390 evel_init_option_double(&cpu_use->user);
391 evel_init_option_double(&cpu_use->wait);
393 dlist_push_last(&measurement->cpu_usage, cpu_use);
399 /**************************************************************************//**
400 * Set the CPU Idle value in measurement interval
401 * percentage of CPU time spent in the idle task
403 * @note The property is treated as immutable: it is only valid to call
404 * the setter once. However, we don't assert if the caller tries to
405 * overwrite, just ignoring the update instead.
407 * @param cpu_use Pointer to the CPU Use.
409 *****************************************************************************/
410 void evel_measurement_cpu_use_idle_set(MEASUREMENT_CPU_USE *const cpu_use,
414 evel_set_option_double(&cpu_use->idle, val, "CPU idle time");
418 /**************************************************************************//**
419 * Set the percentage of time spent servicing interrupts
421 * @note The property is treated as immutable: it is only valid to call
422 * the setter once. However, we don't assert if the caller tries to
423 * overwrite, just ignoring the update instead.
425 * @param cpu_use Pointer to the CPU Use.
427 *****************************************************************************/
428 void evel_measurement_cpu_use_interrupt_set(MEASUREMENT_CPU_USE * const cpu_use,
432 evel_set_option_double(&cpu_use->intrpt, val, "CPU interrupt value");
437 /**************************************************************************//**
438 * Set the percentage of time spent running user space processes that have been niced
440 * @note The property is treated as immutable: it is only valid to call
441 * the setter once. However, we don't assert if the caller tries to
442 * overwrite, just ignoring the update instead.
444 * @param cpu_use Pointer to the CPU Use.
446 *****************************************************************************/
447 void evel_measurement_cpu_use_nice_set(MEASUREMENT_CPU_USE * const cpu_use,
451 evel_set_option_double(&cpu_use->nice, val, "CPU nice value");
456 /**************************************************************************//**
457 * Set the percentage of time spent handling soft irq interrupts
459 * @note The property is treated as immutable: it is only valid to call
460 * the setter once. However, we don't assert if the caller tries to
461 * overwrite, just ignoring the update instead.
463 * @param cpu_use Pointer to the CPU Use.
465 *****************************************************************************/
466 void evel_measurement_cpu_use_softirq_set(MEASUREMENT_CPU_USE * const cpu_use,
470 evel_set_option_double(&cpu_use->softirq, val, "CPU Soft IRQ value");
474 /**************************************************************************//**
475 * Set the percentage of time spent in involuntary wait
477 * @note The property is treated as immutable: it is only valid to call
478 * the setter once. However, we don't assert if the caller tries to
479 * overwrite, just ignoring the update instead.
481 * @param cpu_use Pointer to the CPU Use.
483 *****************************************************************************/
484 void evel_measurement_cpu_use_steal_set(MEASUREMENT_CPU_USE * const cpu_use,
488 evel_set_option_double(&cpu_use->steal, val, "CPU involuntary wait");
492 /**************************************************************************//**
493 * Set the percentage of time spent on system tasks running the kernel
495 * @note The property is treated as immutable: it is only valid to call
496 * the setter once. However, we don't assert if the caller tries to
497 * overwrite, just ignoring the update instead.
499 * @param cpu_use Pointer to the CPU Use.
501 *****************************************************************************/
502 void evel_measurement_cpu_use_system_set(MEASUREMENT_CPU_USE * const cpu_use,
506 evel_set_option_double(&cpu_use->sys, val, "CPU System load");
511 /**************************************************************************//**
512 * Set the percentage of time spent running un-niced user space processes
514 * @note The property is treated as immutable: it is only valid to call
515 * the setter once. However, we don't assert if the caller tries to
516 * overwrite, just ignoring the update instead.
518 * @param cpu_use Pointer to the CPU Use.
520 *****************************************************************************/
521 void evel_measurement_cpu_use_usageuser_set(MEASUREMENT_CPU_USE * const cpu_use,
525 evel_set_option_double(&cpu_use->user, val, "CPU User load value");
529 /**************************************************************************//**
530 * Set the percentage of CPU time spent waiting for I/O operations to complete
532 * @note The property is treated as immutable: it is only valid to call
533 * the setter once. However, we don't assert if the caller tries to
534 * overwrite, just ignoring the update instead.
536 * @param cpu_use Pointer to the CPU Use.
538 *****************************************************************************/
539 void evel_measurement_cpu_use_wait_set(MEASUREMENT_CPU_USE * const cpu_use,
543 evel_set_option_double(&cpu_use->wait, val, "CPU Wait IO value");
548 /**************************************************************************//**
549 * Add an additional Memory usage value name/value pair to the Measurement.
551 * The name and value are null delimited ASCII strings. The library takes
552 * a copy so the caller does not have to preserve values after the function
555 * @param measurement Pointer to the measurement.
556 * @param id ASCIIZ string with the Memory identifier.
557 * @param vmidentifier ASCIIZ string with the VM's identifier.
558 * @param membuffsz Memory Size.
560 * @return Returns pointer to memory use structure in measurements
561 *****************************************************************************/
562 MEASUREMENT_MEM_USE * evel_measurement_new_mem_use_add(EVENT_MEASUREMENT * measurement,
563 char * id, char *vmidentifier, double membuffsz)
565 MEASUREMENT_MEM_USE * mem_use = NULL;
568 /***************************************************************************/
569 /* Check assumptions. */
570 /***************************************************************************/
571 assert(measurement != NULL);
572 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
574 assert(membuffsz >= 0.0);
576 /***************************************************************************/
577 /* Allocate a container for the value and push onto the list. */
578 /***************************************************************************/
579 EVEL_DEBUG("Adding id=%s buffer size=%lf", id, membuffsz);
580 mem_use = malloc(sizeof(MEASUREMENT_MEM_USE));
581 assert(mem_use != NULL);
582 memset(mem_use, 0, sizeof(MEASUREMENT_MEM_USE));
583 mem_use->id = strdup(id);
584 mem_use->vmid = strdup(vmidentifier);
585 mem_use->membuffsz = membuffsz;
586 evel_init_option_double(&mem_use->memcache);
587 evel_init_option_double(&mem_use->memconfig);
588 evel_init_option_double(&mem_use->memfree);
589 evel_init_option_double(&mem_use->slabrecl);
590 evel_init_option_double(&mem_use->slabunrecl);
591 evel_init_option_double(&mem_use->memused);
593 assert(mem_use->id != NULL);
595 dlist_push_last(&measurement->mem_usage, mem_use);
601 /**************************************************************************//**
602 * Set kilobytes of memory used for cache
604 * @note The property is treated as immutable: it is only valid to call
605 * the setter once. However, we don't assert if the caller tries to
606 * overwrite, just ignoring the update instead.
608 * @param mem_use Pointer to the Memory Use.
610 *****************************************************************************/
611 void evel_measurement_mem_use_memcache_set(MEASUREMENT_MEM_USE * const mem_use,
615 evel_set_option_double(&mem_use->memcache, val, "Memory cache value");
619 /**************************************************************************//**
620 * Set kilobytes of memory configured in the virtual machine on which the VNFC reporting
622 * @note The property is treated as immutable: it is only valid to call
623 * the setter once. However, we don't assert if the caller tries to
624 * overwrite, just ignoring the update instead.
626 * @param mem_use Pointer to the Memory Use.
628 *****************************************************************************/
629 void evel_measurement_mem_use_memconfig_set(MEASUREMENT_MEM_USE * const mem_use,
633 evel_set_option_double(&mem_use->memconfig, val, "Memory configured value");
637 /**************************************************************************//**
638 * Set kilobytes of physical RAM left unused by the system
640 * @note The property is treated as immutable: it is only valid to call
641 * the setter once. However, we don't assert if the caller tries to
642 * overwrite, just ignoring the update instead.
644 * @param mem_use Pointer to the Memory Use.
646 *****************************************************************************/
647 void evel_measurement_mem_use_memfree_set(MEASUREMENT_MEM_USE * const mem_use,
651 evel_set_option_double(&mem_use->memfree, val, "Memory freely available value");
655 /**************************************************************************//**
656 * Set the part of the slab that can be reclaimed such as caches measured in kilobytes
658 * @note The property is treated as immutable: it is only valid to call
659 * the setter once. However, we don't assert if the caller tries to
660 * overwrite, just ignoring the update instead.
662 * @param mem_use Pointer to the Memory Use.
664 *****************************************************************************/
665 void evel_measurement_mem_use_slab_reclaimed_set(MEASUREMENT_MEM_USE * const mem_use,
669 evel_set_option_double(&mem_use->slabrecl, val, "Memory reclaimable slab set");
673 /**************************************************************************//**
674 * Set the part of the slab that cannot be reclaimed such as caches measured in kilobytes
676 * @note The property is treated as immutable: it is only valid to call
677 * the setter once. However, we don't assert if the caller tries to
678 * overwrite, just ignoring the update instead.
680 * @param mem_use Pointer to the Memory Use.
682 *****************************************************************************/
683 void evel_measurement_mem_use_slab_unreclaimable_set(MEASUREMENT_MEM_USE * const mem_use,
687 evel_set_option_double(&mem_use->slabunrecl, val, "Memory unreclaimable slab set");
691 /**************************************************************************//**
692 * Set the total memory minus the sum of free, buffered, cached and slab memory in kilobytes
694 * @note The property is treated as immutable: it is only valid to call
695 * the setter once. However, we don't assert if the caller tries to
696 * overwrite, just ignoring the update instead.
698 * @param mem_use Pointer to the Memory Use.
700 *****************************************************************************/
701 void evel_measurement_mem_use_usedup_set(MEASUREMENT_MEM_USE * const mem_use,
705 evel_set_option_double(&mem_use->memused, val, "Memory usedup total set");
709 /**************************************************************************//**
710 * Add an additional Disk usage value name/value pair to the Measurement.
712 * The name and value are null delimited ASCII strings. The library takes
713 * a copy so the caller does not have to preserve values after the function
716 * @param measurement Pointer to the measurement.
717 * @param id ASCIIZ string with the CPU's identifier.
718 * @param usage Disk utilization.
719 *****************************************************************************/
720 MEASUREMENT_DISK_USE * evel_measurement_new_disk_use_add(EVENT_MEASUREMENT * measurement, char * id)
722 MEASUREMENT_DISK_USE * disk_use = NULL;
725 /***************************************************************************/
726 /* Check assumptions. */
727 /***************************************************************************/
728 assert(measurement != NULL);
729 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
732 /***************************************************************************/
733 /* Allocate a container for the value and push onto the list. */
734 /***************************************************************************/
735 EVEL_DEBUG("Adding id=%s disk usage", id);
736 disk_use = malloc(sizeof(MEASUREMENT_DISK_USE));
737 assert(disk_use != NULL);
738 memset(disk_use, 0, sizeof(MEASUREMENT_DISK_USE));
739 disk_use->id = strdup(id);
740 assert(disk_use->id != NULL);
741 dlist_push_last(&measurement->disk_usage, disk_use);
743 evel_init_option_double(&disk_use->iotimeavg );
744 evel_init_option_double(&disk_use->iotimelast );
745 evel_init_option_double(&disk_use->iotimemax );
746 evel_init_option_double(&disk_use->iotimemin );
747 evel_init_option_double(&disk_use->mergereadavg );
748 evel_init_option_double(&disk_use->mergereadlast );
749 evel_init_option_double(&disk_use->mergereadmax );
750 evel_init_option_double(&disk_use->mergereadmin );
751 evel_init_option_double(&disk_use->mergewriteavg );
752 evel_init_option_double(&disk_use->mergewritelast );
753 evel_init_option_double(&disk_use->mergewritemax );
754 evel_init_option_double(&disk_use->mergewritemin );
755 evel_init_option_double(&disk_use->octetsreadavg );
756 evel_init_option_double(&disk_use->octetsreadlast );
757 evel_init_option_double(&disk_use->octetsreadmax );
758 evel_init_option_double(&disk_use->octetsreadmin );
759 evel_init_option_double(&disk_use->octetswriteavg );
760 evel_init_option_double(&disk_use->octetswritelast );
761 evel_init_option_double(&disk_use->octetswritemax );
762 evel_init_option_double(&disk_use->octetswritemin );
763 evel_init_option_double(&disk_use->opsreadavg );
764 evel_init_option_double(&disk_use->opsreadlast );
765 evel_init_option_double(&disk_use->opsreadmax );
766 evel_init_option_double(&disk_use->opsreadmin );
767 evel_init_option_double(&disk_use->opswriteavg );
768 evel_init_option_double(&disk_use->opswritelast );
769 evel_init_option_double(&disk_use->opswritemax );
770 evel_init_option_double(&disk_use->opswritemin );
771 evel_init_option_double(&disk_use->pendingopsavg );
772 evel_init_option_double(&disk_use->pendingopslast );
773 evel_init_option_double(&disk_use->pendingopsmax );
774 evel_init_option_double(&disk_use->pendingopsmin );
775 evel_init_option_double(&disk_use->timereadavg );
776 evel_init_option_double(&disk_use->timereadlast );
777 evel_init_option_double(&disk_use->timereadmax );
778 evel_init_option_double(&disk_use->timereadmin );
779 evel_init_option_double(&disk_use->timewriteavg );
780 evel_init_option_double(&disk_use->timewritelast );
781 evel_init_option_double(&disk_use->timewritemax );
782 evel_init_option_double(&disk_use->timewritemin );
788 /**************************************************************************//**
789 * Set milliseconds spent doing input/output operations over 1 sec; treat
790 * this metric as a device load percentage where 1000ms matches 100% load;
791 * provide the average over the measurement interval
793 * @note The property is treated as immutable: it is only valid to call
794 * the setter once. However, we don't assert if the caller tries to
795 * overwrite, just ignoring the update instead.
797 * @param disk_use Pointer to the Disk Use.
799 *****************************************************************************/
800 void evel_measurement_disk_use_iotimeavg_set(MEASUREMENT_DISK_USE * const disk_use,
804 evel_set_option_double(&disk_use->iotimeavg, val, "Disk ioload set");
808 /**************************************************************************//**
809 * Set milliseconds spent doing input/output operations over 1 sec; treat
810 * this metric as a device load percentage where 1000ms matches 100% load;
811 * provide the last value within the measurement interval
813 * @note The property is treated as immutable: it is only valid to call
814 * the setter once. However, we don't assert if the caller tries to
815 * overwrite, just ignoring the update instead.
817 * @param disk_use Pointer to the Disk Use.
819 *****************************************************************************/
820 void evel_measurement_disk_use_iotimelast_set(MEASUREMENT_DISK_USE * const disk_use,
824 evel_set_option_double(&disk_use->iotimelast, val, "Disk ioloadlast set");
828 /**************************************************************************//**
829 * Set milliseconds spent doing input/output operations over 1 sec; treat
830 * this metric as a device load percentage where 1000ms matches 100% load;
831 * provide the maximum value within the measurement interval
833 * @note The property is treated as immutable: it is only valid to call
834 * the setter once. However, we don't assert if the caller tries to
835 * overwrite, just ignoring the update instead.
837 * @param disk_use Pointer to the Disk Use.
839 *****************************************************************************/
840 void evel_measurement_disk_use_iotimemax_set(MEASUREMENT_DISK_USE * const disk_use,
844 evel_set_option_double(&disk_use->iotimemax, val, "Disk ioloadmax set");
848 /**************************************************************************//**
849 * Set milliseconds spent doing input/output operations over 1 sec; treat
850 * this metric as a device load percentage where 1000ms matches 100% load;
851 * provide the minimum value within the measurement interval
853 * @note The property is treated as immutable: it is only valid to call
854 * the setter once. However, we don't assert if the caller tries to
855 * overwrite, just ignoring the update instead.
857 * @param disk_use Pointer to the Disk Use.
859 *****************************************************************************/
860 void evel_measurement_disk_use_iotimemin_set(MEASUREMENT_DISK_USE * const disk_use,
864 evel_set_option_double(&disk_use->iotimemin, val, "Disk ioloadmin set");
868 /**************************************************************************//**
869 * Set number of logical read operations that were merged into physical read
870 * operations, e.g., two logical reads were served by one physical disk access;
871 * provide the average measurement within the measurement interval
873 * @note The property is treated as immutable: it is only valid to call
874 * the setter once. However, we don't assert if the caller tries to
875 * overwrite, just ignoring the update instead.
877 * @param disk_use Pointer to the Disk Use.
879 *****************************************************************************/
880 void evel_measurement_disk_use_mergereadavg_set(MEASUREMENT_DISK_USE * const disk_use,
884 evel_set_option_double(&disk_use->mergereadavg, val, "Disk Merged read average set");
887 /**************************************************************************//**
888 * Set number of logical read operations that were merged into physical read
889 * operations, e.g., two logical reads were served by one physical disk access;
890 * provide the last measurement within the measurement interval
892 * @note The property is treated as immutable: it is only valid to call
893 * the setter once. However, we don't assert if the caller tries to
894 * overwrite, just ignoring the update instead.
896 * @param disk_use Pointer to the Disk Use.
898 *****************************************************************************/
899 void evel_measurement_disk_use_mergereadlast_set(MEASUREMENT_DISK_USE * const disk_use,
903 evel_set_option_double(&disk_use->mergereadlast, val, "Disk mergedload last set");
906 /**************************************************************************//**
907 * Set number of logical read operations that were merged into physical read
908 * operations, e.g., two logical reads were served by one physical disk access;
909 * provide the maximum measurement within the measurement interval
911 * @note The property is treated as immutable: it is only valid to call
912 * the setter once. However, we don't assert if the caller tries to
913 * overwrite, just ignoring the update instead.
915 * @param disk_use Pointer to the Disk Use.
917 *****************************************************************************/
918 void evel_measurement_disk_use_mergereadmax_set(MEASUREMENT_DISK_USE * const disk_use,
922 evel_set_option_double(&disk_use->mergereadmax, val, "Disk merged loadmax set");
926 /**************************************************************************//**
927 * Set number of logical read operations that were merged into physical read
928 * operations, e.g., two logical reads were served by one physical disk access;
929 * provide the minimum measurement within the measurement interval
931 * @note The property is treated as immutable: it is only valid to call
932 * the setter once. However, we don't assert if the caller tries to
933 * overwrite, just ignoring the update instead.
935 * @param disk_use Pointer to the Disk Use.
937 *****************************************************************************/
938 void evel_measurement_disk_use_mergereadmin_set(MEASUREMENT_DISK_USE * const disk_use,
942 evel_set_option_double(&disk_use->mergereadmin, val, "Disk merged loadmin set");
945 /**************************************************************************//**
946 * Set number of logical write operations that were merged into physical read
947 * operations, e.g., two logical writes were served by one physical disk access;
948 * provide the last measurement within the measurement interval
950 * @note The property is treated as immutable: it is only valid to call
951 * the setter once. However, we don't assert if the caller tries to
952 * overwrite, just ignoring the update instead.
954 * @param disk_use Pointer to the Disk Use.
956 *****************************************************************************/
957 void evel_measurement_disk_use_mergewritelast_set(MEASUREMENT_DISK_USE * const disk_use,
961 evel_set_option_double(&disk_use->mergewritelast, val, "Disk merged writelast set");
964 /**************************************************************************//**
965 * Set number of logical write operations that were merged into physical read
966 * operations, e.g., two logical writes were served by one physical disk access;
967 * provide the maximum measurement within the measurement interval
969 * @note The property is treated as immutable: it is only valid to call
970 * the setter once. However, we don't assert if the caller tries to
971 * overwrite, just ignoring the update instead.
973 * @param disk_use Pointer to the Disk Use.
975 *****************************************************************************/
976 void evel_measurement_disk_use_mergewritemax_set(MEASUREMENT_DISK_USE * const disk_use,
980 evel_set_option_double(&disk_use->mergewritemax, val, "Disk writemax set");
983 /**************************************************************************//**
984 * Set number of logical write operations that were merged into physical read
985 * operations, e.g., two logical writes were served by one physical disk access;
986 * provide the maximum measurement within the measurement interval
988 * @note The property is treated as immutable: it is only valid to call
989 * the setter once. However, we don't assert if the caller tries to
990 * overwrite, just ignoring the update instead.
992 * @param disk_use Pointer to the Disk Use.
994 *****************************************************************************/
995 void evel_measurement_disk_use_mergewritemin_set(MEASUREMENT_DISK_USE * const disk_use,
999 evel_set_option_double(&disk_use->mergewritemin, val, "Disk writemin set");
1003 /**************************************************************************//**
1004 * Set number of octets per second read from a disk or partition;
1005 * provide the average measurement within the measurement interval
1007 * @note The property is treated as immutable: it is only valid to call
1008 * the setter once. However, we don't assert if the caller tries to
1009 * overwrite, just ignoring the update instead.
1011 * @param disk_use Pointer to the Disk Use.
1013 *****************************************************************************/
1014 void evel_measurement_disk_use_octetsreadavg_set(MEASUREMENT_DISK_USE * const disk_use,
1018 evel_set_option_double(&disk_use->octetsreadavg, val, "Octets readavg set");
1022 /**************************************************************************//**
1023 * Set number of octets per second read from a disk or partition;
1024 * provide the last measurement within the measurement interval
1026 * @note The property is treated as immutable: it is only valid to call
1027 * the setter once. However, we don't assert if the caller tries to
1028 * overwrite, just ignoring the update instead.
1030 * @param disk_use Pointer to the Disk Use.
1032 *****************************************************************************/
1033 void evel_measurement_disk_use_octetsreadlast_set(MEASUREMENT_DISK_USE * const disk_use,
1037 evel_set_option_double(&disk_use->octetsreadlast, val, "Octets readlast set");
1041 /**************************************************************************//**
1042 * Set number of octets per second read from a disk or partition;
1043 * provide the maximum measurement within the measurement interval
1045 * @note The property is treated as immutable: it is only valid to call
1046 * the setter once. However, we don't assert if the caller tries to
1047 * overwrite, just ignoring the update instead.
1049 * @param disk_use Pointer to the Disk Use.
1051 *****************************************************************************/
1052 void evel_measurement_disk_use_octetsreadmax_set(MEASUREMENT_DISK_USE * const disk_use,
1056 evel_set_option_double(&disk_use->octetsreadmax, val, "Octets readmax set");
1059 /**************************************************************************//**
1060 * Set number of octets per second read from a disk or partition;
1061 * provide the minimum measurement within the measurement interval
1063 * @note The property is treated as immutable: it is only valid to call
1064 * the setter once. However, we don't assert if the caller tries to
1065 * overwrite, just ignoring the update instead.
1067 * @param disk_use Pointer to the Disk Use.
1069 *****************************************************************************/
1070 void evel_measurement_disk_use_octetsreadmin_set(MEASUREMENT_DISK_USE * const disk_use,
1074 evel_set_option_double(&disk_use->octetsreadmin, val, "Octets readmin set");
1077 /**************************************************************************//**
1078 * Set number of octets per second written to a disk or partition;
1079 * provide the average measurement within the measurement interval
1081 * @note The property is treated as immutable: it is only valid to call
1082 * the setter once. However, we don't assert if the caller tries to
1083 * overwrite, just ignoring the update instead.
1085 * @param disk_use Pointer to the Disk Use.
1087 *****************************************************************************/
1088 void evel_measurement_disk_use_octetswriteavg_set(MEASUREMENT_DISK_USE * const disk_use,
1092 evel_set_option_double(&disk_use->octetswriteavg, val, "Octets writeavg set");
1095 /**************************************************************************//**
1096 * Set number of octets per second written to a disk or partition;
1097 * provide the last measurement within the measurement interval
1099 * @note The property is treated as immutable: it is only valid to call
1100 * the setter once. However, we don't assert if the caller tries to
1101 * overwrite, just ignoring the update instead.
1103 * @param disk_use Pointer to the Disk Use.
1105 *****************************************************************************/
1106 void evel_measurement_disk_use_octetswritelast_set(MEASUREMENT_DISK_USE * const disk_use,
1110 evel_set_option_double(&disk_use->octetswritelast, val, "Octets writelast set");
1113 /**************************************************************************//**
1114 * Set number of octets per second written to a disk or partition;
1115 * provide the maximum measurement within the measurement interval
1117 * @note The property is treated as immutable: it is only valid to call
1118 * the setter once. However, we don't assert if the caller tries to
1119 * overwrite, just ignoring the update instead.
1121 * @param disk_use Pointer to the Disk Use.
1123 *****************************************************************************/
1124 void evel_measurement_disk_use_octetswritemax_set(MEASUREMENT_DISK_USE * const disk_use,
1128 evel_set_option_double(&disk_use->octetswritemax, val, "Octets writemax set");
1131 /**************************************************************************//**
1132 * Set number of octets per second written to a disk or partition;
1133 * provide the minimum measurement within the measurement interval
1135 * @note The property is treated as immutable: it is only valid to call
1136 * the setter once. However, we don't assert if the caller tries to
1137 * overwrite, just ignoring the update instead.
1139 * @param disk_use Pointer to the Disk Use.
1141 *****************************************************************************/
1142 void evel_measurement_disk_use_octetswritemin_set(MEASUREMENT_DISK_USE * const disk_use,
1146 evel_set_option_double(&disk_use->octetswritemin, val, "Octets writemin set");
1150 /**************************************************************************//**
1151 * Set number of read operations per second issued to the disk;
1152 * provide the average measurement within the measurement interval
1154 * @note The property is treated as immutable: it is only valid to call
1155 * the setter once. However, we don't assert if the caller tries to
1156 * overwrite, just ignoring the update instead.
1158 * @param disk_use Pointer to the Disk Use.
1160 *****************************************************************************/
1161 void evel_measurement_disk_use_opsreadavg_set(MEASUREMENT_DISK_USE * const disk_use,
1165 evel_set_option_double(&disk_use->opsreadavg, val, "Disk read operation average set");
1168 /**************************************************************************//**
1169 * Set number of read operations per second issued to the disk;
1170 * provide the last measurement within the measurement interval
1172 * @note The property is treated as immutable: it is only valid to call
1173 * the setter once. However, we don't assert if the caller tries to
1174 * overwrite, just ignoring the update instead.
1176 * @param disk_use Pointer to the Disk Use.
1178 *****************************************************************************/
1179 void evel_measurement_disk_use_opsreadlast_set(MEASUREMENT_DISK_USE * const disk_use,
1183 evel_set_option_double(&disk_use->opsreadlast, val, "Disk read operation last set");
1186 /**************************************************************************//**
1187 * Set number of read operations per second issued to the disk;
1188 * provide the maximum measurement within the measurement interval
1190 * @note The property is treated as immutable: it is only valid to call
1191 * the setter once. However, we don't assert if the caller tries to
1192 * overwrite, just ignoring the update instead.
1194 * @param disk_use Pointer to the Disk Use.
1196 *****************************************************************************/
1197 void evel_measurement_disk_use_opsreadmax_set(MEASUREMENT_DISK_USE * const disk_use,
1201 evel_set_option_double(&disk_use->opsreadmax, val, "Disk read operation maximum set");
1204 /**************************************************************************//**
1205 * Set number of read operations per second issued to the disk;
1206 * provide the minimum measurement within the measurement interval
1208 * @note The property is treated as immutable: it is only valid to call
1209 * the setter once. However, we don't assert if the caller tries to
1210 * overwrite, just ignoring the update instead.
1212 * @param disk_use Pointer to the Disk Use.
1214 *****************************************************************************/
1215 void evel_measurement_disk_use_opsreadmin_set(MEASUREMENT_DISK_USE * const disk_use,
1219 evel_set_option_double(&disk_use->opsreadmin, val, "Disk read operation minimum set");
1222 /**************************************************************************//**
1223 * Set number of write operations per second issued to the disk;
1224 * provide the average measurement within the measurement interval
1226 * @note The property is treated as immutable: it is only valid to call
1227 * the setter once. However, we don't assert if the caller tries to
1228 * overwrite, just ignoring the update instead.
1230 * @param disk_use Pointer to the Disk Use.
1232 *****************************************************************************/
1233 void evel_measurement_disk_use_opswriteavg_set(MEASUREMENT_DISK_USE * const disk_use,
1237 evel_set_option_double(&disk_use->opswriteavg, val, "Disk write operation average set");
1240 /**************************************************************************//**
1241 * Set number of write operations per second issued to the disk;
1242 * provide the last measurement within the measurement interval
1244 * @note The property is treated as immutable: it is only valid to call
1245 * the setter once. However, we don't assert if the caller tries to
1246 * overwrite, just ignoring the update instead.
1248 * @param disk_use Pointer to the Disk Use.
1250 *****************************************************************************/
1251 void evel_measurement_disk_use_opswritelast_set(MEASUREMENT_DISK_USE * const disk_use,
1255 evel_set_option_double(&disk_use->opswritelast, val, "Disk write operation last set");
1259 /**************************************************************************//**
1260 * Set number of write operations per second issued to the disk;
1261 * provide the maximum measurement within the measurement interval
1263 * @note The property is treated as immutable: it is only valid to call
1264 * the setter once. However, we don't assert if the caller tries to
1265 * overwrite, just ignoring the update instead.
1267 * @param disk_use Pointer to the Disk Use.
1269 *****************************************************************************/
1270 void evel_measurement_disk_use_opswritemax_set(MEASUREMENT_DISK_USE * const disk_use,
1274 evel_set_option_double(&disk_use->opswritemax, val, "Disk write operation maximum set");
1277 /**************************************************************************//**
1278 * Set number of write operations per second issued to the disk;
1279 * provide the average measurement within the measurement interval
1281 * @note The property is treated as immutable: it is only valid to call
1282 * the setter once. However, we don't assert if the caller tries to
1283 * overwrite, just ignoring the update instead.
1285 * @param disk_use Pointer to the Disk Use.
1287 *****************************************************************************/
1288 void evel_measurement_disk_use_opswritemin_set(MEASUREMENT_DISK_USE * const disk_use,
1292 evel_set_option_double(&disk_use->opswritemin, val, "Disk write operation minimum set");
1296 /**************************************************************************//**
1297 * Set queue size of pending I/O operations per second;
1298 * provide the average measurement within the measurement interval
1300 * @note The property is treated as immutable: it is only valid to call
1301 * the setter once. However, we don't assert if the caller tries to
1302 * overwrite, just ignoring the update instead.
1304 * @param disk_use Pointer to the Disk Use.
1306 *****************************************************************************/
1307 void evel_measurement_disk_use_pendingopsavg_set(MEASUREMENT_DISK_USE * const disk_use,
1311 evel_set_option_double(&disk_use->pendingopsavg, val, "Disk pending operation average set");
1314 /**************************************************************************//**
1315 * Set queue size of pending I/O operations per second;
1316 * provide the last measurement within the measurement interval
1318 * @note The property is treated as immutable: it is only valid to call
1319 * the setter once. However, we don't assert if the caller tries to
1320 * overwrite, just ignoring the update instead.
1322 * @param disk_use Pointer to the Disk Use.
1324 *****************************************************************************/
1325 void evel_measurement_disk_use_pendingopslast_set(MEASUREMENT_DISK_USE * const disk_use,
1329 evel_set_option_double(&disk_use->pendingopslast, val, "Disk pending operation last set");
1332 /**************************************************************************//**
1333 * Set queue size of pending I/O operations per second;
1334 * provide the maximum measurement within the measurement interval
1336 * @note The property is treated as immutable: it is only valid to call
1337 * the setter once. However, we don't assert if the caller tries to
1338 * overwrite, just ignoring the update instead.
1340 * @param disk_use Pointer to the Disk Use.
1342 *****************************************************************************/
1343 void evel_measurement_disk_use_pendingopsmax_set(MEASUREMENT_DISK_USE * const disk_use,
1347 evel_set_option_double(&disk_use->pendingopsmax, val, "Disk pending operation maximum set");
1350 /**************************************************************************//**
1351 * Set queue size of pending I/O operations per second;
1352 * provide the minimum measurement within the measurement interval
1354 * @note The property is treated as immutable: it is only valid to call
1355 * the setter once. However, we don't assert if the caller tries to
1356 * overwrite, just ignoring the update instead.
1358 * @param disk_use Pointer to the Disk Use.
1360 *****************************************************************************/
1361 void evel_measurement_disk_use_pendingopsmin_set(MEASUREMENT_DISK_USE * const disk_use,
1365 evel_set_option_double(&disk_use->pendingopsmin, val, "Disk pending operation min set");
1369 /**************************************************************************//**
1370 * Set milliseconds a read operation took to complete;
1371 * provide the average measurement within the measurement interval
1373 * @note The property is treated as immutable: it is only valid to call
1374 * the setter once. However, we don't assert if the caller tries to
1375 * overwrite, just ignoring the update instead.
1377 * @param disk_use Pointer to the Disk Use.
1379 *****************************************************************************/
1380 void evel_measurement_disk_use_timereadavg_set(MEASUREMENT_DISK_USE * const disk_use,
1384 evel_set_option_double(&disk_use->timereadavg, val, "Disk read time average set");
1387 /**************************************************************************//**
1388 * Set milliseconds a read operation took to complete;
1389 * provide the last measurement within the measurement interval
1391 * @note The property is treated as immutable: it is only valid to call
1392 * the setter once. However, we don't assert if the caller tries to
1393 * overwrite, just ignoring the update instead.
1395 * @param disk_use Pointer to the Disk Use.
1397 *****************************************************************************/
1398 void evel_measurement_disk_use_timereadlast_set(MEASUREMENT_DISK_USE * const disk_use,
1402 evel_set_option_double(&disk_use->timereadlast, val, "Disk read time last set");
1405 /**************************************************************************//**
1406 * Set milliseconds a read operation took to complete;
1407 * provide the maximum measurement within the measurement interval
1409 * @note The property is treated as immutable: it is only valid to call
1410 * the setter once. However, we don't assert if the caller tries to
1411 * overwrite, just ignoring the update instead.
1413 * @param disk_use Pointer to the Disk Use.
1415 *****************************************************************************/
1416 void evel_measurement_disk_use_timereadmax_set(MEASUREMENT_DISK_USE * const disk_use,
1420 evel_set_option_double(&disk_use->timereadmax, val, "Disk read time maximum set");
1423 /**************************************************************************//**
1424 * Set milliseconds a read operation took to complete;
1425 * provide the minimum measurement within the measurement interval
1427 * @note The property is treated as immutable: it is only valid to call
1428 * the setter once. However, we don't assert if the caller tries to
1429 * overwrite, just ignoring the update instead.
1431 * @param disk_use Pointer to the Disk Use.
1433 *****************************************************************************/
1434 void evel_measurement_disk_use_timereadmin_set(MEASUREMENT_DISK_USE * const disk_use,
1438 evel_set_option_double(&disk_use->timereadmin, val, "Disk read time minimum set");
1441 /**************************************************************************//**
1442 * Set milliseconds a write operation took to complete;
1443 * provide the average measurement within the measurement interval
1445 * @note The property is treated as immutable: it is only valid to call
1446 * the setter once. However, we don't assert if the caller tries to
1447 * overwrite, just ignoring the update instead.
1449 * @param disk_use Pointer to the Disk Use.
1451 *****************************************************************************/
1452 void evel_measurement_disk_use_timewriteavg_set(MEASUREMENT_DISK_USE * const disk_use,
1456 evel_set_option_double(&disk_use->timewriteavg, val, "Disk write time average set");
1460 /**************************************************************************//**
1461 * Set milliseconds a write operation took to complete;
1462 * provide the last measurement within the measurement interval
1464 * @note The property is treated as immutable: it is only valid to call
1465 * the setter once. However, we don't assert if the caller tries to
1466 * overwrite, just ignoring the update instead.
1468 * @param disk_use Pointer to the Disk Use.
1470 *****************************************************************************/
1471 void evel_measurement_disk_use_timewritelast_set(MEASUREMENT_DISK_USE * const disk_use,
1475 evel_set_option_double(&disk_use->timewritelast, val, "Disk write time last set");
1478 /**************************************************************************//**
1479 * Set milliseconds a write operation took to complete;
1480 * provide the maximum measurement within the measurement interval
1482 * @note The property is treated as immutable: it is only valid to call
1483 * the setter once. However, we don't assert if the caller tries to
1484 * overwrite, just ignoring the update instead.
1486 * @param disk_use Pointer to the Disk Use.
1488 *****************************************************************************/
1489 void evel_measurement_disk_use_timewritemax_set(MEASUREMENT_DISK_USE * const disk_use,
1493 evel_set_option_double(&disk_use->timewritemax, val, "Disk write time max set");
1496 /**************************************************************************//**
1497 * Set milliseconds a write operation took to complete;
1498 * provide the average measurement within the measurement interval
1500 * @note The property is treated as immutable: it is only valid to call
1501 * the setter once. However, we don't assert if the caller tries to
1502 * overwrite, just ignoring the update instead.
1504 * @param disk_use Pointer to the Disk Use.
1506 *****************************************************************************/
1507 void evel_measurement_disk_use_timewritemin_set(MEASUREMENT_DISK_USE * const disk_use,
1511 evel_set_option_double(&disk_use->timewritemin, val, "Disk write time min set");
1515 /**************************************************************************//**
1516 * Add an additional File System usage value name/value pair to the
1519 * The filesystem_name is null delimited ASCII string. The library takes a
1520 * copy so the caller does not have to preserve values after the function
1523 * @param measurement Pointer to the measurement.
1524 * @param filesystem_name ASCIIZ string with the file-system's UUID.
1525 * @param block_configured Block storage configured.
1526 * @param block_used Block storage in use.
1527 * @param block_iops Block storage IOPS.
1528 * @param ephemeral_configured Ephemeral storage configured.
1529 * @param ephemeral_used Ephemeral storage in use.
1530 * @param ephemeral_iops Ephemeral storage IOPS.
1531 *****************************************************************************/
1532 void evel_measurement_fsys_use_add(EVENT_MEASUREMENT * measurement,
1533 char * filesystem_name,
1534 double block_configured,
1537 double ephemeral_configured,
1538 double ephemeral_used,
1541 MEASUREMENT_FSYS_USE * fsys_use = NULL;
1544 /***************************************************************************/
1545 /* Check assumptions. */
1546 /***************************************************************************/
1547 assert(measurement != NULL);
1548 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1549 assert(filesystem_name != NULL);
1550 assert(block_configured >= 0.0);
1551 assert(block_used >= 0.0);
1552 assert(block_iops >= 0);
1553 assert(ephemeral_configured >= 0.0);
1554 assert(ephemeral_used >= 0.0);
1555 assert(ephemeral_iops >= 0);
1557 /***************************************************************************/
1558 /* Allocate a container for the value and push onto the list. */
1559 /***************************************************************************/
1560 EVEL_DEBUG("Adding filesystem_name=%s", filesystem_name);
1561 fsys_use = malloc(sizeof(MEASUREMENT_FSYS_USE));
1562 assert(fsys_use != NULL);
1563 memset(fsys_use, 0, sizeof(MEASUREMENT_FSYS_USE));
1564 fsys_use->filesystem_name = strdup(filesystem_name);
1565 fsys_use->block_configured = block_configured;
1566 fsys_use->block_used = block_used;
1567 fsys_use->block_iops = block_iops;
1568 fsys_use->ephemeral_configured = block_configured;
1569 fsys_use->ephemeral_used = ephemeral_used;
1570 fsys_use->ephemeral_iops = ephemeral_iops;
1572 dlist_push_last(&measurement->filesystem_usage, fsys_use);
1577 /**************************************************************************//**
1578 * Add a Feature usage value name/value pair to the Measurement.
1580 * The name is null delimited ASCII string. The library takes
1581 * a copy so the caller does not have to preserve values after the function
1584 * @param measurement Pointer to the measurement.
1585 * @param feature ASCIIZ string with the feature's name.
1586 * @param utilization Utilization of the feature.
1587 *****************************************************************************/
1588 void evel_measurement_feature_use_add(EVENT_MEASUREMENT * measurement,
1592 MEASUREMENT_FEATURE_USE * feature_use = NULL;
1595 /***************************************************************************/
1596 /* Check assumptions. */
1597 /***************************************************************************/
1598 assert(measurement != NULL);
1599 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1600 assert(feature != NULL);
1601 assert(utilization >= 0);
1603 /***************************************************************************/
1604 /* Allocate a container for the value and push onto the list. */
1605 /***************************************************************************/
1606 EVEL_DEBUG("Adding Feature=%s Use=%d", feature, utilization);
1607 feature_use = malloc(sizeof(MEASUREMENT_FEATURE_USE));
1608 assert(feature_use != NULL);
1609 memset(feature_use, 0, sizeof(MEASUREMENT_FEATURE_USE));
1610 feature_use->feature_id = strdup(feature);
1611 assert(feature_use->feature_id != NULL);
1612 feature_use->feature_utilization = utilization;
1614 dlist_push_last(&measurement->feature_usage, feature_use);
1619 /**************************************************************************//**
1620 * Add a Additional Measurement value name/value pair to the Report.
1622 * The name is null delimited ASCII string. The library takes
1623 * a copy so the caller does not have to preserve values after the function
1626 * @param measurement Pointer to the Measaurement.
1627 * @param group ASCIIZ string with the measurement group's name.
1628 * @param name ASCIIZ string containing the measurement's name.
1629 * @param value ASCIIZ string containing the measurement's value.
1630 *****************************************************************************/
1631 void evel_measurement_custom_measurement_add(EVENT_MEASUREMENT * measurement,
1632 const char * const group,
1633 const char * const name,
1634 const char * const value)
1636 MEASUREMENT_GROUP * measurement_group = NULL;
1637 CUSTOM_MEASUREMENT * custom_measurement = NULL;
1638 DLIST_ITEM * item = NULL;
1641 /***************************************************************************/
1642 /* Check assumptions. */
1643 /***************************************************************************/
1644 assert(measurement != NULL);
1645 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1646 assert(group != NULL);
1647 assert(name != NULL);
1648 assert(value != NULL);
1650 /***************************************************************************/
1651 /* Allocate a container for the name/value pair. */
1652 /***************************************************************************/
1653 EVEL_DEBUG("Adding Measurement Group=%s Name=%s Value=%s",
1654 group, name, value);
1655 custom_measurement = malloc(sizeof(CUSTOM_MEASUREMENT));
1656 assert(custom_measurement != NULL);
1657 memset(custom_measurement, 0, sizeof(CUSTOM_MEASUREMENT));
1658 custom_measurement->name = strdup(name);
1659 assert(custom_measurement->name != NULL);
1660 custom_measurement->value = strdup(value);
1661 assert(custom_measurement->value != NULL);
1663 /***************************************************************************/
1664 /* See if we have that group already. */
1665 /***************************************************************************/
1666 item = dlist_get_first(&measurement->additional_measurements);
1667 while (item != NULL)
1669 measurement_group = (MEASUREMENT_GROUP *) item->item;
1670 assert(measurement_group != NULL);
1672 EVEL_DEBUG("Got measurement group %s", measurement_group->name);
1673 if (strcmp(group, measurement_group->name) == 0)
1675 EVEL_DEBUG("Found existing Measurement Group");
1678 item = dlist_get_next(item);
1681 /***************************************************************************/
1682 /* If we didn't have the group already, create it. */
1683 /***************************************************************************/
1686 EVEL_DEBUG("Creating new Measurement Group");
1687 measurement_group = malloc(sizeof(MEASUREMENT_GROUP));
1688 assert(measurement_group != NULL);
1689 memset(measurement_group, 0, sizeof(MEASUREMENT_GROUP));
1690 measurement_group->name = strdup(group);
1691 assert(measurement_group->name != NULL);
1692 dlist_initialize(&measurement_group->measurements);
1693 dlist_push_last(&measurement->additional_measurements, measurement_group);
1696 /***************************************************************************/
1697 /* If we didn't have the group already, create it. */
1698 /***************************************************************************/
1699 dlist_push_last(&measurement_group->measurements, custom_measurement);
1704 /**************************************************************************//**
1705 * Add a Codec usage value name/value pair to the Measurement.
1707 * The name is null delimited ASCII string. The library takes
1708 * a copy so the caller does not have to preserve values after the function
1711 * @param measurement Pointer to the measurement.
1712 * @param codec ASCIIZ string with the codec's name.
1713 * @param utilization Number of codecs in use.
1714 *****************************************************************************/
1715 void evel_measurement_codec_use_add(EVENT_MEASUREMENT * measurement,
1719 MEASUREMENT_CODEC_USE * codec_use = NULL;
1722 /***************************************************************************/
1723 /* Check assumptions. */
1724 /***************************************************************************/
1725 assert(measurement != NULL);
1726 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1727 assert(codec != NULL);
1728 assert(utilization >= 0.0);
1730 /***************************************************************************/
1731 /* Allocate a container for the value and push onto the list. */
1732 /***************************************************************************/
1733 EVEL_DEBUG("Adding Codec=%s Use=%d", codec, utilization);
1734 codec_use = malloc(sizeof(MEASUREMENT_CODEC_USE));
1735 assert(codec_use != NULL);
1736 memset(codec_use, 0, sizeof(MEASUREMENT_CODEC_USE));
1737 codec_use->codec_id = strdup(codec);
1738 assert(codec_use->codec_id != NULL);
1739 codec_use->number_in_use = utilization;
1741 dlist_push_last(&measurement->codec_usage, codec_use);
1747 /**************************************************************************//**
1748 * Set the Media Ports in Use property of the Measurement.
1750 * @note The property is treated as immutable: it is only valid to call
1751 * the setter once. However, we don't assert if the caller tries to
1752 * overwrite, just ignoring the update instead.
1754 * @param measurement Pointer to the measurement.
1755 * @param media_ports_in_use The media port usage to set.
1756 *****************************************************************************/
1757 void evel_measurement_media_port_use_set(EVENT_MEASUREMENT * measurement,
1758 int media_ports_in_use)
1762 /***************************************************************************/
1763 /* Check preconditions. */
1764 /***************************************************************************/
1765 assert(measurement != NULL);
1766 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1767 assert(media_ports_in_use >= 0);
1769 evel_set_option_int(&measurement->media_ports_in_use,
1771 "Media Ports In Use");
1775 /**************************************************************************//**
1776 * Set the VNFC Scaling Metric property of the Measurement.
1778 * @note The property is treated as immutable: it is only valid to call
1779 * the setter once. However, we don't assert if the caller tries to
1780 * overwrite, just ignoring the update instead.
1782 * @param measurement Pointer to the measurement.
1783 * @param scaling_metric The scaling metric to set.
1784 *****************************************************************************/
1785 void evel_measurement_vnfc_scaling_metric_set(EVENT_MEASUREMENT * measurement,
1790 /***************************************************************************/
1791 /* Check preconditions. */
1792 /***************************************************************************/
1793 assert(measurement != NULL);
1794 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1795 assert(scaling_metric >= 0.0);
1797 evel_set_option_int(&measurement->vnfc_scaling_metric,
1799 "VNFC Scaling Metric");
1803 /**************************************************************************//**
1804 * Create a new Latency Bucket to be added to a Measurement event.
1806 * @note The mandatory fields on the ::MEASUREMENT_LATENCY_BUCKET must be
1807 * supplied to this factory function and are immutable once set.
1808 * Optional fields have explicit setter functions, but again values
1809 * may only be set once so that the ::MEASUREMENT_LATENCY_BUCKET has
1810 * immutable properties.
1812 * @param count Count of events in this bucket.
1814 * @returns pointer to the newly manufactured ::MEASUREMENT_LATENCY_BUCKET.
1815 * If the structure is not used it must be released using free.
1816 * @retval NULL Failed to create the Latency Bucket.
1817 *****************************************************************************/
1818 MEASUREMENT_LATENCY_BUCKET * evel_new_meas_latency_bucket(const int count)
1820 MEASUREMENT_LATENCY_BUCKET * bucket;
1824 /***************************************************************************/
1825 /* Check preconditions. */
1826 /***************************************************************************/
1829 /***************************************************************************/
1830 /* Allocate, then set Mandatory Parameters. */
1831 /***************************************************************************/
1832 EVEL_DEBUG("Creating bucket, count = %d", count);
1833 bucket = malloc(sizeof(MEASUREMENT_LATENCY_BUCKET));
1834 assert(bucket != NULL);
1836 /***************************************************************************/
1837 /* Set Mandatory Parameters. */
1838 /***************************************************************************/
1839 bucket->count = count;
1841 /***************************************************************************/
1842 /* Initialize Optional Parameters. */
1843 /***************************************************************************/
1844 evel_init_option_double(&bucket->high_end);
1845 evel_init_option_double(&bucket->low_end);
1852 /**************************************************************************//**
1853 * Set the High End property of the Measurement Latency Bucket.
1855 * @note The property is treated as immutable: it is only valid to call
1856 * the setter once. However, we don't assert if the caller tries to
1857 * overwrite, just ignoring the update instead.
1859 * @param bucket Pointer to the Measurement Latency Bucket.
1860 * @param high_end High end of the bucket's range.
1861 *****************************************************************************/
1862 void evel_meas_latency_bucket_high_end_set(
1863 MEASUREMENT_LATENCY_BUCKET * const bucket,
1864 const double high_end)
1868 /***************************************************************************/
1869 /* Check preconditions. */
1870 /***************************************************************************/
1871 assert(high_end >= 0.0);
1872 evel_set_option_double(&bucket->high_end, high_end, "High End");
1877 /**************************************************************************//**
1878 * Set the Low End property of the Measurement Latency Bucket.
1880 * @note The property is treated as immutable: it is only valid to call
1881 * the setter once. However, we don't assert if the caller tries to
1882 * overwrite, just ignoring the update instead.
1884 * @param bucket Pointer to the Measurement Latency Bucket.
1885 * @param low_end Low end of the bucket's range.
1886 *****************************************************************************/
1887 void evel_meas_latency_bucket_low_end_set(
1888 MEASUREMENT_LATENCY_BUCKET * const bucket,
1889 const double low_end)
1893 /***************************************************************************/
1894 /* Check preconditions. */
1895 /***************************************************************************/
1896 assert(low_end >= 0.0);
1897 evel_set_option_double(&bucket->low_end, low_end, "Low End");
1901 /**************************************************************************//**
1902 * Add an additional Measurement Latency Bucket to the specified event.
1904 * @param measurement Pointer to the Measurement event.
1905 * @param bucket Pointer to the Measurement Latency Bucket to add.
1906 *****************************************************************************/
1907 void evel_meas_latency_bucket_add(EVENT_MEASUREMENT * const measurement,
1908 MEASUREMENT_LATENCY_BUCKET * const bucket)
1912 /***************************************************************************/
1913 /* Check preconditions. */
1914 /***************************************************************************/
1915 assert(measurement != NULL);
1916 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1917 assert(bucket != NULL);
1918 dlist_push_last(&measurement->latency_distribution, bucket);
1923 /**************************************************************************//**
1924 * Add an additional Latency Distribution bucket to the Measurement.
1926 * This function implements the previous API, purely for convenience.
1928 * @param measurement Pointer to the measurement.
1929 * @param low_end Low end of the bucket's range.
1930 * @param high_end High end of the bucket's range.
1931 * @param count Count of events in this bucket.
1932 *****************************************************************************/
1933 void evel_measurement_latency_add(EVENT_MEASUREMENT * const measurement,
1934 const double low_end,
1935 const double high_end,
1938 MEASUREMENT_LATENCY_BUCKET * bucket = NULL;
1942 /***************************************************************************/
1943 /* Trust the assertions in the underlying methods. */
1944 /***************************************************************************/
1945 bucket = evel_new_meas_latency_bucket(count);
1946 evel_meas_latency_bucket_low_end_set(bucket, low_end);
1947 evel_meas_latency_bucket_high_end_set(bucket, high_end);
1948 evel_meas_latency_bucket_add(measurement, bucket);
1953 /**************************************************************************//**
1954 * Create a new vNIC Use to be added to a Measurement event.
1956 * @note The mandatory fields on the ::MEASUREMENT_VNIC_PERFORMANCE must be supplied
1957 * to this factory function and are immutable once set. Optional
1958 * fields have explicit setter functions, but again values may only be
1959 * set once so that the ::MEASUREMENT_VNIC_PERFORMANCE has immutable
1962 * @param vnic_id ASCIIZ string with the vNIC's ID.
1963 * @param val_suspect True or false confidence in data.
1965 * @returns pointer to the newly manufactured ::MEASUREMENT_VNIC_PERFORMANCE.
1966 * If the structure is not used it must be released using
1967 * ::evel_measurement_free_vnic_performance.
1968 * @retval NULL Failed to create the vNIC Use.
1969 *****************************************************************************/
1970 MEASUREMENT_VNIC_PERFORMANCE * evel_measurement_new_vnic_performance(char * const vnic_id,
1971 char * const val_suspect)
1973 MEASUREMENT_VNIC_PERFORMANCE * vnic_performance;
1977 /***************************************************************************/
1978 /* Check preconditions. */
1979 /***************************************************************************/
1980 assert(vnic_id != NULL);
1981 assert(!strcmp(val_suspect,"true") || !strcmp(val_suspect,"false"));
1983 /***************************************************************************/
1984 /* Allocate, then set Mandatory Parameters. */
1985 /***************************************************************************/
1986 EVEL_DEBUG("Adding VNIC ID=%s", vnic_id);
1987 vnic_performance = malloc(sizeof(MEASUREMENT_VNIC_PERFORMANCE));
1988 assert(vnic_performance != NULL);
1989 vnic_performance->vnic_id = strdup(vnic_id);
1990 vnic_performance->valuesaresuspect = strdup(val_suspect);
1992 /***************************************************************************/
1993 /* Initialize Optional Parameters. */
1994 /***************************************************************************/
1995 evel_init_option_double(&vnic_performance-> recvd_bcast_packets_acc);
1996 evel_init_option_double(&vnic_performance-> recvd_bcast_packets_delta);
1997 evel_init_option_double(&vnic_performance-> recvd_discarded_packets_acc);
1998 evel_init_option_double(&vnic_performance-> recvd_discarded_packets_delta);
1999 evel_init_option_double(&vnic_performance-> recvd_error_packets_acc);
2000 evel_init_option_double(&vnic_performance-> recvd_error_packets_delta);
2001 evel_init_option_double(&vnic_performance-> recvd_mcast_packets_acc);
2002 evel_init_option_double(&vnic_performance-> recvd_mcast_packets_delta);
2003 evel_init_option_double(&vnic_performance-> recvd_octets_acc);
2004 evel_init_option_double(&vnic_performance-> recvd_octets_delta);
2005 evel_init_option_double(&vnic_performance-> recvd_total_packets_acc);
2006 evel_init_option_double(&vnic_performance-> recvd_total_packets_delta);
2007 evel_init_option_double(&vnic_performance-> recvd_ucast_packets_acc);
2008 evel_init_option_double(&vnic_performance-> recvd_ucast_packets_delta);
2009 evel_init_option_double(&vnic_performance-> tx_bcast_packets_acc);
2010 evel_init_option_double(&vnic_performance-> tx_bcast_packets_delta);
2011 evel_init_option_double(&vnic_performance-> tx_discarded_packets_acc);
2012 evel_init_option_double(&vnic_performance-> tx_discarded_packets_delta);
2013 evel_init_option_double(&vnic_performance-> tx_error_packets_acc);
2014 evel_init_option_double(&vnic_performance-> tx_error_packets_delta);
2015 evel_init_option_double(&vnic_performance-> tx_mcast_packets_acc);
2016 evel_init_option_double(&vnic_performance-> tx_mcast_packets_delta);
2017 evel_init_option_double(&vnic_performance-> tx_octets_acc);
2018 evel_init_option_double(&vnic_performance-> tx_octets_delta);
2019 evel_init_option_double(&vnic_performance-> tx_total_packets_acc);
2020 evel_init_option_double(&vnic_performance-> tx_total_packets_delta);
2021 evel_init_option_double(&vnic_performance-> tx_ucast_packets_acc);
2022 evel_init_option_double(&vnic_performance-> tx_ucast_packets_delta);
2026 return vnic_performance;
2029 /**************************************************************************//**
2032 * Free off the ::MEASUREMENT_VNIC_PERFORMANCE supplied. Will free all the contained
2035 * @note It does not free the vNIC Use itself, since that may be part of a
2037 *****************************************************************************/
2038 void evel_measurement_free_vnic_performance(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance)
2042 /***************************************************************************/
2043 /* Check preconditions. */
2044 /***************************************************************************/
2045 assert(vnic_performance != NULL);
2046 assert(vnic_performance->vnic_id != NULL);
2047 assert(vnic_performance->valuesaresuspect != NULL);
2049 /***************************************************************************/
2050 /* Free the duplicated string. */
2051 /***************************************************************************/
2052 free(vnic_performance->vnic_id);
2053 free(vnic_performance->valuesaresuspect);
2054 vnic_performance->vnic_id = NULL;
2059 /**************************************************************************//**
2060 * Set the Accumulated Broadcast Packets Received in measurement interval
2061 * property of the vNIC performance.
2063 * @note The property is treated as immutable: it is only valid to call
2064 * the setter once. However, we don't assert if the caller tries to
2065 * overwrite, just ignoring the update instead.
2067 * @param vnic_performance Pointer to the vNIC Use.
2068 * @param recvd_bcast_packets_acc
2069 *****************************************************************************/
2070 void evel_vnic_performance_rx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2071 const double recvd_bcast_packets_acc)
2075 /***************************************************************************/
2076 /* Check preconditions. */
2077 /***************************************************************************/
2078 assert(recvd_bcast_packets_acc >= 0.0);
2080 evel_set_option_double(&vnic_performance->recvd_bcast_packets_acc,
2081 recvd_bcast_packets_acc,
2082 "Broadcast Packets accumulated");
2087 /**************************************************************************//**
2088 * Set the Delta Broadcast Packets Received in measurement interval
2089 * property of the vNIC performance.
2091 * @note The property is treated as immutable: it is only valid to call
2092 * the setter once. However, we don't assert if the caller tries to
2093 * overwrite, just ignoring the update instead.
2095 * @param vnic_performance Pointer to the vNIC Use.
2096 * @param recvd_bcast_packets_delta
2097 *****************************************************************************/
2098 void evel_vnic_performance_rx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2099 const double recvd_bcast_packets_delta)
2103 /***************************************************************************/
2104 /* Check preconditions. */
2105 /***************************************************************************/
2106 assert(recvd_bcast_packets_delta >= 0.0);
2108 evel_set_option_double(&vnic_performance->recvd_bcast_packets_delta,
2109 recvd_bcast_packets_delta,
2110 "Delta Broadcast Packets recieved");
2116 /**************************************************************************//**
2117 * Set the Discarded Packets Received in measurement interval
2118 * property of the vNIC performance.
2120 * @note The property is treated as immutable: it is only valid to call
2121 * the setter once. However, we don't assert if the caller tries to
2122 * overwrite, just ignoring the update instead.
2124 * @param vnic_performance Pointer to the vNIC Use.
2125 * @param recvd_discard_packets_acc
2126 *****************************************************************************/
2127 void evel_vnic_performance_rx_discard_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2128 const double recvd_discard_packets_acc)
2132 /***************************************************************************/
2133 /* Check preconditions. */
2134 /***************************************************************************/
2135 assert(recvd_discard_packets_acc >= 0.0);
2137 evel_set_option_double(&vnic_performance->recvd_discarded_packets_acc,
2138 recvd_discard_packets_acc,
2139 "Discarded Packets accumulated");
2144 /**************************************************************************//**
2145 * Set the Delta Discarded Packets Received in measurement interval
2146 * property of the vNIC performance.
2148 * @note The property is treated as immutable: it is only valid to call
2149 * the setter once. However, we don't assert if the caller tries to
2150 * overwrite, just ignoring the update instead.
2152 * @param vnic_performance Pointer to the vNIC Use.
2153 * @param recvd_discard_packets_delta
2154 *****************************************************************************/
2155 void evel_vnic_performance_rx_discard_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2156 const double recvd_discard_packets_delta)
2160 /***************************************************************************/
2161 /* Check preconditions. */
2162 /***************************************************************************/
2163 assert(recvd_discard_packets_delta >= 0.0);
2165 evel_set_option_double(&vnic_performance->recvd_discarded_packets_delta,
2166 recvd_discard_packets_delta,
2167 "Delta Discarded Packets recieved");
2173 /**************************************************************************//**
2174 * Set the Error Packets Received in measurement interval
2175 * property of the vNIC performance.
2177 * @note The property is treated as immutable: it is only valid to call
2178 * the setter once. However, we don't assert if the caller tries to
2179 * overwrite, just ignoring the update instead.
2181 * @param vnic_performance Pointer to the vNIC Use.
2182 * @param recvd_error_packets_acc
2183 *****************************************************************************/
2184 void evel_vnic_performance_rx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2185 const double recvd_error_packets_acc)
2189 /***************************************************************************/
2190 /* Check preconditions. */
2191 /***************************************************************************/
2192 assert(recvd_error_packets_acc >= 0.0);
2194 evel_set_option_double(&vnic_performance->recvd_error_packets_acc,
2195 recvd_error_packets_acc,
2196 "Error Packets received accumulated");
2201 /**************************************************************************//**
2202 * Set the Delta Error Packets Received in measurement interval
2203 * property of the vNIC performance.
2205 * @note The property is treated as immutable: it is only valid to call
2206 * the setter once. However, we don't assert if the caller tries to
2207 * overwrite, just ignoring the update instead.
2209 * @param vnic_performance Pointer to the vNIC Use.
2210 * @param recvd_error_packets_delta
2211 *****************************************************************************/
2212 void evel_vnic_performance_rx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2213 const double recvd_error_packets_delta)
2217 /***************************************************************************/
2218 /* Check preconditions. */
2219 /***************************************************************************/
2220 assert(recvd_error_packets_delta >= 0.0);
2222 evel_set_option_double(&vnic_performance->recvd_error_packets_delta,
2223 recvd_error_packets_delta,
2224 "Delta Error Packets recieved");
2229 /**************************************************************************//**
2230 * Set the Accumulated Multicast Packets Received in measurement interval
2231 * property of the vNIC performance.
2233 * @note The property is treated as immutable: it is only valid to call
2234 * the setter once. However, we don't assert if the caller tries to
2235 * overwrite, just ignoring the update instead.
2237 * @param vnic_performance Pointer to the vNIC Use.
2238 * @param recvd_mcast_packets_acc
2239 *****************************************************************************/
2240 void evel_vnic_performance_rx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2241 const double recvd_mcast_packets_acc)
2245 /***************************************************************************/
2246 /* Check preconditions. */
2247 /***************************************************************************/
2248 assert(recvd_mcast_packets_acc >= 0.0);
2250 evel_set_option_double(&vnic_performance->recvd_mcast_packets_acc,
2251 recvd_mcast_packets_acc,
2252 "Multicast Packets accumulated");
2257 /**************************************************************************//**
2258 * Set the Delta Multicast Packets Received in measurement interval
2259 * property of the vNIC performance.
2261 * @note The property is treated as immutable: it is only valid to call
2262 * the setter once. However, we don't assert if the caller tries to
2263 * overwrite, just ignoring the update instead.
2265 * @param vnic_performance Pointer to the vNIC Use.
2266 * @param recvd_mcast_packets_delta
2267 *****************************************************************************/
2268 void evel_vnic_performance_rx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2269 const double recvd_mcast_packets_delta)
2273 /***************************************************************************/
2274 /* Check preconditions. */
2275 /***************************************************************************/
2276 assert(recvd_mcast_packets_delta >= 0.0);
2278 evel_set_option_double(&vnic_performance->recvd_mcast_packets_delta,
2279 recvd_mcast_packets_delta,
2280 "Delta Multicast Packets recieved");
2285 /**************************************************************************//**
2286 * Set the Accumulated Octets Received in measurement interval
2287 * property of the vNIC performance.
2289 * @note The property is treated as immutable: it is only valid to call
2290 * the setter once. However, we don't assert if the caller tries to
2291 * overwrite, just ignoring the update instead.
2293 * @param vnic_performance Pointer to the vNIC Use.
2294 * @param recvd_octets_acc
2295 *****************************************************************************/
2296 void evel_vnic_performance_rx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2297 const double recvd_octets_acc)
2301 /***************************************************************************/
2302 /* Check preconditions. */
2303 /***************************************************************************/
2304 assert(recvd_octets_acc >= 0.0);
2306 evel_set_option_double(&vnic_performance->recvd_octets_acc,
2308 "Octets received accumulated");
2313 /**************************************************************************//**
2314 * Set the Delta Octets Received in measurement interval
2315 * property of the vNIC performance.
2317 * @note The property is treated as immutable: it is only valid to call
2318 * the setter once. However, we don't assert if the caller tries to
2319 * overwrite, just ignoring the update instead.
2321 * @param vnic_performance Pointer to the vNIC Use.
2322 * @param recvd_octets_delta
2323 *****************************************************************************/
2324 void evel_vnic_performance_rx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2325 const double recvd_octets_delta)
2329 /***************************************************************************/
2330 /* Check preconditions. */
2331 /***************************************************************************/
2332 assert(recvd_octets_delta >= 0.0);
2334 evel_set_option_double(&vnic_performance->recvd_octets_delta,
2336 "Delta Octets recieved");
2341 /**************************************************************************//**
2342 * Set the Accumulated Total Packets Received in measurement interval
2343 * property of the vNIC performance.
2345 * @note The property is treated as immutable: it is only valid to call
2346 * the setter once. However, we don't assert if the caller tries to
2347 * overwrite, just ignoring the update instead.
2349 * @param vnic_performance Pointer to the vNIC Use.
2350 * @param recvd_total_packets_acc
2351 *****************************************************************************/
2352 void evel_vnic_performance_rx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2353 const double recvd_total_packets_acc)
2357 /***************************************************************************/
2358 /* Check preconditions. */
2359 /***************************************************************************/
2360 assert(recvd_total_packets_acc >= 0.0);
2362 evel_set_option_double(&vnic_performance->recvd_total_packets_acc,
2363 recvd_total_packets_acc,
2364 "Total Packets accumulated");
2369 /**************************************************************************//**
2370 * Set the Delta Total Packets Received in measurement interval
2371 * property of the vNIC performance.
2373 * @note The property is treated as immutable: it is only valid to call
2374 * the setter once. However, we don't assert if the caller tries to
2375 * overwrite, just ignoring the update instead.
2377 * @param vnic_performance Pointer to the vNIC Use.
2378 * @param recvd_total_packets_delta
2379 *****************************************************************************/
2380 void evel_vnic_performance_rx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2381 const double recvd_total_packets_delta)
2385 /***************************************************************************/
2386 /* Check preconditions. */
2387 /***************************************************************************/
2388 assert(recvd_total_packets_delta >= 0.0);
2390 evel_set_option_double(&vnic_performance->recvd_total_packets_delta,
2391 recvd_total_packets_delta,
2392 "Delta Total Packets recieved");
2397 /**************************************************************************//**
2398 * Set the Accumulated Unicast Packets Received in measurement interval
2399 * property of the vNIC performance.
2401 * @note The property is treated as immutable: it is only valid to call
2402 * the setter once. However, we don't assert if the caller tries to
2403 * overwrite, just ignoring the update instead.
2405 * @param vnic_performance Pointer to the vNIC Use.
2406 * @param recvd_ucast_packets_acc
2407 *****************************************************************************/
2408 void evel_vnic_performance_rx_ucast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2409 const double recvd_ucast_packets_acc)
2413 /***************************************************************************/
2414 /* Check preconditions. */
2415 /***************************************************************************/
2416 assert(recvd_ucast_packets_acc >= 0.0);
2418 evel_set_option_double(&vnic_performance->recvd_ucast_packets_acc,
2419 recvd_ucast_packets_acc,
2420 "Unicast Packets received accumulated");
2425 /**************************************************************************//**
2426 * Set the Delta Unicast packets Received in measurement interval
2427 * property of the vNIC performance.
2429 * @note The property is treated as immutable: it is only valid to call
2430 * the setter once. However, we don't assert if the caller tries to
2431 * overwrite, just ignoring the update instead.
2433 * @param vnic_performance Pointer to the vNIC Use.
2434 * @param recvd_ucast_packets_delta
2435 *****************************************************************************/
2436 void evel_vnic_performance_rx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2437 const double recvd_ucast_packets_delta)
2441 /***************************************************************************/
2442 /* Check preconditions. */
2443 /***************************************************************************/
2444 assert(recvd_ucast_packets_delta >= 0.0);
2446 evel_set_option_double(&vnic_performance->recvd_ucast_packets_delta,
2447 recvd_ucast_packets_delta,
2448 "Delta Unicast packets recieved");
2453 /**************************************************************************//**
2454 * Set the Transmitted Broadcast Packets in measurement interval
2455 * property of the vNIC performance.
2457 * @note The property is treated as immutable: it is only valid to call
2458 * the setter once. However, we don't assert if the caller tries to
2459 * overwrite, just ignoring the update instead.
2461 * @param vnic_performance Pointer to the vNIC Use.
2462 * @param tx_bcast_packets_acc
2463 *****************************************************************************/
2464 void evel_vnic_performance_tx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2465 const double tx_bcast_packets_acc)
2469 /***************************************************************************/
2470 /* Check preconditions. */
2471 /***************************************************************************/
2472 assert(tx_bcast_packets_acc >= 0.0);
2474 evel_set_option_double(&vnic_performance->tx_bcast_packets_acc,
2475 tx_bcast_packets_acc,
2476 "Transmitted Broadcast Packets accumulated");
2481 /**************************************************************************//**
2482 * Set the Delta Broadcast packets Transmitted in measurement interval
2483 * property of the vNIC performance.
2485 * @note The property is treated as immutable: it is only valid to call
2486 * the setter once. However, we don't assert if the caller tries to
2487 * overwrite, just ignoring the update instead.
2489 * @param vnic_performance Pointer to the vNIC Use.
2490 * @param tx_bcast_packets_delta
2491 *****************************************************************************/
2492 void evel_vnic_performance_tx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2493 const double tx_bcast_packets_delta)
2497 /***************************************************************************/
2498 /* Check preconditions. */
2499 /***************************************************************************/
2500 assert(tx_bcast_packets_delta >= 0.0);
2502 evel_set_option_double(&vnic_performance->tx_bcast_packets_delta,
2503 tx_bcast_packets_delta,
2504 "Delta Transmitted Broadcast packets ");
2509 /**************************************************************************//**
2510 * Set the Transmitted Discarded Packets in measurement interval
2511 * property of the vNIC performance.
2513 * @note The property is treated as immutable: it is only valid to call
2514 * the setter once. However, we don't assert if the caller tries to
2515 * overwrite, just ignoring the update instead.
2517 * @param vnic_performance Pointer to the vNIC Use.
2518 * @param tx_discarded_packets_acc
2519 *****************************************************************************/
2520 void evel_vnic_performance_tx_discarded_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2521 const double tx_discarded_packets_acc)
2525 /***************************************************************************/
2526 /* Check preconditions. */
2527 /***************************************************************************/
2528 assert(tx_discarded_packets_acc >= 0.0);
2530 evel_set_option_double(&vnic_performance->tx_discarded_packets_acc,
2531 tx_discarded_packets_acc,
2532 "Transmitted Discarded Packets accumulated");
2537 /**************************************************************************//**
2538 * Set the Delta Discarded packets Transmitted in measurement interval
2539 * property of the vNIC performance.
2541 * @note The property is treated as immutable: it is only valid to call
2542 * the setter once. However, we don't assert if the caller tries to
2543 * overwrite, just ignoring the update instead.
2545 * @param vnic_performance Pointer to the vNIC Use.
2546 * @param tx_discarded_packets_delta
2547 *****************************************************************************/
2548 void evel_vnic_performance_tx_discarded_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2549 const double tx_discarded_packets_delta)
2553 /***************************************************************************/
2554 /* Check preconditions. */
2555 /***************************************************************************/
2556 assert(tx_discarded_packets_delta >= 0.0);
2558 evel_set_option_double(&vnic_performance->tx_discarded_packets_delta,
2559 tx_discarded_packets_delta,
2560 "Delta Transmitted Discarded packets ");
2565 /**************************************************************************//**
2566 * Set the Transmitted Errored Packets in measurement interval
2567 * property of the vNIC performance.
2569 * @note The property is treated as immutable: it is only valid to call
2570 * the setter once. However, we don't assert if the caller tries to
2571 * overwrite, just ignoring the update instead.
2573 * @param vnic_performance Pointer to the vNIC Use.
2574 * @param tx_error_packets_acc
2575 *****************************************************************************/
2576 void evel_vnic_performance_tx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2577 const double tx_error_packets_acc)
2581 /***************************************************************************/
2582 /* Check preconditions. */
2583 /***************************************************************************/
2584 assert(tx_error_packets_acc >= 0.0);
2586 evel_set_option_double(&vnic_performance->tx_error_packets_acc,
2587 tx_error_packets_acc,
2588 "Transmitted Error Packets accumulated");
2593 /**************************************************************************//**
2594 * Set the Delta Errored packets Transmitted in measurement interval
2595 * property of the vNIC performance.
2597 * @note The property is treated as immutable: it is only valid to call
2598 * the setter once. However, we don't assert if the caller tries to
2599 * overwrite, just ignoring the update instead.
2601 * @param vnic_performance Pointer to the vNIC Use.
2602 * @param tx_error_packets_delta
2603 *****************************************************************************/
2604 void evel_vnic_performance_tx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2605 const double tx_error_packets_delta)
2609 /***************************************************************************/
2610 /* Check preconditions. */
2611 /***************************************************************************/
2612 assert(tx_error_packets_delta >= 0.0);
2614 evel_set_option_double(&vnic_performance->tx_error_packets_delta,
2615 tx_error_packets_delta,
2616 "Delta Transmitted Error packets ");
2621 /**************************************************************************//**
2622 * Set the Transmitted Multicast Packets in measurement interval
2623 * property of the vNIC performance.
2625 * @note The property is treated as immutable: it is only valid to call
2626 * the setter once. However, we don't assert if the caller tries to
2627 * overwrite, just ignoring the update instead.
2629 * @param vnic_performance Pointer to the vNIC Use.
2630 * @param tx_mcast_packets_acc
2631 *****************************************************************************/
2632 void evel_vnic_performance_tx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2633 const double tx_mcast_packets_acc)
2637 /***************************************************************************/
2638 /* Check preconditions. */
2639 /***************************************************************************/
2640 assert(tx_mcast_packets_acc >= 0.0);
2642 evel_set_option_double(&vnic_performance->tx_mcast_packets_acc,
2643 tx_mcast_packets_acc,
2644 "Transmitted Multicast Packets accumulated");
2649 /**************************************************************************//**
2650 * Set the Delta Multicast packets Transmitted in measurement interval
2651 * property of the vNIC performance.
2653 * @note The property is treated as immutable: it is only valid to call
2654 * the setter once. However, we don't assert if the caller tries to
2655 * overwrite, just ignoring the update instead.
2657 * @param vnic_performance Pointer to the vNIC Use.
2658 * @param tx_mcast_packets_delta
2659 *****************************************************************************/
2660 void evel_vnic_performance_tx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2661 const double tx_mcast_packets_delta)
2665 /***************************************************************************/
2666 /* Check preconditions. */
2667 /***************************************************************************/
2668 assert(tx_mcast_packets_delta >= 0.0);
2670 evel_set_option_double(&vnic_performance->tx_mcast_packets_delta,
2671 tx_mcast_packets_delta,
2672 "Delta Transmitted Multicast packets ");
2677 /**************************************************************************//**
2678 * Set the Transmitted Octets in measurement interval
2679 * property of the vNIC performance.
2681 * @note The property is treated as immutable: it is only valid to call
2682 * the setter once. However, we don't assert if the caller tries to
2683 * overwrite, just ignoring the update instead.
2685 * @param vnic_performance Pointer to the vNIC Use.
2686 * @param tx_octets_acc
2687 *****************************************************************************/
2688 void evel_vnic_performance_tx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2689 const double tx_octets_acc)
2693 /***************************************************************************/
2694 /* Check preconditions. */
2695 /***************************************************************************/
2696 assert(tx_octets_acc >= 0.0);
2698 evel_set_option_double(&vnic_performance->tx_octets_acc,
2700 "Transmitted Octets accumulated");
2705 /**************************************************************************//**
2706 * Set the Delta Octets Transmitted in measurement interval
2707 * property of the vNIC performance.
2709 * @note The property is treated as immutable: it is only valid to call
2710 * the setter once. However, we don't assert if the caller tries to
2711 * overwrite, just ignoring the update instead.
2713 * @param vnic_performance Pointer to the vNIC Use.
2714 * @param tx_octets_delta
2715 *****************************************************************************/
2716 void evel_vnic_performance_tx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2717 const double tx_octets_delta)
2721 /***************************************************************************/
2722 /* Check preconditions. */
2723 /***************************************************************************/
2724 assert(tx_octets_delta >= 0.0);
2726 evel_set_option_double(&vnic_performance->tx_octets_delta,
2728 "Delta Transmitted Octets ");
2734 /**************************************************************************//**
2735 * Set the Transmitted Total Packets in measurement interval
2736 * property of the vNIC performance.
2738 * @note The property is treated as immutable: it is only valid to call
2739 * the setter once. However, we don't assert if the caller tries to
2740 * overwrite, just ignoring the update instead.
2742 * @param vnic_performance Pointer to the vNIC Use.
2743 * @param tx_total_packets_acc
2744 *****************************************************************************/
2745 void evel_vnic_performance_tx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2746 const double tx_total_packets_acc)
2750 /***************************************************************************/
2751 /* Check preconditions. */
2752 /***************************************************************************/
2753 assert(tx_total_packets_acc >= 0.0);
2755 evel_set_option_double(&vnic_performance->tx_total_packets_acc,
2756 tx_total_packets_acc,
2757 "Transmitted Total Packets accumulated");
2762 /**************************************************************************//**
2763 * Set the Delta Total Packets Transmitted in measurement interval
2764 * property of the vNIC performance.
2766 * @note The property is treated as immutable: it is only valid to call
2767 * the setter once. However, we don't assert if the caller tries to
2768 * overwrite, just ignoring the update instead.
2770 * @param vnic_performance Pointer to the vNIC Use.
2771 * @param tx_total_packets_delta
2772 *****************************************************************************/
2773 void evel_vnic_performance_tx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2774 const double tx_total_packets_delta)
2778 /***************************************************************************/
2779 /* Check preconditions. */
2780 /***************************************************************************/
2781 assert(tx_total_packets_delta >= 0.0);
2783 evel_set_option_double(&vnic_performance->tx_total_packets_delta,
2784 tx_total_packets_delta,
2785 "Delta Transmitted Total Packets ");
2791 /**************************************************************************//**
2792 * Set the Transmitted Unicast Packets in measurement interval
2793 * property of the vNIC performance.
2795 * @note The property is treated as immutable: it is only valid to call
2796 * the setter once. However, we don't assert if the caller tries to
2797 * overwrite, just ignoring the update instead.
2799 * @param vnic_performance Pointer to the vNIC Use.
2800 * @param tx_ucast_packets_acc
2801 *****************************************************************************/
2802 void evel_vnic_performance_tx_ucast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2803 const double tx_ucast_packets_acc)
2807 /***************************************************************************/
2808 /* Check preconditions. */
2809 /***************************************************************************/
2810 assert(tx_ucast_packets_acc >= 0.0);
2812 evel_set_option_double(&vnic_performance->tx_ucast_packets_acc,
2813 tx_ucast_packets_acc,
2814 "Transmitted Unicast Packets accumulated");
2819 /**************************************************************************//**
2820 * Set the Delta Octets Transmitted in measurement interval
2821 * property of the vNIC performance.
2823 * @note The property is treated as immutable: it is only valid to call
2824 * the setter once. However, we don't assert if the caller tries to
2825 * overwrite, just ignoring the update instead.
2827 * @param vnic_performance Pointer to the vNIC Use.
2828 * @param tx_ucast_packets_delta
2829 *****************************************************************************/
2830 void evel_vnic_performance_tx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2831 const double tx_ucast_packets_delta)
2835 /***************************************************************************/
2836 /* Check preconditions. */
2837 /***************************************************************************/
2838 assert(tx_ucast_packets_delta >= 0.0);
2840 evel_set_option_double(&vnic_performance->tx_ucast_packets_delta,
2841 tx_ucast_packets_delta,
2842 "Delta Transmitted Unicast Packets ");
2848 /**************************************************************************//**
2849 * Add an additional vNIC Use to the specified Measurement event.
2851 * @param measurement Pointer to the measurement.
2852 * @param vnic_performance Pointer to the vNIC Use to add.
2853 *****************************************************************************/
2854 void evel_meas_vnic_performance_add(EVENT_MEASUREMENT * const measurement,
2855 MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance)
2859 /***************************************************************************/
2860 /* Check preconditions. */
2861 /***************************************************************************/
2862 assert(measurement != NULL);
2863 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
2864 assert(vnic_performance != NULL);
2866 dlist_push_last(&measurement->vnic_usage, vnic_performance);
2871 /**************************************************************************//**
2872 * Add an additional vNIC usage record Measurement.
2874 * This function implements the previous API, purely for convenience.
2876 * The ID is null delimited ASCII string. The library takes a copy so the
2877 * caller does not have to preserve values after the function returns.
2879 * @param measurement Pointer to the measurement.
2880 * @param vnic_id ASCIIZ string with the vNIC's ID.
2881 * @param valset true or false confidence level
2882 * @param recvd_bcast_packets_acc Recieved broadcast packets
2883 * @param recvd_bcast_packets_delta Received delta broadcast packets
2884 * @param recvd_discarded_packets_acc Recieved discarded packets
2885 * @param recvd_discarded_packets_delta Received discarded delta packets
2886 * @param recvd_error_packets_acc Received error packets
2887 * @param recvd_error_packets_delta, Received delta error packets
2888 * @param recvd_mcast_packets_acc Received multicast packets
2889 * @param recvd_mcast_packets_delta Received delta multicast packets
2890 * @param recvd_octets_acc Received octets
2891 * @param recvd_octets_delta Received delta octets
2892 * @param recvd_total_packets_acc Received total packets
2893 * @param recvd_total_packets_delta Received delta total packets
2894 * @param recvd_ucast_packets_acc Received Unicast packets
2895 * @param recvd_ucast_packets_delta Received delta unicast packets
2896 * @param tx_bcast_packets_acc Transmitted broadcast packets
2897 * @param tx_bcast_packets_delta Transmitted delta broadcast packets
2898 * @param tx_discarded_packets_acc Transmitted packets discarded
2899 * @param tx_discarded_packets_delta Transmitted delta discarded packets
2900 * @param tx_error_packets_acc Transmitted error packets
2901 * @param tx_error_packets_delta Transmitted delta error packets
2902 * @param tx_mcast_packets_acc Transmitted multicast packets accumulated
2903 * @param tx_mcast_packets_delta Transmitted delta multicast packets
2904 * @param tx_octets_acc Transmitted octets
2905 * @param tx_octets_delta Transmitted delta octets
2906 * @param tx_total_packets_acc Transmitted total packets
2907 * @param tx_total_packets_delta Transmitted delta total packets
2908 * @param tx_ucast_packets_acc Transmitted Unicast packets
2909 * @param tx_ucast_packets_delta Transmitted delta Unicast packets
2910 *****************************************************************************/
2911 void evel_measurement_vnic_performance_add(EVENT_MEASUREMENT * const measurement,
2912 char * const vnic_id,
2914 double recvd_bcast_packets_acc,
2915 double recvd_bcast_packets_delta,
2916 double recvd_discarded_packets_acc,
2917 double recvd_discarded_packets_delta,
2918 double recvd_error_packets_acc,
2919 double recvd_error_packets_delta,
2920 double recvd_mcast_packets_acc,
2921 double recvd_mcast_packets_delta,
2922 double recvd_octets_acc,
2923 double recvd_octets_delta,
2924 double recvd_total_packets_acc,
2925 double recvd_total_packets_delta,
2926 double recvd_ucast_packets_acc,
2927 double recvd_ucast_packets_delta,
2928 double tx_bcast_packets_acc,
2929 double tx_bcast_packets_delta,
2930 double tx_discarded_packets_acc,
2931 double tx_discarded_packets_delta,
2932 double tx_error_packets_acc,
2933 double tx_error_packets_delta,
2934 double tx_mcast_packets_acc,
2935 double tx_mcast_packets_delta,
2936 double tx_octets_acc,
2937 double tx_octets_delta,
2938 double tx_total_packets_acc,
2939 double tx_total_packets_delta,
2940 double tx_ucast_packets_acc,
2941 double tx_ucast_packets_delta)
2943 MEASUREMENT_VNIC_PERFORMANCE * vnic_performance = NULL;
2946 /***************************************************************************/
2947 /* Trust the assertions in the underlying methods. */
2948 /***************************************************************************/
2949 vnic_performance = evel_measurement_new_vnic_performance(vnic_id, valset);
2951 evel_vnic_performance_rx_bcast_pkt_acc_set(vnic_performance, recvd_bcast_packets_acc);
2952 evel_vnic_performance_rx_bcast_pkt_delta_set(vnic_performance, recvd_bcast_packets_delta);
2953 evel_vnic_performance_rx_discard_pkt_acc_set(vnic_performance, recvd_discarded_packets_acc);
2954 evel_vnic_performance_rx_discard_pkt_delta_set(vnic_performance, recvd_discarded_packets_delta);
2955 evel_vnic_performance_rx_error_pkt_acc_set(vnic_performance, recvd_error_packets_acc);
2956 evel_vnic_performance_rx_error_pkt_delta_set(vnic_performance, recvd_error_packets_delta);
2957 evel_vnic_performance_rx_mcast_pkt_acc_set(vnic_performance, recvd_mcast_packets_acc);
2958 evel_vnic_performance_rx_mcast_pkt_delta_set(vnic_performance, recvd_mcast_packets_delta);
2959 evel_vnic_performance_rx_octets_acc_set(vnic_performance, recvd_octets_acc);
2960 evel_vnic_performance_rx_octets_delta_set(vnic_performance, recvd_octets_delta);
2961 evel_vnic_performance_rx_total_pkt_acc_set(vnic_performance, recvd_total_packets_acc);
2962 evel_vnic_performance_rx_total_pkt_delta_set(vnic_performance, recvd_total_packets_delta);
2963 evel_vnic_performance_rx_ucast_pkt_acc_set(vnic_performance, recvd_ucast_packets_acc);
2964 evel_vnic_performance_rx_ucast_pkt_delta_set(vnic_performance, recvd_ucast_packets_delta);
2965 evel_vnic_performance_tx_bcast_pkt_acc_set(vnic_performance, tx_bcast_packets_acc);
2966 evel_vnic_performance_tx_bcast_pkt_delta_set(vnic_performance, tx_bcast_packets_delta);
2967 evel_vnic_performance_tx_discarded_pkt_acc_set(vnic_performance, tx_discarded_packets_acc);
2968 evel_vnic_performance_tx_discarded_pkt_delta_set(vnic_performance, tx_discarded_packets_delta);
2969 evel_vnic_performance_tx_error_pkt_acc_set(vnic_performance, tx_error_packets_acc);
2970 evel_vnic_performance_tx_error_pkt_delta_set(vnic_performance, tx_error_packets_delta);
2971 evel_vnic_performance_tx_mcast_pkt_acc_set(vnic_performance, tx_mcast_packets_acc);
2972 evel_vnic_performance_tx_mcast_pkt_delta_set(vnic_performance, tx_mcast_packets_delta);
2973 evel_vnic_performance_tx_octets_acc_set(vnic_performance, tx_octets_acc);
2974 evel_vnic_performance_tx_octets_delta_set(vnic_performance, tx_octets_delta);
2975 evel_vnic_performance_tx_total_pkt_acc_set(vnic_performance, tx_total_packets_acc);
2976 evel_vnic_performance_tx_total_pkt_delta_set(vnic_performance, tx_total_packets_delta);
2977 evel_vnic_performance_tx_ucast_pkt_acc_set(vnic_performance, tx_ucast_packets_acc);
2978 evel_vnic_performance_tx_ucast_pkt_delta_set(vnic_performance, tx_ucast_packets_delta);
2979 evel_meas_vnic_performance_add(measurement, vnic_performance);
2982 /**************************************************************************//**
2983 * Encode the measurement as a JSON measurement.
2985 * @param jbuf Pointer to the ::EVEL_JSON_BUFFER to encode into.
2986 * @param event Pointer to the ::EVENT_HEADER to encode.
2987 *****************************************************************************/
2988 void evel_json_encode_measurement(EVEL_JSON_BUFFER * jbuf,
2989 EVENT_MEASUREMENT * event)
2991 MEASUREMENT_CPU_USE * cpu_use = NULL;
2992 MEASUREMENT_MEM_USE * mem_use = NULL;
2993 MEASUREMENT_DISK_USE * disk_use = NULL;
2994 MEASUREMENT_FSYS_USE * fsys_use = NULL;
2995 MEASUREMENT_LATENCY_BUCKET * bucket = NULL;
2996 MEASUREMENT_VNIC_PERFORMANCE * vnic_performance = NULL;
2997 MEASUREMENT_ERRORS * errors = NULL;
2998 MEASUREMENT_FEATURE_USE * feature_use = NULL;
2999 MEASUREMENT_CODEC_USE * codec_use = NULL;
3000 MEASUREMENT_GROUP * measurement_group = NULL;
3001 CUSTOM_MEASUREMENT * custom_measurement = NULL;
3002 DLIST_ITEM * item = NULL;
3003 DLIST_ITEM * nested_item = NULL;
3004 DLIST_ITEM * addl_info_item = NULL;
3005 OTHER_FIELD *addl_info = NULL;
3009 /***************************************************************************/
3010 /* Check preconditions. */
3011 /***************************************************************************/
3012 assert(event != NULL);
3013 assert(event->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
3015 evel_json_encode_header(jbuf, &event->header);
3016 evel_json_open_named_object(jbuf, "measurementsForVfScalingFields");
3018 /***************************************************************************/
3019 /* Mandatory fields. */
3020 /***************************************************************************/
3021 evel_enc_kv_int(jbuf, "measurementInterval", event->measurement_interval);
3023 /***************************************************************************/
3024 /* Optional fields. */
3025 /***************************************************************************/
3026 // additional fields
3027 evel_json_checkpoint(jbuf);
3028 if (evel_json_open_opt_named_list(jbuf, "additionalFields"))
3030 bool item_added = false;
3032 addl_info_item = dlist_get_first(&event->additional_info);
3033 while (addl_info_item != NULL)
3035 addl_info = (OTHER_FIELD*) addl_info_item->item;
3036 assert(addl_info != NULL);
3038 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3042 evel_json_open_object(jbuf);
3043 evel_enc_kv_string(jbuf, "name", addl_info->name);
3044 evel_enc_kv_string(jbuf, "value", addl_info->value);
3045 evel_json_close_object(jbuf);
3048 addl_info_item = dlist_get_next(addl_info_item);
3050 evel_json_close_list(jbuf);
3052 /*************************************************************************/
3053 /* If we've not written anything, rewind to before we opened the list. */
3054 /*************************************************************************/
3057 evel_json_rewind(jbuf);
3061 // TBD additional json objects
3062 evel_enc_kv_opt_int(jbuf, "concurrentSessions", &event->concurrent_sessions);
3063 evel_enc_kv_opt_int(jbuf, "configuredEntities", &event->configured_entities);
3065 /***************************************************************************/
3067 /***************************************************************************/
3068 evel_json_checkpoint(jbuf);
3069 if (evel_json_open_opt_named_list(jbuf, "cpuUsageArray"))
3071 bool item_added = false;
3073 item = dlist_get_first(&event->cpu_usage);
3074 while (item != NULL)
3076 cpu_use = (MEASUREMENT_CPU_USE*) item->item;
3077 assert(cpu_use != NULL);
3079 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3083 evel_json_open_object(jbuf);
3084 evel_enc_kv_string(jbuf, "cpuIdentifier", cpu_use->id);
3085 evel_enc_kv_opt_double(jbuf, "cpuIdle", &cpu_use->idle);
3086 evel_enc_kv_opt_double(jbuf, "cpuUsageInterrupt", &cpu_use->intrpt);
3087 evel_enc_kv_opt_double(jbuf, "cpuUsageNice", &cpu_use->nice);
3088 evel_enc_kv_opt_double(jbuf, "cpuUsageSoftIrq", &cpu_use->softirq);
3089 evel_enc_kv_opt_double(jbuf, "cpuUsageSteal", &cpu_use->steal);
3090 evel_enc_kv_opt_double(jbuf, "cpuUsageSystem", &cpu_use->sys);
3091 evel_enc_kv_opt_double(jbuf, "cpuUsageUser", &cpu_use->user);
3092 evel_enc_kv_opt_double(jbuf, "cpuWait", &cpu_use->wait);
3093 evel_enc_kv_double(jbuf, "percentUsage",cpu_use->usage);
3094 evel_json_close_object(jbuf);
3097 item = dlist_get_next(item);
3099 evel_json_close_list(jbuf);
3101 /*************************************************************************/
3102 /* If we've not written anything, rewind to before we opened the list. */
3103 /*************************************************************************/
3106 evel_json_rewind(jbuf);
3111 /***************************************************************************/
3112 /* Disk Use list. */
3113 /***************************************************************************/
3114 evel_json_checkpoint(jbuf);
3115 if (evel_json_open_opt_named_list(jbuf, "diskUsageArray"))
3117 bool item_added = false;
3119 item = dlist_get_first(&event->disk_usage);
3120 while (item != NULL)
3122 disk_use = (MEASUREMENT_DISK_USE*) item->item;
3123 assert(disk_use != NULL);
3125 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3129 evel_json_open_object(jbuf);
3130 evel_enc_kv_string(jbuf, "diskIdentifier", disk_use->id);
3131 evel_enc_kv_opt_double(jbuf, "diskIoTimeAvg", &disk_use->iotimeavg);
3132 evel_enc_kv_opt_double(jbuf, "diskIoTimeLast", &disk_use->iotimelast);
3133 evel_enc_kv_opt_double(jbuf, "diskIoTimeMax", &disk_use->iotimemax);
3134 evel_enc_kv_opt_double(jbuf, "diskIoTimeMin", &disk_use->iotimemin);
3135 evel_enc_kv_opt_double(jbuf, "diskMergedReadAvg", &disk_use->mergereadavg);
3136 evel_enc_kv_opt_double(jbuf, "diskMergedReadLast", &disk_use->mergereadlast);
3137 evel_enc_kv_opt_double(jbuf, "diskMergedReadMax", &disk_use->mergereadmax);
3138 evel_enc_kv_opt_double(jbuf, "diskMergedReadMin", &disk_use->mergereadmin);
3139 evel_enc_kv_opt_double(jbuf, "diskMergedWriteAvg", &disk_use->mergewriteavg);
3140 evel_enc_kv_opt_double(jbuf, "diskMergedWriteLast", &disk_use->mergewritelast);
3141 evel_enc_kv_opt_double(jbuf, "diskMergedWriteMax", &disk_use->mergewritemax);
3142 evel_enc_kv_opt_double(jbuf, "diskMergedWriteMin", &disk_use->mergewritemin);
3143 evel_enc_kv_opt_double(jbuf, "diskOctetsReadAvg", &disk_use->octetsreadavg);
3144 evel_enc_kv_opt_double(jbuf, "diskOctetsReadLast", &disk_use->octetsreadlast);
3145 evel_enc_kv_opt_double(jbuf, "diskOctetsReadMax", &disk_use->octetsreadmax);
3146 evel_enc_kv_opt_double(jbuf, "diskOctetsReadMin", &disk_use->octetsreadmin);
3147 evel_enc_kv_opt_double(jbuf, "diskOctetsWriteAvg", &disk_use->octetswriteavg);
3148 evel_enc_kv_opt_double(jbuf, "diskOctetsWriteLast", &disk_use->octetswritelast);
3149 evel_enc_kv_opt_double(jbuf, "diskOctetsWriteMax", &disk_use->octetswritemax);
3150 evel_enc_kv_opt_double(jbuf, "diskOctetsWriteMin", &disk_use->octetswritemin);
3151 evel_enc_kv_opt_double(jbuf, "diskOpsReadAvg", &disk_use->opsreadavg);
3152 evel_enc_kv_opt_double(jbuf, "diskOpsReadLast", &disk_use->opsreadlast);
3153 evel_enc_kv_opt_double(jbuf, "diskOpsReadMax", &disk_use->opsreadmax);
3154 evel_enc_kv_opt_double(jbuf, "diskOpsReadMin", &disk_use->opsreadmin);
3155 evel_enc_kv_opt_double(jbuf, "diskOpsWriteAvg", &disk_use->opswriteavg);
3156 evel_enc_kv_opt_double(jbuf, "diskOpsWriteLast", &disk_use->opswritelast);
3157 evel_enc_kv_opt_double(jbuf, "diskOpsWriteMax", &disk_use->opswritemax);
3158 evel_enc_kv_opt_double(jbuf, "diskOpsWriteMin", &disk_use->opswritemin);
3159 evel_enc_kv_opt_double(jbuf, "diskPendingOperationsAvg", &disk_use->pendingopsavg);
3160 evel_enc_kv_opt_double(jbuf, "diskPendingOperationsLast", &disk_use->pendingopslast);
3161 evel_enc_kv_opt_double(jbuf, "diskPendingOperationsMax", &disk_use->pendingopsmax);
3162 evel_enc_kv_opt_double(jbuf, "diskPendingOperationsMin", &disk_use->pendingopsmin);
3163 evel_enc_kv_opt_double(jbuf, "diskTimeReadAvg", &disk_use->timereadavg);
3164 evel_enc_kv_opt_double(jbuf, "diskTimeReadLast", &disk_use->timereadlast);
3165 evel_enc_kv_opt_double(jbuf, "diskTimeReadMax", &disk_use->timereadmax);
3166 evel_enc_kv_opt_double(jbuf, "diskTimeReadMin", &disk_use->timereadmin);
3167 evel_enc_kv_opt_double(jbuf, "diskTimeWriteAvg", &disk_use->timewriteavg);
3168 evel_enc_kv_opt_double(jbuf, "diskTimeWriteLast", &disk_use->timewritelast);
3169 evel_enc_kv_opt_double(jbuf, "diskTimeWriteMax", &disk_use->timewritemax);
3170 evel_enc_kv_opt_double(jbuf, "diskTimeWriteMin", &disk_use->timewritemin);
3171 evel_json_close_object(jbuf);
3174 item = dlist_get_next(item);
3176 evel_json_close_list(jbuf);
3178 /*************************************************************************/
3179 /* If we've not written anything, rewind to before we opened the list. */
3180 /*************************************************************************/
3183 evel_json_rewind(jbuf);
3187 /***************************************************************************/
3188 /* Filesystem Usage list. */
3189 /***************************************************************************/
3190 evel_json_checkpoint(jbuf);
3191 if (evel_json_open_opt_named_list(jbuf, "filesystemUsageArray"))
3193 bool item_added = false;
3195 item = dlist_get_first(&event->filesystem_usage);
3196 while (item != NULL)
3198 fsys_use = (MEASUREMENT_FSYS_USE *) item->item;
3199 assert(fsys_use != NULL);
3201 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3202 "filesystemUsageArray",
3203 fsys_use->filesystem_name))
3205 evel_json_open_object(jbuf);
3207 jbuf, "blockConfigured", fsys_use->block_configured);
3208 evel_enc_kv_int(jbuf, "blockIops", fsys_use->block_iops);
3209 evel_enc_kv_double(jbuf, "blockUsed", fsys_use->block_used);
3211 jbuf, "ephemeralConfigured", fsys_use->ephemeral_configured);
3212 evel_enc_kv_int(jbuf, "ephemeralIops", fsys_use->ephemeral_iops);
3213 evel_enc_kv_double(jbuf, "ephemeralUsed", fsys_use->ephemeral_used);
3214 evel_enc_kv_string(jbuf, "filesystemName", fsys_use->filesystem_name);
3215 evel_json_close_object(jbuf);
3218 item = dlist_get_next(item);
3220 evel_json_close_list(jbuf);
3222 /*************************************************************************/
3223 /* If we've not written anything, rewind to before we opened the list. */
3224 /*************************************************************************/
3227 evel_json_rewind(jbuf);
3231 /***************************************************************************/
3232 /* Latency distribution. */
3233 /***************************************************************************/
3234 item = dlist_get_first(&event->latency_distribution);
3235 if ((item != NULL) &&
3236 evel_json_open_opt_named_list(jbuf, "latencyDistribution"))
3238 while (item != NULL)
3240 bucket = (MEASUREMENT_LATENCY_BUCKET*) item->item;
3241 assert(bucket != NULL);
3243 evel_json_open_object(jbuf);
3244 evel_enc_kv_opt_double(
3245 jbuf, "lowEndOfLatencyBucket", &bucket->low_end);
3246 evel_enc_kv_opt_double(
3247 jbuf, "highEndOfLatencyBucket", &bucket->high_end);
3248 evel_enc_kv_int(jbuf, "countsInTheBucket", bucket->count);
3249 evel_json_close_object(jbuf);
3250 item = dlist_get_next(item);
3252 evel_json_close_list(jbuf);
3255 evel_enc_kv_opt_double(
3256 jbuf, "meanRequestLatency", &event->mean_request_latency);
3257 evel_enc_kv_opt_int(jbuf, "requestRate", &event->request_rate);
3259 /***************************************************************************/
3260 /* vNIC Usage TBD Performance array */
3261 /***************************************************************************/
3262 evel_json_checkpoint(jbuf);
3263 if (evel_json_open_opt_named_list(jbuf, "vNicUsageArray"))
3265 bool item_added = false;
3267 item = dlist_get_first(&event->vnic_usage);
3268 while (item != NULL)
3270 vnic_performance = (MEASUREMENT_VNIC_PERFORMANCE *) item->item;
3271 assert(vnic_performance != NULL);
3273 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3274 "vNicPerformanceArray",
3275 vnic_performance->vnic_id))
3277 evel_json_open_object(jbuf);
3279 /*********************************************************************/
3280 /* Optional fields. */
3281 /*********************************************************************/
3282 evel_enc_kv_opt_double( jbuf,
3283 "receivedBroadcastPacketsAccumulated", &vnic_performance->recvd_bcast_packets_acc);
3284 evel_enc_kv_opt_double( jbuf,
3285 "receivedBroadcastPacketsDelta", &vnic_performance->recvd_bcast_packets_delta);
3286 evel_enc_kv_opt_double( jbuf,
3287 "receivedDiscardedPacketsAccumulated", &vnic_performance->recvd_discarded_packets_acc);
3288 evel_enc_kv_opt_double( jbuf,
3289 "receivedDiscardedPacketsDelta", &vnic_performance->recvd_discarded_packets_delta);
3290 evel_enc_kv_opt_double( jbuf,
3291 "receivedErrorPacketsAccumulated", &vnic_performance->recvd_error_packets_acc);
3292 evel_enc_kv_opt_double( jbuf,
3293 "receivedErrorPacketsDelta", &vnic_performance->recvd_error_packets_delta);
3294 evel_enc_kv_opt_double( jbuf,
3295 "receivedMulticastPacketsAccumulated", &vnic_performance->recvd_mcast_packets_acc);
3296 evel_enc_kv_opt_double( jbuf,
3297 "receivedMulticastPacketsDelta", &vnic_performance->recvd_mcast_packets_delta);
3298 evel_enc_kv_opt_double( jbuf,
3299 "receivedOctetsAccumulated", &vnic_performance->recvd_octets_acc);
3300 evel_enc_kv_opt_double( jbuf,
3301 "receivedOctetsDelta", &vnic_performance->recvd_octets_delta);
3302 evel_enc_kv_opt_double( jbuf,
3303 "receivedTotalPacketsAccumulated", &vnic_performance->recvd_total_packets_acc);
3304 evel_enc_kv_opt_double( jbuf,
3305 "receivedTotalPacketsDelta", &vnic_performance->recvd_total_packets_delta);
3306 evel_enc_kv_opt_double( jbuf,
3307 "receivedUnicastPacketsAccumulated", &vnic_performance->recvd_ucast_packets_acc);
3308 evel_enc_kv_opt_double( jbuf,
3309 "receivedUnicastPacketsDelta", &vnic_performance->recvd_ucast_packets_delta);
3310 evel_enc_kv_opt_double( jbuf,
3311 "transmittedBroadcastPacketsAccumulated", &vnic_performance->tx_bcast_packets_acc);
3312 evel_enc_kv_opt_double( jbuf,
3313 "transmittedBroadcastPacketsDelta", &vnic_performance->tx_bcast_packets_delta);
3314 evel_enc_kv_opt_double( jbuf,
3315 "transmittedDiscardedPacketsAccumulated", &vnic_performance->tx_discarded_packets_acc);
3316 evel_enc_kv_opt_double( jbuf,
3317 "transmittedDiscardedPacketsDelta", &vnic_performance->tx_discarded_packets_delta);
3318 evel_enc_kv_opt_double( jbuf,
3319 "transmittedErrorPacketsAccumulated", &vnic_performance->tx_error_packets_acc);
3320 evel_enc_kv_opt_double( jbuf,
3321 "transmittedErrorPacketsDelta", &vnic_performance->tx_error_packets_delta);
3322 evel_enc_kv_opt_double( jbuf,
3323 "transmittedMulticastPacketsAccumulated", &vnic_performance->tx_mcast_packets_acc);
3324 evel_enc_kv_opt_double( jbuf,
3325 "transmittedMulticastPacketsDelta", &vnic_performance->tx_mcast_packets_delta);
3326 evel_enc_kv_opt_double( jbuf,
3327 "transmittedOctetsAccumulated", &vnic_performance->tx_octets_acc);
3328 evel_enc_kv_opt_double( jbuf,
3329 "transmittedOctetsDelta", &vnic_performance->tx_octets_delta);
3330 evel_enc_kv_opt_double( jbuf,
3331 "transmittedTotalPacketsAccumulated", &vnic_performance->tx_total_packets_acc);
3332 evel_enc_kv_opt_double( jbuf,
3333 "transmittedTotalPacketsDelta", &vnic_performance->tx_total_packets_delta);
3334 evel_enc_kv_opt_double( jbuf,
3335 "transmittedUnicastPacketsAccumulated", &vnic_performance->tx_ucast_packets_acc);
3336 evel_enc_kv_opt_double( jbuf,
3337 "transmittedUnicastPacketsDelta", &vnic_performance->tx_ucast_packets_delta);
3339 /*********************************************************************/
3340 /* Mandatory fields. */
3341 /*********************************************************************/
3342 evel_enc_kv_string(jbuf, "valuesAreSuspect", vnic_performance->valuesaresuspect);
3343 evel_enc_kv_string(jbuf, "vNicIdentifier", vnic_performance->vnic_id);
3345 evel_json_close_object(jbuf);
3348 item = dlist_get_next(item);
3351 evel_json_close_list(jbuf);
3353 /*************************************************************************/
3354 /* If we've not written anything, rewind to before we opened the list. */
3355 /*************************************************************************/
3358 evel_json_rewind(jbuf);
3363 /***************************************************************************/
3364 /* Memory Use list. */
3365 /***************************************************************************/
3366 evel_json_checkpoint(jbuf);
3367 if (evel_json_open_opt_named_list(jbuf, "memoryUsageArray"))
3369 bool item_added = false;
3371 item = dlist_get_first(&event->mem_usage);
3372 while (item != NULL)
3374 mem_use = (MEASUREMENT_MEM_USE*) item->item;
3375 assert(mem_use != NULL);
3377 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3381 evel_json_open_object(jbuf);
3382 evel_enc_kv_double(jbuf, "memoryBuffered", mem_use->membuffsz);
3383 evel_enc_kv_opt_double(jbuf, "memoryCached", &mem_use->memcache);
3384 evel_enc_kv_opt_double(jbuf, "memoryConfigured", &mem_use->memconfig);
3385 evel_enc_kv_opt_double(jbuf, "memoryFree", &mem_use->memfree);
3386 evel_enc_kv_opt_double(jbuf, "memorySlabRecl", &mem_use->slabrecl);
3387 evel_enc_kv_opt_double(jbuf, "memorySlabUnrecl", &mem_use->slabunrecl);
3388 evel_enc_kv_opt_double(jbuf, "memoryUsed", &mem_use->memused);
3389 evel_enc_kv_string(jbuf, "vmIdentifier", mem_use->id);
3390 evel_json_close_object(jbuf);
3393 item = dlist_get_next(item);
3395 evel_json_close_list(jbuf);
3397 /*************************************************************************/
3398 /* If we've not written anything, rewind to before we opened the list. */
3399 /*************************************************************************/
3402 evel_json_rewind(jbuf);
3407 evel_enc_kv_opt_int(
3408 jbuf, "numberOfMediaPortsInUse", &event->media_ports_in_use);
3409 evel_enc_kv_opt_int(
3410 jbuf, "vnfcScalingMetric", &event->vnfc_scaling_metric);
3412 /***************************************************************************/
3414 /***************************************************************************/
3415 if ((event->errors != NULL) &&
3416 evel_json_open_opt_named_object(jbuf, "errors"))
3418 errors = event->errors;
3419 evel_enc_kv_int(jbuf, "receiveDiscards", errors->receive_discards);
3420 evel_enc_kv_int(jbuf, "receiveErrors", errors->receive_errors);
3421 evel_enc_kv_int(jbuf, "transmitDiscards", errors->transmit_discards);
3422 evel_enc_kv_int(jbuf, "transmitErrors", errors->transmit_errors);
3423 evel_json_close_object(jbuf);
3426 /***************************************************************************/
3427 /* Feature Utilization list. */
3428 /***************************************************************************/
3429 evel_json_checkpoint(jbuf);
3430 if (evel_json_open_opt_named_list(jbuf, "featureUsageArray"))
3432 bool item_added = false;
3434 item = dlist_get_first(&event->feature_usage);
3435 while (item != NULL)
3437 feature_use = (MEASUREMENT_FEATURE_USE*) item->item;
3438 assert(feature_use != NULL);
3440 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3441 "featureUsageArray",
3442 feature_use->feature_id))
3444 evel_json_open_object(jbuf);
3445 evel_enc_kv_string(jbuf, "featureIdentifier", feature_use->feature_id);
3447 jbuf, "featureUtilization", feature_use->feature_utilization);
3448 evel_json_close_object(jbuf);
3451 item = dlist_get_next(item);
3453 evel_json_close_list(jbuf);
3455 /*************************************************************************/
3456 /* If we've not written anything, rewind to before we opened the list. */
3457 /*************************************************************************/
3460 evel_json_rewind(jbuf);
3464 /***************************************************************************/
3465 /* Codec Utilization list. */
3466 /***************************************************************************/
3467 evel_json_checkpoint(jbuf);
3468 if (evel_json_open_opt_named_list(jbuf, "codecUsageArray"))
3470 bool item_added = false;
3472 item = dlist_get_first(&event->codec_usage);
3473 while (item != NULL)
3475 codec_use = (MEASUREMENT_CODEC_USE*) item->item;
3476 assert(codec_use != NULL);
3478 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3480 codec_use->codec_id))
3482 evel_json_open_object(jbuf);
3483 evel_enc_kv_string(jbuf, "codecIdentifier", codec_use->codec_id);
3484 evel_enc_kv_int(jbuf, "numberInUse", codec_use->number_in_use);
3485 evel_json_close_object(jbuf);
3488 item = dlist_get_next(item);
3490 evel_json_close_list(jbuf);
3492 /*************************************************************************/
3493 /* If we've not written anything, rewind to before we opened the list. */
3494 /*************************************************************************/
3497 evel_json_rewind(jbuf);
3501 /***************************************************************************/
3502 /* Additional Measurement Groups list. */
3503 /***************************************************************************/
3504 evel_json_checkpoint(jbuf);
3505 if (evel_json_open_opt_named_list(jbuf, "additionalMeasurements"))
3507 bool item_added = false;
3509 item = dlist_get_first(&event->additional_measurements);
3510 while (item != NULL)
3512 measurement_group = (MEASUREMENT_GROUP *) item->item;
3513 assert(measurement_group != NULL);
3515 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3516 "additionalMeasurements",
3517 measurement_group->name))
3519 evel_json_open_object(jbuf);
3520 evel_enc_kv_string(jbuf, "name", measurement_group->name);
3521 evel_json_open_opt_named_list(jbuf, "measurements");
3523 /*********************************************************************/
3524 /* Measurements list. */
3525 /*********************************************************************/
3526 nested_item = dlist_get_first(&measurement_group->measurements);
3527 while (nested_item != NULL)
3529 custom_measurement = (CUSTOM_MEASUREMENT *) nested_item->item;
3530 assert(custom_measurement != NULL);
3532 evel_json_open_object(jbuf);
3533 evel_enc_kv_string(jbuf, "name", custom_measurement->name);
3534 evel_enc_kv_string(jbuf, "value", custom_measurement->value);
3535 evel_json_close_object(jbuf);
3536 nested_item = dlist_get_next(nested_item);
3538 evel_json_close_list(jbuf);
3539 evel_json_close_object(jbuf);
3542 item = dlist_get_next(item);
3544 evel_json_close_list(jbuf);
3546 /*************************************************************************/
3547 /* If we've not written anything, rewind to before we opened the list. */
3548 /*************************************************************************/
3551 evel_json_rewind(jbuf);
3555 /***************************************************************************/
3556 /* Although optional, we always generate the version. Note that this */
3557 /* closes the object, too. */
3558 /***************************************************************************/
3559 evel_enc_version(jbuf,
3560 "measurementsForVfScalingVersion",
3561 event->major_version,
3562 event->minor_version);
3563 evel_json_close_object(jbuf);
3568 /**************************************************************************//**
3569 * Free a Measurement.
3571 * Free off the Measurement supplied. Will free all the contained allocated
3574 * @note It does not free the Measurement itself, since that may be part of a
3576 *****************************************************************************/
3577 void evel_free_measurement(EVENT_MEASUREMENT * event)
3579 MEASUREMENT_CPU_USE * cpu_use = NULL;
3580 MEASUREMENT_DISK_USE * disk_use = NULL;
3581 MEASUREMENT_FSYS_USE * fsys_use = NULL;
3582 MEASUREMENT_LATENCY_BUCKET * bucket = NULL;
3583 MEASUREMENT_MEM_USE * mem_use = NULL;
3584 MEASUREMENT_VNIC_PERFORMANCE * vnic_performance = NULL;
3585 MEASUREMENT_FEATURE_USE * feature_use = NULL;
3586 MEASUREMENT_CODEC_USE * codec_use = NULL;
3587 MEASUREMENT_GROUP * measurement_group = NULL;
3588 CUSTOM_MEASUREMENT * measurement = NULL;
3589 OTHER_FIELD *addl_info = NULL;
3593 /***************************************************************************/
3594 /* Check preconditions. As an internal API we don't allow freeing NULL */
3595 /* events as we do on the public API. */
3596 /***************************************************************************/
3597 assert(event != NULL);
3598 assert(event->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
3600 /***************************************************************************/
3601 /* Free all internal strings then the header itself. */
3602 /***************************************************************************/
3603 addl_info = dlist_pop_last(&event->additional_info);
3604 while (addl_info != NULL)
3606 EVEL_DEBUG("Freeing Additional Info (%s, %s)",
3609 free(addl_info->name);
3610 free(addl_info->value);
3612 addl_info = dlist_pop_last(&event->additional_info);
3617 cpu_use = dlist_pop_last(&event->cpu_usage);
3618 while (cpu_use != NULL)
3620 EVEL_DEBUG("Freeing CPU use Info (%s)", cpu_use->id);
3623 cpu_use = dlist_pop_last(&event->cpu_usage);
3625 disk_use = dlist_pop_last(&event->disk_usage);
3626 while (disk_use != NULL)
3628 EVEL_DEBUG("Freeing Disk use Info (%s)", disk_use->id);
3631 disk_use = dlist_pop_last(&event->disk_usage);
3633 mem_use = dlist_pop_last(&event->mem_usage);
3634 while (mem_use != NULL)
3636 EVEL_DEBUG("Freeing Memory use Info (%s)", mem_use->id);
3638 free(mem_use->vmid);
3640 mem_use = dlist_pop_last(&event->mem_usage);
3643 fsys_use = dlist_pop_last(&event->filesystem_usage);
3644 while (fsys_use != NULL)
3646 EVEL_DEBUG("Freeing Filesystem Use info (%s)", fsys_use->filesystem_name);
3647 free(fsys_use->filesystem_name);
3649 fsys_use = dlist_pop_last(&event->filesystem_usage);
3652 bucket = dlist_pop_last(&event->latency_distribution);
3653 while (bucket != NULL)
3655 EVEL_DEBUG("Freeing Latency Bucket");
3657 bucket = dlist_pop_last(&event->latency_distribution);
3660 vnic_performance = dlist_pop_last(&event->vnic_usage);
3661 while (vnic_performance != NULL)
3663 EVEL_DEBUG("Freeing vNIC performance Info (%s)", vnic_performance->vnic_id);
3664 evel_measurement_free_vnic_performance(vnic_performance);
3665 free(vnic_performance);
3666 vnic_performance = dlist_pop_last(&event->vnic_usage);
3669 codec_use = dlist_pop_last(&event->codec_usage);
3670 while (codec_use != NULL)
3672 EVEL_DEBUG("Freeing Codec use Info (%s)", codec_use->codec_id);
3673 free(codec_use->codec_id);
3675 codec_use = dlist_pop_last(&event->codec_usage);
3678 if (event->errors != NULL)
3680 EVEL_DEBUG("Freeing Errors");
3681 free(event->errors);
3684 feature_use = dlist_pop_last(&event->feature_usage);
3685 while (feature_use != NULL)
3687 EVEL_DEBUG("Freeing Feature use Info (%s)", feature_use->feature_id);
3688 free(feature_use->feature_id);
3690 feature_use = dlist_pop_last(&event->feature_usage);
3693 measurement_group = dlist_pop_last(&event->additional_measurements);
3694 while (measurement_group != NULL)
3696 EVEL_DEBUG("Freeing Measurement Group (%s)", measurement_group->name);
3698 measurement = dlist_pop_last(&measurement_group->measurements);
3699 while (measurement != NULL)
3701 EVEL_DEBUG("Freeing Measurement (%s)", measurement->name);
3702 free(measurement->name);
3703 free(measurement->value);
3705 measurement = dlist_pop_last(&measurement_group->measurements);
3707 free(measurement_group->name);
3708 free(measurement_group);
3709 measurement_group = dlist_pop_last(&event->additional_measurements);
3712 evel_free_header(&event->header);