1 /*************************************************************************//**
3 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
5 * Unless otherwise specified, all software contained herein is
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
17 ****************************************************************************/
18 /**************************************************************************//**
20 * Implementation of EVEL functions relating to the Measurement.
22 ****************************************************************************/
29 #include "evel_internal.h"
30 #include "evel_throttle.h"
32 /**************************************************************************//**
33 * Create a new Measurement event.
35 * @note The mandatory fields on the Measurement must be supplied to this
36 * factory function and are immutable once set. Optional fields have
37 * explicit setter functions, but again values may only be set once so
38 * that the Measurement has immutable properties.
40 * @param measurement_interval
41 * @param event_name Unique Event Name confirming Domain AsdcModel Description
42 * @param event_id A universal identifier of the event for: troubleshooting correlation, analysis, etc
44 * @returns pointer to the newly manufactured ::EVENT_MEASUREMENT. If the
45 * event is not used (i.e. posted) it must be released using
47 * @retval NULL Failed to create the event.
48 *****************************************************************************/
49 EVENT_MEASUREMENT * evel_new_measurement(double measurement_interval, const char* ev_name, const char *ev_id)
51 EVENT_MEASUREMENT * measurement = NULL;
55 /***************************************************************************/
56 /* Check preconditions. */
57 /***************************************************************************/
58 assert(measurement_interval >= 0.0);
60 /***************************************************************************/
61 /* Allocate the measurement. */
62 /***************************************************************************/
63 measurement = malloc(sizeof(EVENT_MEASUREMENT));
64 if (measurement == NULL)
66 log_error_state("Out of memory for Measurement");
69 memset(measurement, 0, sizeof(EVENT_MEASUREMENT));
70 EVEL_DEBUG("New measurement is at %lp", measurement);
72 /***************************************************************************/
73 /* Initialize the header & the measurement fields. */
74 /***************************************************************************/
75 evel_init_header_nameid(&measurement->header,ev_name,ev_id);
76 measurement->header.event_domain = EVEL_DOMAIN_MEASUREMENT;
77 measurement->measurement_interval = measurement_interval;
78 dlist_initialize(&measurement->additional_info);
79 dlist_initialize(&measurement->additional_measurements);
80 dlist_initialize(&measurement->additional_objects);
81 dlist_initialize(&measurement->cpu_usage);
82 dlist_initialize(&measurement->disk_usage);
83 dlist_initialize(&measurement->mem_usage);
84 dlist_initialize(&measurement->filesystem_usage);
85 dlist_initialize(&measurement->latency_distribution);
86 dlist_initialize(&measurement->vnic_usage);
87 dlist_initialize(&measurement->codec_usage);
88 dlist_initialize(&measurement->feature_usage);
89 evel_init_option_double(&measurement->mean_request_latency);
90 evel_init_option_int(&measurement->vnfc_scaling_metric);
91 evel_init_option_int(&measurement->concurrent_sessions);
92 evel_init_option_int(&measurement->configured_entities);
93 evel_init_option_int(&measurement->media_ports_in_use);
94 evel_init_option_int(&measurement->request_rate);
95 measurement->major_version = EVEL_MEASUREMENT_MAJOR_VERSION;
96 measurement->minor_version = EVEL_MEASUREMENT_MINOR_VERSION;
103 /**************************************************************************//**
104 * Set the Event Type property of the Measurement.
106 * @note The property is treated as immutable: it is only valid to call
107 * the setter once. However, we don't assert if the caller tries to
108 * overwrite, just ignoring the update instead.
110 * @param measurement Pointer to the Measurement.
111 * @param type The Event Type to be set. ASCIIZ string. The caller
112 * does not need to preserve the value once the function
114 *****************************************************************************/
115 void evel_measurement_type_set(EVENT_MEASUREMENT * measurement,
116 const char * const type)
120 /***************************************************************************/
121 /* Check preconditions and call evel_header_type_set. */
122 /***************************************************************************/
123 assert(measurement != NULL);
124 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
125 evel_header_type_set(&measurement->header, type);
130 /**************************************************************************//**
131 * Add an additional value name/value pair to the Measurement.
133 * The name and value are null delimited ASCII strings. The library takes
134 * a copy so the caller does not have to preserve values after the function
137 * @param measurement Pointer to the measurement.
138 * @param name ASCIIZ string with the attribute's name. The caller
139 * does not need to preserve the value once the function
141 * @param value ASCIIZ string with the attribute's value. The caller
142 * does not need to preserve the value once the function
144 *****************************************************************************/
145 void evel_measurement_addl_info_add(EVENT_MEASUREMENT * measurement, char * name, char * value)
147 OTHER_FIELD * addl_info = NULL;
150 /***************************************************************************/
151 /* Check preconditions. */
152 /***************************************************************************/
153 assert(measurement != NULL);
154 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
155 assert(name != NULL);
156 assert(value != NULL);
158 EVEL_DEBUG("Adding name=%s value=%s", name, value);
159 addl_info = malloc(sizeof(OTHER_FIELD));
160 assert(addl_info != NULL);
161 memset(addl_info, 0, sizeof(OTHER_FIELD));
162 addl_info->name = strdup(name);
163 addl_info->value = strdup(value);
164 assert(addl_info->name != NULL);
165 assert(addl_info->value != NULL);
167 dlist_push_last(&measurement->additional_info, addl_info);
172 /**************************************************************************//**
173 * Set the Concurrent Sessions property of the Measurement.
175 * @note The property is treated as immutable: it is only valid to call
176 * the setter once. However, we don't assert if the caller tries to
177 * overwrite, just ignoring the update instead.
179 * @param measurement Pointer to the Measurement.
180 * @param concurrent_sessions The Concurrent Sessions to be set.
181 *****************************************************************************/
182 void evel_measurement_conc_sess_set(EVENT_MEASUREMENT * measurement,
183 int concurrent_sessions)
187 /***************************************************************************/
188 /* Check preconditions. */
189 /***************************************************************************/
190 assert(measurement != NULL);
191 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
192 assert(concurrent_sessions >= 0);
194 evel_set_option_int(&measurement->concurrent_sessions,
196 "Concurrent Sessions");
200 /**************************************************************************//**
201 * Set the Configured Entities property of the Measurement.
203 * @note The property is treated as immutable: it is only valid to call
204 * the setter once. However, we don't assert if the caller tries to
205 * overwrite, just ignoring the update instead.
207 * @param measurement Pointer to the Measurement.
208 * @param configured_entities The Configured Entities to be set.
209 *****************************************************************************/
210 void evel_measurement_cfg_ents_set(EVENT_MEASUREMENT * measurement,
211 int configured_entities)
215 /***************************************************************************/
216 /* Check preconditions. */
217 /***************************************************************************/
218 assert(measurement != NULL);
219 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
220 assert(configured_entities >= 0);
222 evel_set_option_int(&measurement->configured_entities,
224 "Configured Entities");
228 /**************************************************************************//**
229 * Add an additional set of Errors to the Measurement.
231 * @note The property is treated as immutable: it is only valid to call
232 * the setter once. However, we don't assert if the caller tries to
233 * overwrite, just ignoring the update instead.
235 * @param measurement Pointer to the measurement.
236 * @param receive_discards The number of receive discards.
237 * @param receive_errors The number of receive errors.
238 * @param transmit_discards The number of transmit discards.
239 * @param transmit_errors The number of transmit errors.
240 *****************************************************************************/
241 void evel_measurement_errors_set(EVENT_MEASUREMENT * measurement,
242 int receive_discards,
244 int transmit_discards,
247 MEASUREMENT_ERRORS * errors = NULL;
250 /***************************************************************************/
251 /* Check preconditions. */
252 /***************************************************************************/
253 assert(measurement != NULL);
254 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
255 assert(receive_discards >= 0);
256 assert(receive_errors >= 0);
257 assert(transmit_discards >= 0);
258 assert(transmit_errors >= 0);
260 if (measurement->errors == NULL)
262 EVEL_DEBUG("Adding Errors: %d, %d; %d, %d",
267 errors = malloc(sizeof(MEASUREMENT_ERRORS));
268 assert(errors != NULL);
269 memset(errors, 0, sizeof(MEASUREMENT_ERRORS));
270 errors->receive_discards = receive_discards;
271 errors->receive_errors = receive_errors;
272 errors->transmit_discards = transmit_discards;
273 errors->transmit_errors = transmit_errors;
274 measurement->errors = errors;
278 errors = measurement->errors;
279 EVEL_DEBUG("Ignoring attempt to add Errors: %d, %d; %d, %d\n"
280 "Errors already set: %d, %d; %d, %d",
285 errors->receive_discards,
286 errors->receive_errors,
287 errors->transmit_discards,
288 errors->transmit_errors);
294 /**************************************************************************//**
295 * Set the Mean Request Latency property of the Measurement.
297 * @note The property is treated as immutable: it is only valid to call
298 * the setter once. However, we don't assert if the caller tries to
299 * overwrite, just ignoring the update instead.
301 * @param measurement Pointer to the Measurement.
302 * @param mean_request_latency The Mean Request Latency to be set.
303 *****************************************************************************/
304 void evel_measurement_mean_req_lat_set(EVENT_MEASUREMENT * measurement,
305 double mean_request_latency)
309 /***************************************************************************/
310 /* Check preconditions. */
311 /***************************************************************************/
312 assert(measurement != NULL);
313 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
314 assert(mean_request_latency >= 0.0);
316 evel_set_option_double(&measurement->mean_request_latency,
317 mean_request_latency,
318 "Mean Request Latency");
323 /**************************************************************************//**
324 * Set the Request Rate property of the Measurement.
326 * @note The property is treated as immutable: it is only valid to call
327 * the setter once. However, we don't assert if the caller tries to
328 * overwrite, just ignoring the update instead.
330 * @param measurement Pointer to the Measurement.
331 * @param request_rate The Request Rate to be set.
332 *****************************************************************************/
333 void evel_measurement_request_rate_set(EVENT_MEASUREMENT * measurement,
338 /***************************************************************************/
339 /* Check preconditions. */
340 /***************************************************************************/
341 assert(measurement != NULL);
342 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
343 assert(request_rate >= 0);
345 evel_set_option_int(&measurement->request_rate,
351 /**************************************************************************//**
352 * Add an additional CPU usage value name/value pair to the Measurement.
354 * The name and value are null delimited ASCII strings. The library takes
355 * a copy so the caller does not have to preserve values after the function
358 * @param measurement Pointer to the measurement.
359 * @param id ASCIIZ string with the CPU's identifier.
360 * @param usage CPU utilization.
361 *****************************************************************************/
362 MEASUREMENT_CPU_USE *evel_measurement_new_cpu_use_add(EVENT_MEASUREMENT * measurement,
363 char * id, double usage)
365 MEASUREMENT_CPU_USE * cpu_use = NULL;
368 /***************************************************************************/
369 /* Check assumptions. */
370 /***************************************************************************/
371 assert(measurement != NULL);
372 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
374 assert(usage >= 0.0);
376 /***************************************************************************/
377 /* Allocate a container for the value and push onto the list. */
378 /***************************************************************************/
379 EVEL_DEBUG("Adding id=%s usage=%lf", id, usage);
380 cpu_use = malloc(sizeof(MEASUREMENT_CPU_USE));
381 assert(cpu_use != NULL);
382 memset(cpu_use, 0, sizeof(MEASUREMENT_CPU_USE));
383 cpu_use->id = strdup(id);
384 cpu_use->usage = usage;
385 evel_init_option_double(&cpu_use->idle);
386 evel_init_option_double(&cpu_use->intrpt);
387 evel_init_option_double(&cpu_use->nice);
388 evel_init_option_double(&cpu_use->softirq);
389 evel_init_option_double(&cpu_use->steal);
390 evel_init_option_double(&cpu_use->sys);
391 evel_init_option_double(&cpu_use->user);
392 evel_init_option_double(&cpu_use->wait);
394 dlist_push_last(&measurement->cpu_usage, cpu_use);
400 /**************************************************************************//**
401 * Set the CPU Idle value in measurement interval
402 * percentage of CPU time spent in the idle task
404 * @note The property is treated as immutable: it is only valid to call
405 * the setter once. However, we don't assert if the caller tries to
406 * overwrite, just ignoring the update instead.
408 * @param cpu_use Pointer to the CPU Use.
410 *****************************************************************************/
411 void evel_measurement_cpu_use_idle_set(MEASUREMENT_CPU_USE *const cpu_use,
415 evel_set_option_double(&cpu_use->idle, val, "CPU idle time");
419 /**************************************************************************//**
420 * Set the percentage of time spent servicing interrupts
422 * @note The property is treated as immutable: it is only valid to call
423 * the setter once. However, we don't assert if the caller tries to
424 * overwrite, just ignoring the update instead.
426 * @param cpu_use Pointer to the CPU Use.
428 *****************************************************************************/
429 void evel_measurement_cpu_use_interrupt_set(MEASUREMENT_CPU_USE * const cpu_use,
433 evel_set_option_double(&cpu_use->intrpt, val, "CPU interrupt value");
438 /**************************************************************************//**
439 * Set the percentage of time spent running user space processes that have been niced
441 * @note The property is treated as immutable: it is only valid to call
442 * the setter once. However, we don't assert if the caller tries to
443 * overwrite, just ignoring the update instead.
445 * @param cpu_use Pointer to the CPU Use.
447 *****************************************************************************/
448 void evel_measurement_cpu_use_nice_set(MEASUREMENT_CPU_USE * const cpu_use,
452 evel_set_option_double(&cpu_use->nice, val, "CPU nice value");
457 /**************************************************************************//**
458 * Set the percentage of time spent handling soft irq interrupts
460 * @note The property is treated as immutable: it is only valid to call
461 * the setter once. However, we don't assert if the caller tries to
462 * overwrite, just ignoring the update instead.
464 * @param cpu_use Pointer to the CPU Use.
466 *****************************************************************************/
467 void evel_measurement_cpu_use_softirq_set(MEASUREMENT_CPU_USE * const cpu_use,
471 evel_set_option_double(&cpu_use->softirq, val, "CPU Soft IRQ value");
475 /**************************************************************************//**
476 * Set the percentage of time spent in involuntary wait
478 * @note The property is treated as immutable: it is only valid to call
479 * the setter once. However, we don't assert if the caller tries to
480 * overwrite, just ignoring the update instead.
482 * @param cpu_use Pointer to the CPU Use.
484 *****************************************************************************/
485 void evel_measurement_cpu_use_steal_set(MEASUREMENT_CPU_USE * const cpu_use,
489 evel_set_option_double(&cpu_use->steal, val, "CPU involuntary wait");
493 /**************************************************************************//**
494 * Set the percentage of time spent on system tasks running the kernel
496 * @note The property is treated as immutable: it is only valid to call
497 * the setter once. However, we don't assert if the caller tries to
498 * overwrite, just ignoring the update instead.
500 * @param cpu_use Pointer to the CPU Use.
502 *****************************************************************************/
503 void evel_measurement_cpu_use_system_set(MEASUREMENT_CPU_USE * const cpu_use,
507 evel_set_option_double(&cpu_use->sys, val, "CPU System load");
512 /**************************************************************************//**
513 * Set the percentage of time spent running un-niced user space processes
515 * @note The property is treated as immutable: it is only valid to call
516 * the setter once. However, we don't assert if the caller tries to
517 * overwrite, just ignoring the update instead.
519 * @param cpu_use Pointer to the CPU Use.
521 *****************************************************************************/
522 void evel_measurement_cpu_use_usageuser_set(MEASUREMENT_CPU_USE * const cpu_use,
526 evel_set_option_double(&cpu_use->user, val, "CPU User load value");
530 /**************************************************************************//**
531 * Set the percentage of CPU time spent waiting for I/O operations to complete
533 * @note The property is treated as immutable: it is only valid to call
534 * the setter once. However, we don't assert if the caller tries to
535 * overwrite, just ignoring the update instead.
537 * @param cpu_use Pointer to the CPU Use.
539 *****************************************************************************/
540 void evel_measurement_cpu_use_wait_set(MEASUREMENT_CPU_USE * const cpu_use,
544 evel_set_option_double(&cpu_use->wait, val, "CPU Wait IO value");
549 /**************************************************************************//**
550 * Add an additional Memory usage value name/value pair to the Measurement.
552 * The name and value are null delimited ASCII strings. The library takes
553 * a copy so the caller does not have to preserve values after the function
556 * @param measurement Pointer to the measurement.
557 * @param id ASCIIZ string with the Memory identifier.
558 * @param vmidentifier ASCIIZ string with the VM's identifier.
559 * @param membuffsz Memory Size.
561 * @return Returns pointer to memory use structure in measurements
562 *****************************************************************************/
563 MEASUREMENT_MEM_USE * evel_measurement_new_mem_use_add(EVENT_MEASUREMENT * measurement,
564 char * id, char *vmidentifier, double membuffsz)
566 MEASUREMENT_MEM_USE * mem_use = NULL;
569 /***************************************************************************/
570 /* Check assumptions. */
571 /***************************************************************************/
572 assert(measurement != NULL);
573 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
575 assert(membuffsz >= 0.0);
577 /***************************************************************************/
578 /* Allocate a container for the value and push onto the list. */
579 /***************************************************************************/
580 EVEL_DEBUG("Adding id=%s buffer size=%lf", id, membuffsz);
581 mem_use = malloc(sizeof(MEASUREMENT_MEM_USE));
582 assert(mem_use != NULL);
583 memset(mem_use, 0, sizeof(MEASUREMENT_MEM_USE));
584 mem_use->id = strdup(id);
585 mem_use->vmid = strdup(vmidentifier);
586 mem_use->membuffsz = membuffsz;
587 evel_init_option_double(&mem_use->memcache);
588 evel_init_option_double(&mem_use->memconfig);
589 evel_init_option_double(&mem_use->memfree);
590 evel_init_option_double(&mem_use->slabrecl);
591 evel_init_option_double(&mem_use->slabunrecl);
592 evel_init_option_double(&mem_use->memused);
594 assert(mem_use->id != NULL);
596 dlist_push_last(&measurement->mem_usage, mem_use);
602 /**************************************************************************//**
603 * Set kilobytes of memory used for cache
605 * @note The property is treated as immutable: it is only valid to call
606 * the setter once. However, we don't assert if the caller tries to
607 * overwrite, just ignoring the update instead.
609 * @param mem_use Pointer to the Memory Use.
611 *****************************************************************************/
612 void evel_measurement_mem_use_memcache_set(MEASUREMENT_MEM_USE * const mem_use,
616 evel_set_option_double(&mem_use->memcache, val, "Memory cache value");
620 /**************************************************************************//**
621 * Set kilobytes of memory configured in the virtual machine on which the VNFC reporting
623 * @note The property is treated as immutable: it is only valid to call
624 * the setter once. However, we don't assert if the caller tries to
625 * overwrite, just ignoring the update instead.
627 * @param mem_use Pointer to the Memory Use.
629 *****************************************************************************/
630 void evel_measurement_mem_use_memconfig_set(MEASUREMENT_MEM_USE * const mem_use,
634 evel_set_option_double(&mem_use->memconfig, val, "Memory configured value");
638 /**************************************************************************//**
639 * Set kilobytes of physical RAM left unused by the system
641 * @note The property is treated as immutable: it is only valid to call
642 * the setter once. However, we don't assert if the caller tries to
643 * overwrite, just ignoring the update instead.
645 * @param mem_use Pointer to the Memory Use.
647 *****************************************************************************/
648 void evel_measurement_mem_use_memfree_set(MEASUREMENT_MEM_USE * const mem_use,
652 evel_set_option_double(&mem_use->memfree, val, "Memory freely available value");
656 /**************************************************************************//**
657 * Set the part of the slab that can be reclaimed such as caches measured in kilobytes
659 * @note The property is treated as immutable: it is only valid to call
660 * the setter once. However, we don't assert if the caller tries to
661 * overwrite, just ignoring the update instead.
663 * @param mem_use Pointer to the Memory Use.
665 *****************************************************************************/
666 void evel_measurement_mem_use_slab_reclaimed_set(MEASUREMENT_MEM_USE * const mem_use,
670 evel_set_option_double(&mem_use->slabrecl, val, "Memory reclaimable slab set");
674 /**************************************************************************//**
675 * Set the part of the slab that cannot be reclaimed such as caches measured in kilobytes
677 * @note The property is treated as immutable: it is only valid to call
678 * the setter once. However, we don't assert if the caller tries to
679 * overwrite, just ignoring the update instead.
681 * @param mem_use Pointer to the Memory Use.
683 *****************************************************************************/
684 void evel_measurement_mem_use_slab_unreclaimable_set(MEASUREMENT_MEM_USE * const mem_use,
688 evel_set_option_double(&mem_use->slabunrecl, val, "Memory unreclaimable slab set");
692 /**************************************************************************//**
693 * Set the total memory minus the sum of free, buffered, cached and slab memory in kilobytes
695 * @note The property is treated as immutable: it is only valid to call
696 * the setter once. However, we don't assert if the caller tries to
697 * overwrite, just ignoring the update instead.
699 * @param mem_use Pointer to the Memory Use.
701 *****************************************************************************/
702 void evel_measurement_mem_use_usedup_set(MEASUREMENT_MEM_USE * const mem_use,
706 evel_set_option_double(&mem_use->memused, val, "Memory usedup total set");
710 /**************************************************************************//**
711 * Add an additional Disk usage value name/value pair to the Measurement.
713 * The name and value are null delimited ASCII strings. The library takes
714 * a copy so the caller does not have to preserve values after the function
717 * @param measurement Pointer to the measurement.
718 * @param id ASCIIZ string with the CPU's identifier.
719 * @param usage Disk utilization.
720 *****************************************************************************/
721 MEASUREMENT_DISK_USE * evel_measurement_new_disk_use_add(EVENT_MEASUREMENT * measurement, char * id)
723 MEASUREMENT_DISK_USE * disk_use = NULL;
726 /***************************************************************************/
727 /* Check assumptions. */
728 /***************************************************************************/
729 assert(measurement != NULL);
730 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
733 /***************************************************************************/
734 /* Allocate a container for the value and push onto the list. */
735 /***************************************************************************/
736 EVEL_DEBUG("Adding id=%s disk usage", id);
737 disk_use = malloc(sizeof(MEASUREMENT_DISK_USE));
738 assert(disk_use != NULL);
739 memset(disk_use, 0, sizeof(MEASUREMENT_DISK_USE));
740 disk_use->id = strdup(id);
741 assert(disk_use->id != NULL);
742 dlist_push_last(&measurement->disk_usage, disk_use);
744 evel_init_option_double(&disk_use->iotimeavg );
745 evel_init_option_double(&disk_use->iotimelast );
746 evel_init_option_double(&disk_use->iotimemax );
747 evel_init_option_double(&disk_use->iotimemin );
748 evel_init_option_double(&disk_use->mergereadavg );
749 evel_init_option_double(&disk_use->mergereadlast );
750 evel_init_option_double(&disk_use->mergereadmax );
751 evel_init_option_double(&disk_use->mergereadmin );
752 evel_init_option_double(&disk_use->mergewriteavg );
753 evel_init_option_double(&disk_use->mergewritelast );
754 evel_init_option_double(&disk_use->mergewritemax );
755 evel_init_option_double(&disk_use->mergewritemin );
756 evel_init_option_double(&disk_use->octetsreadavg );
757 evel_init_option_double(&disk_use->octetsreadlast );
758 evel_init_option_double(&disk_use->octetsreadmax );
759 evel_init_option_double(&disk_use->octetsreadmin );
760 evel_init_option_double(&disk_use->octetswriteavg );
761 evel_init_option_double(&disk_use->octetswritelast );
762 evel_init_option_double(&disk_use->octetswritemax );
763 evel_init_option_double(&disk_use->octetswritemin );
764 evel_init_option_double(&disk_use->opsreadavg );
765 evel_init_option_double(&disk_use->opsreadlast );
766 evel_init_option_double(&disk_use->opsreadmax );
767 evel_init_option_double(&disk_use->opsreadmin );
768 evel_init_option_double(&disk_use->opswriteavg );
769 evel_init_option_double(&disk_use->opswritelast );
770 evel_init_option_double(&disk_use->opswritemax );
771 evel_init_option_double(&disk_use->opswritemin );
772 evel_init_option_double(&disk_use->pendingopsavg );
773 evel_init_option_double(&disk_use->pendingopslast );
774 evel_init_option_double(&disk_use->pendingopsmax );
775 evel_init_option_double(&disk_use->pendingopsmin );
776 evel_init_option_double(&disk_use->timereadavg );
777 evel_init_option_double(&disk_use->timereadlast );
778 evel_init_option_double(&disk_use->timereadmax );
779 evel_init_option_double(&disk_use->timereadmin );
780 evel_init_option_double(&disk_use->timewriteavg );
781 evel_init_option_double(&disk_use->timewritelast );
782 evel_init_option_double(&disk_use->timewritemax );
783 evel_init_option_double(&disk_use->timewritemin );
789 /**************************************************************************//**
790 * Set milliseconds spent doing input/output operations over 1 sec; treat
791 * this metric as a device load percentage where 1000ms matches 100% load;
792 * provide the average over the measurement interval
794 * @note The property is treated as immutable: it is only valid to call
795 * the setter once. However, we don't assert if the caller tries to
796 * overwrite, just ignoring the update instead.
798 * @param disk_use Pointer to the Disk Use.
800 *****************************************************************************/
801 void evel_measurement_disk_use_iotimeavg_set(MEASUREMENT_DISK_USE * const disk_use,
805 evel_set_option_double(&disk_use->iotimeavg, val, "Disk ioload set");
809 /**************************************************************************//**
810 * Set milliseconds spent doing input/output operations over 1 sec; treat
811 * this metric as a device load percentage where 1000ms matches 100% load;
812 * provide the last value within the measurement interval
814 * @note The property is treated as immutable: it is only valid to call
815 * the setter once. However, we don't assert if the caller tries to
816 * overwrite, just ignoring the update instead.
818 * @param disk_use Pointer to the Disk Use.
820 *****************************************************************************/
821 void evel_measurement_disk_use_iotimelast_set(MEASUREMENT_DISK_USE * const disk_use,
825 evel_set_option_double(&disk_use->iotimelast, val, "Disk ioloadlast set");
829 /**************************************************************************//**
830 * Set milliseconds spent doing input/output operations over 1 sec; treat
831 * this metric as a device load percentage where 1000ms matches 100% load;
832 * provide the maximum value within the measurement interval
834 * @note The property is treated as immutable: it is only valid to call
835 * the setter once. However, we don't assert if the caller tries to
836 * overwrite, just ignoring the update instead.
838 * @param disk_use Pointer to the Disk Use.
840 *****************************************************************************/
841 void evel_measurement_disk_use_iotimemax_set(MEASUREMENT_DISK_USE * const disk_use,
845 evel_set_option_double(&disk_use->iotimemax, val, "Disk ioloadmax set");
849 /**************************************************************************//**
850 * Set milliseconds spent doing input/output operations over 1 sec; treat
851 * this metric as a device load percentage where 1000ms matches 100% load;
852 * provide the minimum value within the measurement interval
854 * @note The property is treated as immutable: it is only valid to call
855 * the setter once. However, we don't assert if the caller tries to
856 * overwrite, just ignoring the update instead.
858 * @param disk_use Pointer to the Disk Use.
860 *****************************************************************************/
861 void evel_measurement_disk_use_iotimemin_set(MEASUREMENT_DISK_USE * const disk_use,
865 evel_set_option_double(&disk_use->iotimemin, val, "Disk ioloadmin set");
869 /**************************************************************************//**
870 * Set number of logical read operations that were merged into physical read
871 * operations, e.g., two logical reads were served by one physical disk access;
872 * provide the average measurement within the measurement interval
874 * @note The property is treated as immutable: it is only valid to call
875 * the setter once. However, we don't assert if the caller tries to
876 * overwrite, just ignoring the update instead.
878 * @param disk_use Pointer to the Disk Use.
880 *****************************************************************************/
881 void evel_measurement_disk_use_mergereadavg_set(MEASUREMENT_DISK_USE * const disk_use,
885 evel_set_option_double(&disk_use->mergereadavg, val, "Disk Merged read average set");
888 /**************************************************************************//**
889 * Set number of logical read operations that were merged into physical read
890 * operations, e.g., two logical reads were served by one physical disk access;
891 * provide the last measurement within the measurement interval
893 * @note The property is treated as immutable: it is only valid to call
894 * the setter once. However, we don't assert if the caller tries to
895 * overwrite, just ignoring the update instead.
897 * @param disk_use Pointer to the Disk Use.
899 *****************************************************************************/
900 void evel_measurement_disk_use_mergereadlast_set(MEASUREMENT_DISK_USE * const disk_use,
904 evel_set_option_double(&disk_use->mergereadlast, val, "Disk mergedload last set");
907 /**************************************************************************//**
908 * Set number of logical read operations that were merged into physical read
909 * operations, e.g., two logical reads were served by one physical disk access;
910 * provide the maximum measurement within the measurement interval
912 * @note The property is treated as immutable: it is only valid to call
913 * the setter once. However, we don't assert if the caller tries to
914 * overwrite, just ignoring the update instead.
916 * @param disk_use Pointer to the Disk Use.
918 *****************************************************************************/
919 void evel_measurement_disk_use_mergereadmax_set(MEASUREMENT_DISK_USE * const disk_use,
923 evel_set_option_double(&disk_use->mergereadmax, val, "Disk merged loadmax set");
927 /**************************************************************************//**
928 * Set number of logical read operations that were merged into physical read
929 * operations, e.g., two logical reads were served by one physical disk access;
930 * provide the minimum measurement within the measurement interval
932 * @note The property is treated as immutable: it is only valid to call
933 * the setter once. However, we don't assert if the caller tries to
934 * overwrite, just ignoring the update instead.
936 * @param disk_use Pointer to the Disk Use.
938 *****************************************************************************/
939 void evel_measurement_disk_use_mergereadmin_set(MEASUREMENT_DISK_USE * const disk_use,
943 evel_set_option_double(&disk_use->mergereadmin, val, "Disk merged loadmin set");
946 /**************************************************************************//**
947 * Set number of logical write operations that were merged into physical read
948 * operations, e.g., two logical writes were served by one physical disk access;
949 * provide the last measurement within the measurement interval
951 * @note The property is treated as immutable: it is only valid to call
952 * the setter once. However, we don't assert if the caller tries to
953 * overwrite, just ignoring the update instead.
955 * @param disk_use Pointer to the Disk Use.
957 *****************************************************************************/
958 void evel_measurement_disk_use_mergewritelast_set(MEASUREMENT_DISK_USE * const disk_use,
962 evel_set_option_double(&disk_use->mergewritelast, val, "Disk merged writelast set");
965 /**************************************************************************//**
966 * Set number of logical write operations that were merged into physical read
967 * operations, e.g., two logical writes were served by one physical disk access;
968 * provide the maximum measurement within the measurement interval
970 * @note The property is treated as immutable: it is only valid to call
971 * the setter once. However, we don't assert if the caller tries to
972 * overwrite, just ignoring the update instead.
974 * @param disk_use Pointer to the Disk Use.
976 *****************************************************************************/
977 void evel_measurement_disk_use_mergewritemax_set(MEASUREMENT_DISK_USE * const disk_use,
981 evel_set_option_double(&disk_use->mergewritemax, val, "Disk writemax set");
984 /**************************************************************************//**
985 * Set number of logical write operations that were merged into physical read
986 * operations, e.g., two logical writes were served by one physical disk access;
987 * provide the maximum measurement within the measurement interval
989 * @note The property is treated as immutable: it is only valid to call
990 * the setter once. However, we don't assert if the caller tries to
991 * overwrite, just ignoring the update instead.
993 * @param disk_use Pointer to the Disk Use.
995 *****************************************************************************/
996 void evel_measurement_disk_use_mergewritemin_set(MEASUREMENT_DISK_USE * const disk_use,
1000 evel_set_option_double(&disk_use->mergewritemin, val, "Disk writemin set");
1004 /**************************************************************************//**
1005 * Set number of octets per second read from a disk or partition;
1006 * provide the average measurement within the measurement interval
1008 * @note The property is treated as immutable: it is only valid to call
1009 * the setter once. However, we don't assert if the caller tries to
1010 * overwrite, just ignoring the update instead.
1012 * @param disk_use Pointer to the Disk Use.
1014 *****************************************************************************/
1015 void evel_measurement_disk_use_octetsreadavg_set(MEASUREMENT_DISK_USE * const disk_use,
1019 evel_set_option_double(&disk_use->octetsreadavg, val, "Octets readavg set");
1023 /**************************************************************************//**
1024 * Set number of octets per second read from a disk or partition;
1025 * provide the last measurement within the measurement interval
1027 * @note The property is treated as immutable: it is only valid to call
1028 * the setter once. However, we don't assert if the caller tries to
1029 * overwrite, just ignoring the update instead.
1031 * @param disk_use Pointer to the Disk Use.
1033 *****************************************************************************/
1034 void evel_measurement_disk_use_octetsreadlast_set(MEASUREMENT_DISK_USE * const disk_use,
1038 evel_set_option_double(&disk_use->octetsreadlast, val, "Octets readlast set");
1042 /**************************************************************************//**
1043 * Set number of octets per second read from a disk or partition;
1044 * provide the maximum measurement within the measurement interval
1046 * @note The property is treated as immutable: it is only valid to call
1047 * the setter once. However, we don't assert if the caller tries to
1048 * overwrite, just ignoring the update instead.
1050 * @param disk_use Pointer to the Disk Use.
1052 *****************************************************************************/
1053 void evel_measurement_disk_use_octetsreadmax_set(MEASUREMENT_DISK_USE * const disk_use,
1057 evel_set_option_double(&disk_use->octetsreadmax, val, "Octets readmax set");
1060 /**************************************************************************//**
1061 * Set number of octets per second read from a disk or partition;
1062 * provide the minimum measurement within the measurement interval
1064 * @note The property is treated as immutable: it is only valid to call
1065 * the setter once. However, we don't assert if the caller tries to
1066 * overwrite, just ignoring the update instead.
1068 * @param disk_use Pointer to the Disk Use.
1070 *****************************************************************************/
1071 void evel_measurement_disk_use_octetsreadmin_set(MEASUREMENT_DISK_USE * const disk_use,
1075 evel_set_option_double(&disk_use->octetsreadmin, val, "Octets readmin set");
1078 /**************************************************************************//**
1079 * Set number of octets per second written to a disk or partition;
1080 * provide the average measurement within the measurement interval
1082 * @note The property is treated as immutable: it is only valid to call
1083 * the setter once. However, we don't assert if the caller tries to
1084 * overwrite, just ignoring the update instead.
1086 * @param disk_use Pointer to the Disk Use.
1088 *****************************************************************************/
1089 void evel_measurement_disk_use_octetswriteavg_set(MEASUREMENT_DISK_USE * const disk_use,
1093 evel_set_option_double(&disk_use->octetswriteavg, val, "Octets writeavg set");
1096 /**************************************************************************//**
1097 * Set number of octets per second written to a disk or partition;
1098 * provide the last measurement within the measurement interval
1100 * @note The property is treated as immutable: it is only valid to call
1101 * the setter once. However, we don't assert if the caller tries to
1102 * overwrite, just ignoring the update instead.
1104 * @param disk_use Pointer to the Disk Use.
1106 *****************************************************************************/
1107 void evel_measurement_disk_use_octetswritelast_set(MEASUREMENT_DISK_USE * const disk_use,
1111 evel_set_option_double(&disk_use->octetswritelast, val, "Octets writelast set");
1114 /**************************************************************************//**
1115 * Set number of octets per second written to a disk or partition;
1116 * provide the maximum measurement within the measurement interval
1118 * @note The property is treated as immutable: it is only valid to call
1119 * the setter once. However, we don't assert if the caller tries to
1120 * overwrite, just ignoring the update instead.
1122 * @param disk_use Pointer to the Disk Use.
1124 *****************************************************************************/
1125 void evel_measurement_disk_use_octetswritemax_set(MEASUREMENT_DISK_USE * const disk_use,
1129 evel_set_option_double(&disk_use->octetswritemax, val, "Octets writemax set");
1132 /**************************************************************************//**
1133 * Set number of octets per second written to a disk or partition;
1134 * provide the minimum measurement within the measurement interval
1136 * @note The property is treated as immutable: it is only valid to call
1137 * the setter once. However, we don't assert if the caller tries to
1138 * overwrite, just ignoring the update instead.
1140 * @param disk_use Pointer to the Disk Use.
1142 *****************************************************************************/
1143 void evel_measurement_disk_use_octetswritemin_set(MEASUREMENT_DISK_USE * const disk_use,
1147 evel_set_option_double(&disk_use->octetswritemin, val, "Octets writemin set");
1151 /**************************************************************************//**
1152 * Set number of read operations per second issued to the disk;
1153 * provide the average measurement within the measurement interval
1155 * @note The property is treated as immutable: it is only valid to call
1156 * the setter once. However, we don't assert if the caller tries to
1157 * overwrite, just ignoring the update instead.
1159 * @param disk_use Pointer to the Disk Use.
1161 *****************************************************************************/
1162 void evel_measurement_disk_use_opsreadavg_set(MEASUREMENT_DISK_USE * const disk_use,
1166 evel_set_option_double(&disk_use->opsreadavg, val, "Disk read operation average set");
1169 /**************************************************************************//**
1170 * Set number of read operations per second issued to the disk;
1171 * provide the last measurement within the measurement interval
1173 * @note The property is treated as immutable: it is only valid to call
1174 * the setter once. However, we don't assert if the caller tries to
1175 * overwrite, just ignoring the update instead.
1177 * @param disk_use Pointer to the Disk Use.
1179 *****************************************************************************/
1180 void evel_measurement_disk_use_opsreadlast_set(MEASUREMENT_DISK_USE * const disk_use,
1184 evel_set_option_double(&disk_use->opsreadlast, val, "Disk read operation last set");
1187 /**************************************************************************//**
1188 * Set number of read operations per second issued to the disk;
1189 * provide the maximum measurement within the measurement interval
1191 * @note The property is treated as immutable: it is only valid to call
1192 * the setter once. However, we don't assert if the caller tries to
1193 * overwrite, just ignoring the update instead.
1195 * @param disk_use Pointer to the Disk Use.
1197 *****************************************************************************/
1198 void evel_measurement_disk_use_opsreadmax_set(MEASUREMENT_DISK_USE * const disk_use,
1202 evel_set_option_double(&disk_use->opsreadmax, val, "Disk read operation maximum set");
1205 /**************************************************************************//**
1206 * Set number of read operations per second issued to the disk;
1207 * provide the minimum measurement within the measurement interval
1209 * @note The property is treated as immutable: it is only valid to call
1210 * the setter once. However, we don't assert if the caller tries to
1211 * overwrite, just ignoring the update instead.
1213 * @param disk_use Pointer to the Disk Use.
1215 *****************************************************************************/
1216 void evel_measurement_disk_use_opsreadmin_set(MEASUREMENT_DISK_USE * const disk_use,
1220 evel_set_option_double(&disk_use->opsreadmin, val, "Disk read operation minimum set");
1223 /**************************************************************************//**
1224 * Set number of write operations per second issued to the disk;
1225 * provide the average measurement within the measurement interval
1227 * @note The property is treated as immutable: it is only valid to call
1228 * the setter once. However, we don't assert if the caller tries to
1229 * overwrite, just ignoring the update instead.
1231 * @param disk_use Pointer to the Disk Use.
1233 *****************************************************************************/
1234 void evel_measurement_disk_use_opswriteavg_set(MEASUREMENT_DISK_USE * const disk_use,
1238 evel_set_option_double(&disk_use->opswriteavg, val, "Disk write operation average set");
1241 /**************************************************************************//**
1242 * Set number of write operations per second issued to the disk;
1243 * provide the last measurement within the measurement interval
1245 * @note The property is treated as immutable: it is only valid to call
1246 * the setter once. However, we don't assert if the caller tries to
1247 * overwrite, just ignoring the update instead.
1249 * @param disk_use Pointer to the Disk Use.
1251 *****************************************************************************/
1252 void evel_measurement_disk_use_opswritelast_set(MEASUREMENT_DISK_USE * const disk_use,
1256 evel_set_option_double(&disk_use->opswritelast, val, "Disk write operation last set");
1260 /**************************************************************************//**
1261 * Set number of write operations per second issued to the disk;
1262 * provide the maximum measurement within the measurement interval
1264 * @note The property is treated as immutable: it is only valid to call
1265 * the setter once. However, we don't assert if the caller tries to
1266 * overwrite, just ignoring the update instead.
1268 * @param disk_use Pointer to the Disk Use.
1270 *****************************************************************************/
1271 void evel_measurement_disk_use_opswritemax_set(MEASUREMENT_DISK_USE * const disk_use,
1275 evel_set_option_double(&disk_use->opswritemax, val, "Disk write operation maximum set");
1278 /**************************************************************************//**
1279 * Set number of write operations per second issued to the disk;
1280 * provide the average measurement within the measurement interval
1282 * @note The property is treated as immutable: it is only valid to call
1283 * the setter once. However, we don't assert if the caller tries to
1284 * overwrite, just ignoring the update instead.
1286 * @param disk_use Pointer to the Disk Use.
1288 *****************************************************************************/
1289 void evel_measurement_disk_use_opswritemin_set(MEASUREMENT_DISK_USE * const disk_use,
1293 evel_set_option_double(&disk_use->opswritemin, val, "Disk write operation minimum set");
1297 /**************************************************************************//**
1298 * Set queue size of pending I/O operations per second;
1299 * provide the average measurement within the measurement interval
1301 * @note The property is treated as immutable: it is only valid to call
1302 * the setter once. However, we don't assert if the caller tries to
1303 * overwrite, just ignoring the update instead.
1305 * @param disk_use Pointer to the Disk Use.
1307 *****************************************************************************/
1308 void evel_measurement_disk_use_pendingopsavg_set(MEASUREMENT_DISK_USE * const disk_use,
1312 evel_set_option_double(&disk_use->pendingopsavg, val, "Disk pending operation average set");
1315 /**************************************************************************//**
1316 * Set queue size of pending I/O operations per second;
1317 * provide the last measurement within the measurement interval
1319 * @note The property is treated as immutable: it is only valid to call
1320 * the setter once. However, we don't assert if the caller tries to
1321 * overwrite, just ignoring the update instead.
1323 * @param disk_use Pointer to the Disk Use.
1325 *****************************************************************************/
1326 void evel_measurement_disk_use_pendingopslast_set(MEASUREMENT_DISK_USE * const disk_use,
1330 evel_set_option_double(&disk_use->pendingopslast, val, "Disk pending operation last set");
1333 /**************************************************************************//**
1334 * Set queue size of pending I/O operations per second;
1335 * provide the maximum measurement within the measurement interval
1337 * @note The property is treated as immutable: it is only valid to call
1338 * the setter once. However, we don't assert if the caller tries to
1339 * overwrite, just ignoring the update instead.
1341 * @param disk_use Pointer to the Disk Use.
1343 *****************************************************************************/
1344 void evel_measurement_disk_use_pendingopsmax_set(MEASUREMENT_DISK_USE * const disk_use,
1348 evel_set_option_double(&disk_use->pendingopsmax, val, "Disk pending operation maximum set");
1351 /**************************************************************************//**
1352 * Set queue size of pending I/O operations per second;
1353 * provide the minimum measurement within the measurement interval
1355 * @note The property is treated as immutable: it is only valid to call
1356 * the setter once. However, we don't assert if the caller tries to
1357 * overwrite, just ignoring the update instead.
1359 * @param disk_use Pointer to the Disk Use.
1361 *****************************************************************************/
1362 void evel_measurement_disk_use_pendingopsmin_set(MEASUREMENT_DISK_USE * const disk_use,
1366 evel_set_option_double(&disk_use->pendingopsmin, val, "Disk pending operation min set");
1370 /**************************************************************************//**
1371 * Set milliseconds a read operation took to complete;
1372 * provide the average measurement within the measurement interval
1374 * @note The property is treated as immutable: it is only valid to call
1375 * the setter once. However, we don't assert if the caller tries to
1376 * overwrite, just ignoring the update instead.
1378 * @param disk_use Pointer to the Disk Use.
1380 *****************************************************************************/
1381 void evel_measurement_disk_use_timereadavg_set(MEASUREMENT_DISK_USE * const disk_use,
1385 evel_set_option_double(&disk_use->timereadavg, val, "Disk read time average set");
1388 /**************************************************************************//**
1389 * Set milliseconds a read operation took to complete;
1390 * provide the last measurement within the measurement interval
1392 * @note The property is treated as immutable: it is only valid to call
1393 * the setter once. However, we don't assert if the caller tries to
1394 * overwrite, just ignoring the update instead.
1396 * @param disk_use Pointer to the Disk Use.
1398 *****************************************************************************/
1399 void evel_measurement_disk_use_timereadlast_set(MEASUREMENT_DISK_USE * const disk_use,
1403 evel_set_option_double(&disk_use->timereadlast, val, "Disk read time last set");
1406 /**************************************************************************//**
1407 * Set milliseconds a read operation took to complete;
1408 * provide the maximum measurement within the measurement interval
1410 * @note The property is treated as immutable: it is only valid to call
1411 * the setter once. However, we don't assert if the caller tries to
1412 * overwrite, just ignoring the update instead.
1414 * @param disk_use Pointer to the Disk Use.
1416 *****************************************************************************/
1417 void evel_measurement_disk_use_timereadmax_set(MEASUREMENT_DISK_USE * const disk_use,
1421 evel_set_option_double(&disk_use->timereadmax, val, "Disk read time maximum set");
1424 /**************************************************************************//**
1425 * Set milliseconds a read operation took to complete;
1426 * provide the minimum measurement within the measurement interval
1428 * @note The property is treated as immutable: it is only valid to call
1429 * the setter once. However, we don't assert if the caller tries to
1430 * overwrite, just ignoring the update instead.
1432 * @param disk_use Pointer to the Disk Use.
1434 *****************************************************************************/
1435 void evel_measurement_disk_use_timereadmin_set(MEASUREMENT_DISK_USE * const disk_use,
1439 evel_set_option_double(&disk_use->timereadmin, val, "Disk read time minimum set");
1442 /**************************************************************************//**
1443 * Set milliseconds a write operation took to complete;
1444 * provide the average measurement within the measurement interval
1446 * @note The property is treated as immutable: it is only valid to call
1447 * the setter once. However, we don't assert if the caller tries to
1448 * overwrite, just ignoring the update instead.
1450 * @param disk_use Pointer to the Disk Use.
1452 *****************************************************************************/
1453 void evel_measurement_disk_use_timewriteavg_set(MEASUREMENT_DISK_USE * const disk_use,
1457 evel_set_option_double(&disk_use->timewriteavg, val, "Disk write time average set");
1461 /**************************************************************************//**
1462 * Set milliseconds a write operation took to complete;
1463 * provide the last measurement within the measurement interval
1465 * @note The property is treated as immutable: it is only valid to call
1466 * the setter once. However, we don't assert if the caller tries to
1467 * overwrite, just ignoring the update instead.
1469 * @param disk_use Pointer to the Disk Use.
1471 *****************************************************************************/
1472 void evel_measurement_disk_use_timewritelast_set(MEASUREMENT_DISK_USE * const disk_use,
1476 evel_set_option_double(&disk_use->timewritelast, val, "Disk write time last set");
1479 /**************************************************************************//**
1480 * Set milliseconds a write operation took to complete;
1481 * provide the maximum measurement within the measurement interval
1483 * @note The property is treated as immutable: it is only valid to call
1484 * the setter once. However, we don't assert if the caller tries to
1485 * overwrite, just ignoring the update instead.
1487 * @param disk_use Pointer to the Disk Use.
1489 *****************************************************************************/
1490 void evel_measurement_disk_use_timewritemax_set(MEASUREMENT_DISK_USE * const disk_use,
1494 evel_set_option_double(&disk_use->timewritemax, val, "Disk write time max set");
1497 /**************************************************************************//**
1498 * Set milliseconds a write operation took to complete;
1499 * provide the average measurement within the measurement interval
1501 * @note The property is treated as immutable: it is only valid to call
1502 * the setter once. However, we don't assert if the caller tries to
1503 * overwrite, just ignoring the update instead.
1505 * @param disk_use Pointer to the Disk Use.
1507 *****************************************************************************/
1508 void evel_measurement_disk_use_timewritemin_set(MEASUREMENT_DISK_USE * const disk_use,
1512 evel_set_option_double(&disk_use->timewritemin, val, "Disk write time min set");
1516 /**************************************************************************//**
1517 * Add an additional File System usage value name/value pair to the
1520 * The filesystem_name is null delimited ASCII string. The library takes a
1521 * copy so the caller does not have to preserve values after the function
1524 * @param measurement Pointer to the measurement.
1525 * @param filesystem_name ASCIIZ string with the file-system's UUID.
1526 * @param block_configured Block storage configured.
1527 * @param block_used Block storage in use.
1528 * @param block_iops Block storage IOPS.
1529 * @param ephemeral_configured Ephemeral storage configured.
1530 * @param ephemeral_used Ephemeral storage in use.
1531 * @param ephemeral_iops Ephemeral storage IOPS.
1532 *****************************************************************************/
1533 void evel_measurement_fsys_use_add(EVENT_MEASUREMENT * measurement,
1534 char * filesystem_name,
1535 double block_configured,
1538 double ephemeral_configured,
1539 double ephemeral_used,
1540 double ephemeral_iops)
1542 MEASUREMENT_FSYS_USE * fsys_use = NULL;
1545 /***************************************************************************/
1546 /* Check assumptions. */
1547 /***************************************************************************/
1548 assert(measurement != NULL);
1549 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1550 assert(filesystem_name != NULL);
1551 assert(block_configured >= 0.0);
1552 assert(block_used >= 0.0);
1553 assert(block_iops >= 0.0);
1554 assert(ephemeral_configured >= 0.0);
1555 assert(ephemeral_used >= 0.0);
1556 assert(ephemeral_iops >= 0.0);
1558 /***************************************************************************/
1559 /* Allocate a container for the value and push onto the list. */
1560 /***************************************************************************/
1561 EVEL_DEBUG("Adding filesystem_name=%s", filesystem_name);
1562 fsys_use = malloc(sizeof(MEASUREMENT_FSYS_USE));
1563 assert(fsys_use != NULL);
1564 memset(fsys_use, 0, sizeof(MEASUREMENT_FSYS_USE));
1565 fsys_use->filesystem_name = strdup(filesystem_name);
1566 fsys_use->block_configured = block_configured;
1567 fsys_use->block_used = block_used;
1568 fsys_use->block_iops = block_iops;
1569 fsys_use->ephemeral_configured = ephemeral_configured;
1570 fsys_use->ephemeral_used = ephemeral_used;
1571 fsys_use->ephemeral_iops = ephemeral_iops;
1573 dlist_push_last(&measurement->filesystem_usage, fsys_use);
1578 /**************************************************************************//**
1579 * Add a Feature usage value name/value pair to the Measurement.
1581 * The name is null delimited ASCII string. The library takes
1582 * a copy so the caller does not have to preserve values after the function
1585 * @param measurement Pointer to the measurement.
1586 * @param feature ASCIIZ string with the feature's name.
1587 * @param utilization Utilization of the feature.
1588 *****************************************************************************/
1589 void evel_measurement_feature_use_add(EVENT_MEASUREMENT * measurement,
1593 MEASUREMENT_FEATURE_USE * feature_use = NULL;
1596 /***************************************************************************/
1597 /* Check assumptions. */
1598 /***************************************************************************/
1599 assert(measurement != NULL);
1600 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1601 assert(feature != NULL);
1602 assert(utilization >= 0);
1604 /***************************************************************************/
1605 /* Allocate a container for the value and push onto the list. */
1606 /***************************************************************************/
1607 EVEL_DEBUG("Adding Feature=%s Use=%d", feature, utilization);
1608 feature_use = malloc(sizeof(MEASUREMENT_FEATURE_USE));
1609 assert(feature_use != NULL);
1610 memset(feature_use, 0, sizeof(MEASUREMENT_FEATURE_USE));
1611 feature_use->feature_id = strdup(feature);
1612 assert(feature_use->feature_id != NULL);
1613 feature_use->feature_utilization = utilization;
1615 dlist_push_last(&measurement->feature_usage, feature_use);
1620 /**************************************************************************//**
1621 * Add a Additional Measurement value name/value pair to the Report.
1623 * The name is null delimited ASCII string. The library takes
1624 * a copy so the caller does not have to preserve values after the function
1627 * @param measurement Pointer to the Measaurement.
1628 * @param group ASCIIZ string with the measurement group's name.
1629 * @param name ASCIIZ string containing the measurement's name.
1630 * @param value ASCIIZ string containing the measurement's value.
1631 *****************************************************************************/
1632 void evel_measurement_custom_measurement_add(EVENT_MEASUREMENT * measurement,
1633 const char * const group,
1634 const char * const name,
1635 const char * const value)
1637 MEASUREMENT_GROUP * measurement_group = NULL;
1638 CUSTOM_MEASUREMENT * custom_measurement = NULL;
1639 DLIST_ITEM * item = NULL;
1642 /***************************************************************************/
1643 /* Check assumptions. */
1644 /***************************************************************************/
1645 assert(measurement != NULL);
1646 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1647 assert(group != NULL);
1648 assert(name != NULL);
1649 assert(value != NULL);
1651 /***************************************************************************/
1652 /* Allocate a container for the name/value pair. */
1653 /***************************************************************************/
1654 EVEL_DEBUG("Adding Measurement Group=%s Name=%s Value=%s",
1655 group, name, value);
1656 custom_measurement = malloc(sizeof(CUSTOM_MEASUREMENT));
1657 assert(custom_measurement != NULL);
1658 memset(custom_measurement, 0, sizeof(CUSTOM_MEASUREMENT));
1659 custom_measurement->name = strdup(name);
1660 assert(custom_measurement->name != NULL);
1661 custom_measurement->value = strdup(value);
1662 assert(custom_measurement->value != NULL);
1664 /***************************************************************************/
1665 /* See if we have that group already. */
1666 /***************************************************************************/
1667 item = dlist_get_first(&measurement->additional_measurements);
1668 while (item != NULL)
1670 measurement_group = (MEASUREMENT_GROUP *) item->item;
1671 assert(measurement_group != NULL);
1673 EVEL_DEBUG("Got measurement group %s", measurement_group->name);
1674 if (strcmp(group, measurement_group->name) == 0)
1676 EVEL_DEBUG("Found existing Measurement Group");
1679 item = dlist_get_next(item);
1682 /***************************************************************************/
1683 /* If we didn't have the group already, create it. */
1684 /***************************************************************************/
1687 EVEL_DEBUG("Creating new Measurement Group");
1688 measurement_group = malloc(sizeof(MEASUREMENT_GROUP));
1689 assert(measurement_group != NULL);
1690 memset(measurement_group, 0, sizeof(MEASUREMENT_GROUP));
1691 measurement_group->name = strdup(group);
1692 assert(measurement_group->name != NULL);
1693 dlist_initialize(&measurement_group->measurements);
1694 dlist_push_last(&measurement->additional_measurements, measurement_group);
1697 /***************************************************************************/
1698 /* If we didn't have the group already, create it. */
1699 /***************************************************************************/
1700 dlist_push_last(&measurement_group->measurements, custom_measurement);
1705 /**************************************************************************//**
1706 * Add a Codec usage value name/value pair to the Measurement.
1708 * The name is null delimited ASCII string. The library takes
1709 * a copy so the caller does not have to preserve values after the function
1712 * @param measurement Pointer to the measurement.
1713 * @param codec ASCIIZ string with the codec's name.
1714 * @param utilization Number of codecs in use.
1715 *****************************************************************************/
1716 void evel_measurement_codec_use_add(EVENT_MEASUREMENT * measurement,
1720 MEASUREMENT_CODEC_USE * codec_use = NULL;
1723 /***************************************************************************/
1724 /* Check assumptions. */
1725 /***************************************************************************/
1726 assert(measurement != NULL);
1727 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1728 assert(codec != NULL);
1729 assert(utilization >= 0.0);
1731 /***************************************************************************/
1732 /* Allocate a container for the value and push onto the list. */
1733 /***************************************************************************/
1734 EVEL_DEBUG("Adding Codec=%s Use=%d", codec, utilization);
1735 codec_use = malloc(sizeof(MEASUREMENT_CODEC_USE));
1736 assert(codec_use != NULL);
1737 memset(codec_use, 0, sizeof(MEASUREMENT_CODEC_USE));
1738 codec_use->codec_id = strdup(codec);
1739 assert(codec_use->codec_id != NULL);
1740 codec_use->number_in_use = utilization;
1742 dlist_push_last(&measurement->codec_usage, codec_use);
1748 /**************************************************************************//**
1749 * Set the Media Ports in Use property of the Measurement.
1751 * @note The property is treated as immutable: it is only valid to call
1752 * the setter once. However, we don't assert if the caller tries to
1753 * overwrite, just ignoring the update instead.
1755 * @param measurement Pointer to the measurement.
1756 * @param media_ports_in_use The media port usage to set.
1757 *****************************************************************************/
1758 void evel_measurement_media_port_use_set(EVENT_MEASUREMENT * measurement,
1759 int media_ports_in_use)
1763 /***************************************************************************/
1764 /* Check preconditions. */
1765 /***************************************************************************/
1766 assert(measurement != NULL);
1767 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1768 assert(media_ports_in_use >= 0);
1770 evel_set_option_int(&measurement->media_ports_in_use,
1772 "Media Ports In Use");
1776 /**************************************************************************//**
1777 * Set the VNFC Scaling Metric property of the Measurement.
1779 * @note The property is treated as immutable: it is only valid to call
1780 * the setter once. However, we don't assert if the caller tries to
1781 * overwrite, just ignoring the update instead.
1783 * @param measurement Pointer to the measurement.
1784 * @param scaling_metric The scaling metric to set.
1785 *****************************************************************************/
1786 void evel_measurement_vnfc_scaling_metric_set(EVENT_MEASUREMENT * measurement,
1791 /***************************************************************************/
1792 /* Check preconditions. */
1793 /***************************************************************************/
1794 assert(measurement != NULL);
1795 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1796 assert(scaling_metric >= 0.0);
1798 evel_set_option_int(&measurement->vnfc_scaling_metric,
1800 "VNFC Scaling Metric");
1804 /**************************************************************************//**
1805 * Create a new Latency Bucket to be added to a Measurement event.
1807 * @note The mandatory fields on the ::MEASUREMENT_LATENCY_BUCKET must be
1808 * supplied to this factory function and are immutable once set.
1809 * Optional fields have explicit setter functions, but again values
1810 * may only be set once so that the ::MEASUREMENT_LATENCY_BUCKET has
1811 * immutable properties.
1813 * @param count Count of events in this bucket.
1815 * @returns pointer to the newly manufactured ::MEASUREMENT_LATENCY_BUCKET.
1816 * If the structure is not used it must be released using free.
1817 * @retval NULL Failed to create the Latency Bucket.
1818 *****************************************************************************/
1819 MEASUREMENT_LATENCY_BUCKET * evel_new_meas_latency_bucket(const int count)
1821 MEASUREMENT_LATENCY_BUCKET * bucket;
1825 /***************************************************************************/
1826 /* Check preconditions. */
1827 /***************************************************************************/
1830 /***************************************************************************/
1831 /* Allocate, then set Mandatory Parameters. */
1832 /***************************************************************************/
1833 EVEL_DEBUG("Creating bucket, count = %d", count);
1834 bucket = malloc(sizeof(MEASUREMENT_LATENCY_BUCKET));
1835 assert(bucket != NULL);
1837 /***************************************************************************/
1838 /* Set Mandatory Parameters. */
1839 /***************************************************************************/
1840 bucket->count = count;
1842 /***************************************************************************/
1843 /* Initialize Optional Parameters. */
1844 /***************************************************************************/
1845 evel_init_option_double(&bucket->high_end);
1846 evel_init_option_double(&bucket->low_end);
1853 /**************************************************************************//**
1854 * Set the High End property of the Measurement Latency Bucket.
1856 * @note The property is treated as immutable: it is only valid to call
1857 * the setter once. However, we don't assert if the caller tries to
1858 * overwrite, just ignoring the update instead.
1860 * @param bucket Pointer to the Measurement Latency Bucket.
1861 * @param high_end High end of the bucket's range.
1862 *****************************************************************************/
1863 void evel_meas_latency_bucket_high_end_set(
1864 MEASUREMENT_LATENCY_BUCKET * const bucket,
1865 const double high_end)
1869 /***************************************************************************/
1870 /* Check preconditions. */
1871 /***************************************************************************/
1872 assert(high_end >= 0.0);
1873 evel_set_option_double(&bucket->high_end, high_end, "High End");
1878 /**************************************************************************//**
1879 * Set the Low End property of the Measurement Latency Bucket.
1881 * @note The property is treated as immutable: it is only valid to call
1882 * the setter once. However, we don't assert if the caller tries to
1883 * overwrite, just ignoring the update instead.
1885 * @param bucket Pointer to the Measurement Latency Bucket.
1886 * @param low_end Low end of the bucket's range.
1887 *****************************************************************************/
1888 void evel_meas_latency_bucket_low_end_set(
1889 MEASUREMENT_LATENCY_BUCKET * const bucket,
1890 const double low_end)
1894 /***************************************************************************/
1895 /* Check preconditions. */
1896 /***************************************************************************/
1897 assert(low_end >= 0.0);
1898 evel_set_option_double(&bucket->low_end, low_end, "Low End");
1902 /**************************************************************************//**
1903 * Add an additional Measurement Latency Bucket to the specified event.
1905 * @param measurement Pointer to the Measurement event.
1906 * @param bucket Pointer to the Measurement Latency Bucket to add.
1907 *****************************************************************************/
1908 void evel_meas_latency_bucket_add(EVENT_MEASUREMENT * const measurement,
1909 MEASUREMENT_LATENCY_BUCKET * const bucket)
1913 /***************************************************************************/
1914 /* Check preconditions. */
1915 /***************************************************************************/
1916 assert(measurement != NULL);
1917 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1918 assert(bucket != NULL);
1919 dlist_push_last(&measurement->latency_distribution, bucket);
1924 /**************************************************************************//**
1925 * Add an additional Latency Distribution bucket to the Measurement.
1927 * This function implements the previous API, purely for convenience.
1929 * @param measurement Pointer to the measurement.
1930 * @param low_end Low end of the bucket's range.
1931 * @param high_end High end of the bucket's range.
1932 * @param count Count of events in this bucket.
1933 *****************************************************************************/
1934 void evel_measurement_latency_add(EVENT_MEASUREMENT * const measurement,
1935 const double low_end,
1936 const double high_end,
1939 MEASUREMENT_LATENCY_BUCKET * bucket = NULL;
1943 /***************************************************************************/
1944 /* Trust the assertions in the underlying methods. */
1945 /***************************************************************************/
1946 bucket = evel_new_meas_latency_bucket(count);
1947 evel_meas_latency_bucket_low_end_set(bucket, low_end);
1948 evel_meas_latency_bucket_high_end_set(bucket, high_end);
1949 evel_meas_latency_bucket_add(measurement, bucket);
1954 /**************************************************************************//**
1955 * Create a new vNIC Use to be added to a Measurement event.
1957 * @note The mandatory fields on the ::MEASUREMENT_VNIC_PERFORMANCE must be supplied
1958 * to this factory function and are immutable once set. Optional
1959 * fields have explicit setter functions, but again values may only be
1960 * set once so that the ::MEASUREMENT_VNIC_PERFORMANCE has immutable
1963 * @param vnic_id ASCIIZ string with the vNIC's ID.
1964 * @param val_suspect True or false confidence in data.
1966 * @returns pointer to the newly manufactured ::MEASUREMENT_VNIC_PERFORMANCE.
1967 * If the structure is not used it must be released using
1968 * ::evel_measurement_free_vnic_performance.
1969 * @retval NULL Failed to create the vNIC Use.
1970 *****************************************************************************/
1971 MEASUREMENT_VNIC_PERFORMANCE * evel_measurement_new_vnic_performance(char * const vnic_id,
1972 char * const val_suspect)
1974 MEASUREMENT_VNIC_PERFORMANCE * vnic_performance;
1978 /***************************************************************************/
1979 /* Check preconditions. */
1980 /***************************************************************************/
1981 assert(vnic_id != NULL);
1982 assert(!strcmp(val_suspect,"true") || !strcmp(val_suspect,"false"));
1984 /***************************************************************************/
1985 /* Allocate, then set Mandatory Parameters. */
1986 /***************************************************************************/
1987 EVEL_DEBUG("Adding VNIC ID=%s", vnic_id);
1988 vnic_performance = malloc(sizeof(MEASUREMENT_VNIC_PERFORMANCE));
1989 assert(vnic_performance != NULL);
1990 vnic_performance->vnic_id = strdup(vnic_id);
1991 vnic_performance->valuesaresuspect = strdup(val_suspect);
1993 /***************************************************************************/
1994 /* Initialize Optional Parameters. */
1995 /***************************************************************************/
1996 evel_init_option_double(&vnic_performance-> recvd_bcast_packets_acc);
1997 evel_init_option_double(&vnic_performance-> recvd_bcast_packets_delta);
1998 evel_init_option_double(&vnic_performance-> recvd_discarded_packets_acc);
1999 evel_init_option_double(&vnic_performance-> recvd_discarded_packets_delta);
2000 evel_init_option_double(&vnic_performance-> recvd_error_packets_acc);
2001 evel_init_option_double(&vnic_performance-> recvd_error_packets_delta);
2002 evel_init_option_double(&vnic_performance-> recvd_mcast_packets_acc);
2003 evel_init_option_double(&vnic_performance-> recvd_mcast_packets_delta);
2004 evel_init_option_double(&vnic_performance-> recvd_octets_acc);
2005 evel_init_option_double(&vnic_performance-> recvd_octets_delta);
2006 evel_init_option_double(&vnic_performance-> recvd_total_packets_acc);
2007 evel_init_option_double(&vnic_performance-> recvd_total_packets_delta);
2008 evel_init_option_double(&vnic_performance-> recvd_ucast_packets_acc);
2009 evel_init_option_double(&vnic_performance-> recvd_ucast_packets_delta);
2010 evel_init_option_double(&vnic_performance-> tx_bcast_packets_acc);
2011 evel_init_option_double(&vnic_performance-> tx_bcast_packets_delta);
2012 evel_init_option_double(&vnic_performance-> tx_discarded_packets_acc);
2013 evel_init_option_double(&vnic_performance-> tx_discarded_packets_delta);
2014 evel_init_option_double(&vnic_performance-> tx_error_packets_acc);
2015 evel_init_option_double(&vnic_performance-> tx_error_packets_delta);
2016 evel_init_option_double(&vnic_performance-> tx_mcast_packets_acc);
2017 evel_init_option_double(&vnic_performance-> tx_mcast_packets_delta);
2018 evel_init_option_double(&vnic_performance-> tx_octets_acc);
2019 evel_init_option_double(&vnic_performance-> tx_octets_delta);
2020 evel_init_option_double(&vnic_performance-> tx_total_packets_acc);
2021 evel_init_option_double(&vnic_performance-> tx_total_packets_delta);
2022 evel_init_option_double(&vnic_performance-> tx_ucast_packets_acc);
2023 evel_init_option_double(&vnic_performance-> tx_ucast_packets_delta);
2027 return vnic_performance;
2030 /**************************************************************************//**
2033 * Free off the ::MEASUREMENT_VNIC_PERFORMANCE supplied. Will free all the contained
2036 * @note It does not free the vNIC Use itself, since that may be part of a
2038 *****************************************************************************/
2039 void evel_measurement_free_vnic_performance(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance)
2043 /***************************************************************************/
2044 /* Check preconditions. */
2045 /***************************************************************************/
2046 assert(vnic_performance != NULL);
2047 assert(vnic_performance->vnic_id != NULL);
2048 assert(vnic_performance->valuesaresuspect != NULL);
2050 /***************************************************************************/
2051 /* Free the duplicated string. */
2052 /***************************************************************************/
2053 free(vnic_performance->vnic_id);
2054 free(vnic_performance->valuesaresuspect);
2055 vnic_performance->vnic_id = NULL;
2060 /**************************************************************************//**
2061 * Set the Accumulated Broadcast Packets Received in measurement interval
2062 * property of the vNIC performance.
2064 * @note The property is treated as immutable: it is only valid to call
2065 * the setter once. However, we don't assert if the caller tries to
2066 * overwrite, just ignoring the update instead.
2068 * @param vnic_performance Pointer to the vNIC Use.
2069 * @param recvd_bcast_packets_acc
2070 *****************************************************************************/
2071 void evel_vnic_performance_rx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2072 const double recvd_bcast_packets_acc)
2076 /***************************************************************************/
2077 /* Check preconditions. */
2078 /***************************************************************************/
2079 assert(recvd_bcast_packets_acc >= 0.0);
2081 evel_set_option_double(&vnic_performance->recvd_bcast_packets_acc,
2082 recvd_bcast_packets_acc,
2083 "Broadcast Packets accumulated");
2088 /**************************************************************************//**
2089 * Set the Delta Broadcast Packets Received in measurement interval
2090 * property of the vNIC performance.
2092 * @note The property is treated as immutable: it is only valid to call
2093 * the setter once. However, we don't assert if the caller tries to
2094 * overwrite, just ignoring the update instead.
2096 * @param vnic_performance Pointer to the vNIC Use.
2097 * @param recvd_bcast_packets_delta
2098 *****************************************************************************/
2099 void evel_vnic_performance_rx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2100 const double recvd_bcast_packets_delta)
2104 /***************************************************************************/
2105 /* Check preconditions. */
2106 /***************************************************************************/
2107 assert(recvd_bcast_packets_delta >= 0.0);
2109 evel_set_option_double(&vnic_performance->recvd_bcast_packets_delta,
2110 recvd_bcast_packets_delta,
2111 "Delta Broadcast Packets recieved");
2117 /**************************************************************************//**
2118 * Set the Discarded Packets Received in measurement interval
2119 * property of the vNIC performance.
2121 * @note The property is treated as immutable: it is only valid to call
2122 * the setter once. However, we don't assert if the caller tries to
2123 * overwrite, just ignoring the update instead.
2125 * @param vnic_performance Pointer to the vNIC Use.
2126 * @param recvd_discard_packets_acc
2127 *****************************************************************************/
2128 void evel_vnic_performance_rx_discard_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2129 const double recvd_discard_packets_acc)
2133 /***************************************************************************/
2134 /* Check preconditions. */
2135 /***************************************************************************/
2136 assert(recvd_discard_packets_acc >= 0.0);
2138 evel_set_option_double(&vnic_performance->recvd_discarded_packets_acc,
2139 recvd_discard_packets_acc,
2140 "Discarded Packets accumulated");
2145 /**************************************************************************//**
2146 * Set the Delta Discarded Packets Received in measurement interval
2147 * property of the vNIC performance.
2149 * @note The property is treated as immutable: it is only valid to call
2150 * the setter once. However, we don't assert if the caller tries to
2151 * overwrite, just ignoring the update instead.
2153 * @param vnic_performance Pointer to the vNIC Use.
2154 * @param recvd_discard_packets_delta
2155 *****************************************************************************/
2156 void evel_vnic_performance_rx_discard_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2157 const double recvd_discard_packets_delta)
2161 /***************************************************************************/
2162 /* Check preconditions. */
2163 /***************************************************************************/
2164 assert(recvd_discard_packets_delta >= 0.0);
2166 evel_set_option_double(&vnic_performance->recvd_discarded_packets_delta,
2167 recvd_discard_packets_delta,
2168 "Delta Discarded Packets recieved");
2174 /**************************************************************************//**
2175 * Set the Error Packets Received in measurement interval
2176 * property of the vNIC performance.
2178 * @note The property is treated as immutable: it is only valid to call
2179 * the setter once. However, we don't assert if the caller tries to
2180 * overwrite, just ignoring the update instead.
2182 * @param vnic_performance Pointer to the vNIC Use.
2183 * @param recvd_error_packets_acc
2184 *****************************************************************************/
2185 void evel_vnic_performance_rx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2186 const double recvd_error_packets_acc)
2190 /***************************************************************************/
2191 /* Check preconditions. */
2192 /***************************************************************************/
2193 assert(recvd_error_packets_acc >= 0.0);
2195 evel_set_option_double(&vnic_performance->recvd_error_packets_acc,
2196 recvd_error_packets_acc,
2197 "Error Packets received accumulated");
2202 /**************************************************************************//**
2203 * Set the Delta Error Packets Received in measurement interval
2204 * property of the vNIC performance.
2206 * @note The property is treated as immutable: it is only valid to call
2207 * the setter once. However, we don't assert if the caller tries to
2208 * overwrite, just ignoring the update instead.
2210 * @param vnic_performance Pointer to the vNIC Use.
2211 * @param recvd_error_packets_delta
2212 *****************************************************************************/
2213 void evel_vnic_performance_rx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2214 const double recvd_error_packets_delta)
2218 /***************************************************************************/
2219 /* Check preconditions. */
2220 /***************************************************************************/
2221 assert(recvd_error_packets_delta >= 0.0);
2223 evel_set_option_double(&vnic_performance->recvd_error_packets_delta,
2224 recvd_error_packets_delta,
2225 "Delta Error Packets recieved");
2230 /**************************************************************************//**
2231 * Set the Accumulated Multicast Packets Received in measurement interval
2232 * property of the vNIC performance.
2234 * @note The property is treated as immutable: it is only valid to call
2235 * the setter once. However, we don't assert if the caller tries to
2236 * overwrite, just ignoring the update instead.
2238 * @param vnic_performance Pointer to the vNIC Use.
2239 * @param recvd_mcast_packets_acc
2240 *****************************************************************************/
2241 void evel_vnic_performance_rx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2242 const double recvd_mcast_packets_acc)
2246 /***************************************************************************/
2247 /* Check preconditions. */
2248 /***************************************************************************/
2249 assert(recvd_mcast_packets_acc >= 0.0);
2251 evel_set_option_double(&vnic_performance->recvd_mcast_packets_acc,
2252 recvd_mcast_packets_acc,
2253 "Multicast Packets accumulated");
2258 /**************************************************************************//**
2259 * Set the Delta Multicast Packets Received in measurement interval
2260 * property of the vNIC performance.
2262 * @note The property is treated as immutable: it is only valid to call
2263 * the setter once. However, we don't assert if the caller tries to
2264 * overwrite, just ignoring the update instead.
2266 * @param vnic_performance Pointer to the vNIC Use.
2267 * @param recvd_mcast_packets_delta
2268 *****************************************************************************/
2269 void evel_vnic_performance_rx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2270 const double recvd_mcast_packets_delta)
2274 /***************************************************************************/
2275 /* Check preconditions. */
2276 /***************************************************************************/
2277 assert(recvd_mcast_packets_delta >= 0.0);
2279 evel_set_option_double(&vnic_performance->recvd_mcast_packets_delta,
2280 recvd_mcast_packets_delta,
2281 "Delta Multicast Packets recieved");
2286 /**************************************************************************//**
2287 * Set the Accumulated Octets Received in measurement interval
2288 * property of the vNIC performance.
2290 * @note The property is treated as immutable: it is only valid to call
2291 * the setter once. However, we don't assert if the caller tries to
2292 * overwrite, just ignoring the update instead.
2294 * @param vnic_performance Pointer to the vNIC Use.
2295 * @param recvd_octets_acc
2296 *****************************************************************************/
2297 void evel_vnic_performance_rx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2298 const double recvd_octets_acc)
2302 /***************************************************************************/
2303 /* Check preconditions. */
2304 /***************************************************************************/
2305 assert(recvd_octets_acc >= 0.0);
2307 evel_set_option_double(&vnic_performance->recvd_octets_acc,
2309 "Octets received accumulated");
2314 /**************************************************************************//**
2315 * Set the Delta Octets Received in measurement interval
2316 * property of the vNIC performance.
2318 * @note The property is treated as immutable: it is only valid to call
2319 * the setter once. However, we don't assert if the caller tries to
2320 * overwrite, just ignoring the update instead.
2322 * @param vnic_performance Pointer to the vNIC Use.
2323 * @param recvd_octets_delta
2324 *****************************************************************************/
2325 void evel_vnic_performance_rx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2326 const double recvd_octets_delta)
2330 /***************************************************************************/
2331 /* Check preconditions. */
2332 /***************************************************************************/
2333 assert(recvd_octets_delta >= 0.0);
2335 evel_set_option_double(&vnic_performance->recvd_octets_delta,
2337 "Delta Octets recieved");
2342 /**************************************************************************//**
2343 * Set the Accumulated Total Packets Received in measurement interval
2344 * property of the vNIC performance.
2346 * @note The property is treated as immutable: it is only valid to call
2347 * the setter once. However, we don't assert if the caller tries to
2348 * overwrite, just ignoring the update instead.
2350 * @param vnic_performance Pointer to the vNIC Use.
2351 * @param recvd_total_packets_acc
2352 *****************************************************************************/
2353 void evel_vnic_performance_rx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2354 const double recvd_total_packets_acc)
2358 /***************************************************************************/
2359 /* Check preconditions. */
2360 /***************************************************************************/
2361 assert(recvd_total_packets_acc >= 0.0);
2363 evel_set_option_double(&vnic_performance->recvd_total_packets_acc,
2364 recvd_total_packets_acc,
2365 "Total Packets accumulated");
2370 /**************************************************************************//**
2371 * Set the Delta Total Packets Received in measurement interval
2372 * property of the vNIC performance.
2374 * @note The property is treated as immutable: it is only valid to call
2375 * the setter once. However, we don't assert if the caller tries to
2376 * overwrite, just ignoring the update instead.
2378 * @param vnic_performance Pointer to the vNIC Use.
2379 * @param recvd_total_packets_delta
2380 *****************************************************************************/
2381 void evel_vnic_performance_rx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2382 const double recvd_total_packets_delta)
2386 /***************************************************************************/
2387 /* Check preconditions. */
2388 /***************************************************************************/
2389 assert(recvd_total_packets_delta >= 0.0);
2391 evel_set_option_double(&vnic_performance->recvd_total_packets_delta,
2392 recvd_total_packets_delta,
2393 "Delta Total Packets recieved");
2398 /**************************************************************************//**
2399 * Set the Accumulated Unicast Packets Received in measurement interval
2400 * property of the vNIC performance.
2402 * @note The property is treated as immutable: it is only valid to call
2403 * the setter once. However, we don't assert if the caller tries to
2404 * overwrite, just ignoring the update instead.
2406 * @param vnic_performance Pointer to the vNIC Use.
2407 * @param recvd_ucast_packets_acc
2408 *****************************************************************************/
2409 void evel_vnic_performance_rx_ucast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2410 const double recvd_ucast_packets_acc)
2414 /***************************************************************************/
2415 /* Check preconditions. */
2416 /***************************************************************************/
2417 assert(recvd_ucast_packets_acc >= 0.0);
2419 evel_set_option_double(&vnic_performance->recvd_ucast_packets_acc,
2420 recvd_ucast_packets_acc,
2421 "Unicast Packets received accumulated");
2426 /**************************************************************************//**
2427 * Set the Delta Unicast packets Received in measurement interval
2428 * property of the vNIC performance.
2430 * @note The property is treated as immutable: it is only valid to call
2431 * the setter once. However, we don't assert if the caller tries to
2432 * overwrite, just ignoring the update instead.
2434 * @param vnic_performance Pointer to the vNIC Use.
2435 * @param recvd_ucast_packets_delta
2436 *****************************************************************************/
2437 void evel_vnic_performance_rx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2438 const double recvd_ucast_packets_delta)
2442 /***************************************************************************/
2443 /* Check preconditions. */
2444 /***************************************************************************/
2445 assert(recvd_ucast_packets_delta >= 0.0);
2447 evel_set_option_double(&vnic_performance->recvd_ucast_packets_delta,
2448 recvd_ucast_packets_delta,
2449 "Delta Unicast packets recieved");
2454 /**************************************************************************//**
2455 * Set the Transmitted Broadcast Packets in measurement interval
2456 * property of the vNIC performance.
2458 * @note The property is treated as immutable: it is only valid to call
2459 * the setter once. However, we don't assert if the caller tries to
2460 * overwrite, just ignoring the update instead.
2462 * @param vnic_performance Pointer to the vNIC Use.
2463 * @param tx_bcast_packets_acc
2464 *****************************************************************************/
2465 void evel_vnic_performance_tx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2466 const double tx_bcast_packets_acc)
2470 /***************************************************************************/
2471 /* Check preconditions. */
2472 /***************************************************************************/
2473 assert(tx_bcast_packets_acc >= 0.0);
2475 evel_set_option_double(&vnic_performance->tx_bcast_packets_acc,
2476 tx_bcast_packets_acc,
2477 "Transmitted Broadcast Packets accumulated");
2482 /**************************************************************************//**
2483 * Set the Delta Broadcast packets Transmitted in measurement interval
2484 * property of the vNIC performance.
2486 * @note The property is treated as immutable: it is only valid to call
2487 * the setter once. However, we don't assert if the caller tries to
2488 * overwrite, just ignoring the update instead.
2490 * @param vnic_performance Pointer to the vNIC Use.
2491 * @param tx_bcast_packets_delta
2492 *****************************************************************************/
2493 void evel_vnic_performance_tx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2494 const double tx_bcast_packets_delta)
2498 /***************************************************************************/
2499 /* Check preconditions. */
2500 /***************************************************************************/
2501 assert(tx_bcast_packets_delta >= 0.0);
2503 evel_set_option_double(&vnic_performance->tx_bcast_packets_delta,
2504 tx_bcast_packets_delta,
2505 "Delta Transmitted Broadcast packets ");
2510 /**************************************************************************//**
2511 * Set the Transmitted Discarded Packets in measurement interval
2512 * property of the vNIC performance.
2514 * @note The property is treated as immutable: it is only valid to call
2515 * the setter once. However, we don't assert if the caller tries to
2516 * overwrite, just ignoring the update instead.
2518 * @param vnic_performance Pointer to the vNIC Use.
2519 * @param tx_discarded_packets_acc
2520 *****************************************************************************/
2521 void evel_vnic_performance_tx_discarded_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2522 const double tx_discarded_packets_acc)
2526 /***************************************************************************/
2527 /* Check preconditions. */
2528 /***************************************************************************/
2529 assert(tx_discarded_packets_acc >= 0.0);
2531 evel_set_option_double(&vnic_performance->tx_discarded_packets_acc,
2532 tx_discarded_packets_acc,
2533 "Transmitted Discarded Packets accumulated");
2538 /**************************************************************************//**
2539 * Set the Delta Discarded packets Transmitted in measurement interval
2540 * property of the vNIC performance.
2542 * @note The property is treated as immutable: it is only valid to call
2543 * the setter once. However, we don't assert if the caller tries to
2544 * overwrite, just ignoring the update instead.
2546 * @param vnic_performance Pointer to the vNIC Use.
2547 * @param tx_discarded_packets_delta
2548 *****************************************************************************/
2549 void evel_vnic_performance_tx_discarded_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2550 const double tx_discarded_packets_delta)
2554 /***************************************************************************/
2555 /* Check preconditions. */
2556 /***************************************************************************/
2557 assert(tx_discarded_packets_delta >= 0.0);
2559 evel_set_option_double(&vnic_performance->tx_discarded_packets_delta,
2560 tx_discarded_packets_delta,
2561 "Delta Transmitted Discarded packets ");
2566 /**************************************************************************//**
2567 * Set the Transmitted Errored Packets in measurement interval
2568 * property of the vNIC performance.
2570 * @note The property is treated as immutable: it is only valid to call
2571 * the setter once. However, we don't assert if the caller tries to
2572 * overwrite, just ignoring the update instead.
2574 * @param vnic_performance Pointer to the vNIC Use.
2575 * @param tx_error_packets_acc
2576 *****************************************************************************/
2577 void evel_vnic_performance_tx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2578 const double tx_error_packets_acc)
2582 /***************************************************************************/
2583 /* Check preconditions. */
2584 /***************************************************************************/
2585 assert(tx_error_packets_acc >= 0.0);
2587 evel_set_option_double(&vnic_performance->tx_error_packets_acc,
2588 tx_error_packets_acc,
2589 "Transmitted Error Packets accumulated");
2594 /**************************************************************************//**
2595 * Set the Delta Errored packets Transmitted in measurement interval
2596 * property of the vNIC performance.
2598 * @note The property is treated as immutable: it is only valid to call
2599 * the setter once. However, we don't assert if the caller tries to
2600 * overwrite, just ignoring the update instead.
2602 * @param vnic_performance Pointer to the vNIC Use.
2603 * @param tx_error_packets_delta
2604 *****************************************************************************/
2605 void evel_vnic_performance_tx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2606 const double tx_error_packets_delta)
2610 /***************************************************************************/
2611 /* Check preconditions. */
2612 /***************************************************************************/
2613 assert(tx_error_packets_delta >= 0.0);
2615 evel_set_option_double(&vnic_performance->tx_error_packets_delta,
2616 tx_error_packets_delta,
2617 "Delta Transmitted Error packets ");
2622 /**************************************************************************//**
2623 * Set the Transmitted Multicast Packets in measurement interval
2624 * property of the vNIC performance.
2626 * @note The property is treated as immutable: it is only valid to call
2627 * the setter once. However, we don't assert if the caller tries to
2628 * overwrite, just ignoring the update instead.
2630 * @param vnic_performance Pointer to the vNIC Use.
2631 * @param tx_mcast_packets_acc
2632 *****************************************************************************/
2633 void evel_vnic_performance_tx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2634 const double tx_mcast_packets_acc)
2638 /***************************************************************************/
2639 /* Check preconditions. */
2640 /***************************************************************************/
2641 assert(tx_mcast_packets_acc >= 0.0);
2643 evel_set_option_double(&vnic_performance->tx_mcast_packets_acc,
2644 tx_mcast_packets_acc,
2645 "Transmitted Multicast Packets accumulated");
2650 /**************************************************************************//**
2651 * Set the Delta Multicast packets Transmitted in measurement interval
2652 * property of the vNIC performance.
2654 * @note The property is treated as immutable: it is only valid to call
2655 * the setter once. However, we don't assert if the caller tries to
2656 * overwrite, just ignoring the update instead.
2658 * @param vnic_performance Pointer to the vNIC Use.
2659 * @param tx_mcast_packets_delta
2660 *****************************************************************************/
2661 void evel_vnic_performance_tx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2662 const double tx_mcast_packets_delta)
2666 /***************************************************************************/
2667 /* Check preconditions. */
2668 /***************************************************************************/
2669 assert(tx_mcast_packets_delta >= 0.0);
2671 evel_set_option_double(&vnic_performance->tx_mcast_packets_delta,
2672 tx_mcast_packets_delta,
2673 "Delta Transmitted Multicast packets ");
2678 /**************************************************************************//**
2679 * Set the Transmitted Octets in measurement interval
2680 * property of the vNIC performance.
2682 * @note The property is treated as immutable: it is only valid to call
2683 * the setter once. However, we don't assert if the caller tries to
2684 * overwrite, just ignoring the update instead.
2686 * @param vnic_performance Pointer to the vNIC Use.
2687 * @param tx_octets_acc
2688 *****************************************************************************/
2689 void evel_vnic_performance_tx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2690 const double tx_octets_acc)
2694 /***************************************************************************/
2695 /* Check preconditions. */
2696 /***************************************************************************/
2697 assert(tx_octets_acc >= 0.0);
2699 evel_set_option_double(&vnic_performance->tx_octets_acc,
2701 "Transmitted Octets accumulated");
2706 /**************************************************************************//**
2707 * Set the Delta Octets Transmitted in measurement interval
2708 * property of the vNIC performance.
2710 * @note The property is treated as immutable: it is only valid to call
2711 * the setter once. However, we don't assert if the caller tries to
2712 * overwrite, just ignoring the update instead.
2714 * @param vnic_performance Pointer to the vNIC Use.
2715 * @param tx_octets_delta
2716 *****************************************************************************/
2717 void evel_vnic_performance_tx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2718 const double tx_octets_delta)
2722 /***************************************************************************/
2723 /* Check preconditions. */
2724 /***************************************************************************/
2725 assert(tx_octets_delta >= 0.0);
2727 evel_set_option_double(&vnic_performance->tx_octets_delta,
2729 "Delta Transmitted Octets ");
2735 /**************************************************************************//**
2736 * Set the Transmitted Total Packets in measurement interval
2737 * property of the vNIC performance.
2739 * @note The property is treated as immutable: it is only valid to call
2740 * the setter once. However, we don't assert if the caller tries to
2741 * overwrite, just ignoring the update instead.
2743 * @param vnic_performance Pointer to the vNIC Use.
2744 * @param tx_total_packets_acc
2745 *****************************************************************************/
2746 void evel_vnic_performance_tx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2747 const double tx_total_packets_acc)
2751 /***************************************************************************/
2752 /* Check preconditions. */
2753 /***************************************************************************/
2754 assert(tx_total_packets_acc >= 0.0);
2756 evel_set_option_double(&vnic_performance->tx_total_packets_acc,
2757 tx_total_packets_acc,
2758 "Transmitted Total Packets accumulated");
2763 /**************************************************************************//**
2764 * Set the Delta Total Packets Transmitted in measurement interval
2765 * property of the vNIC performance.
2767 * @note The property is treated as immutable: it is only valid to call
2768 * the setter once. However, we don't assert if the caller tries to
2769 * overwrite, just ignoring the update instead.
2771 * @param vnic_performance Pointer to the vNIC Use.
2772 * @param tx_total_packets_delta
2773 *****************************************************************************/
2774 void evel_vnic_performance_tx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2775 const double tx_total_packets_delta)
2779 /***************************************************************************/
2780 /* Check preconditions. */
2781 /***************************************************************************/
2782 assert(tx_total_packets_delta >= 0.0);
2784 evel_set_option_double(&vnic_performance->tx_total_packets_delta,
2785 tx_total_packets_delta,
2786 "Delta Transmitted Total Packets ");
2792 /**************************************************************************//**
2793 * Set the Transmitted Unicast Packets in measurement interval
2794 * property of the vNIC performance.
2796 * @note The property is treated as immutable: it is only valid to call
2797 * the setter once. However, we don't assert if the caller tries to
2798 * overwrite, just ignoring the update instead.
2800 * @param vnic_performance Pointer to the vNIC Use.
2801 * @param tx_ucast_packets_acc
2802 *****************************************************************************/
2803 void evel_vnic_performance_tx_ucast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2804 const double tx_ucast_packets_acc)
2808 /***************************************************************************/
2809 /* Check preconditions. */
2810 /***************************************************************************/
2811 assert(tx_ucast_packets_acc >= 0.0);
2813 evel_set_option_double(&vnic_performance->tx_ucast_packets_acc,
2814 tx_ucast_packets_acc,
2815 "Transmitted Unicast Packets accumulated");
2820 /**************************************************************************//**
2821 * Set the Delta Octets Transmitted in measurement interval
2822 * property of the vNIC performance.
2824 * @note The property is treated as immutable: it is only valid to call
2825 * the setter once. However, we don't assert if the caller tries to
2826 * overwrite, just ignoring the update instead.
2828 * @param vnic_performance Pointer to the vNIC Use.
2829 * @param tx_ucast_packets_delta
2830 *****************************************************************************/
2831 void evel_vnic_performance_tx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2832 const double tx_ucast_packets_delta)
2836 /***************************************************************************/
2837 /* Check preconditions. */
2838 /***************************************************************************/
2839 assert(tx_ucast_packets_delta >= 0.0);
2841 evel_set_option_double(&vnic_performance->tx_ucast_packets_delta,
2842 tx_ucast_packets_delta,
2843 "Delta Transmitted Unicast Packets ");
2849 /**************************************************************************//**
2850 * Add an additional vNIC Use to the specified Measurement event.
2852 * @param measurement Pointer to the measurement.
2853 * @param vnic_performance Pointer to the vNIC Use to add.
2854 *****************************************************************************/
2855 void evel_meas_vnic_performance_add(EVENT_MEASUREMENT * const measurement,
2856 MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance)
2860 /***************************************************************************/
2861 /* Check preconditions. */
2862 /***************************************************************************/
2863 assert(measurement != NULL);
2864 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
2865 assert(vnic_performance != NULL);
2867 dlist_push_last(&measurement->vnic_usage, vnic_performance);
2872 /**************************************************************************//**
2873 * Add an additional vNIC usage record Measurement.
2875 * This function implements the previous API, purely for convenience.
2877 * The ID is null delimited ASCII string. The library takes a copy so the
2878 * caller does not have to preserve values after the function returns.
2880 * @param measurement Pointer to the measurement.
2881 * @param vnic_id ASCIIZ string with the vNIC's ID.
2882 * @param valset true or false confidence level
2883 * @param recvd_bcast_packets_acc Recieved broadcast packets
2884 * @param recvd_bcast_packets_delta Received delta broadcast packets
2885 * @param recvd_discarded_packets_acc Recieved discarded packets
2886 * @param recvd_discarded_packets_delta Received discarded delta packets
2887 * @param recvd_error_packets_acc Received error packets
2888 * @param recvd_error_packets_delta, Received delta error packets
2889 * @param recvd_mcast_packets_acc Received multicast packets
2890 * @param recvd_mcast_packets_delta Received delta multicast packets
2891 * @param recvd_octets_acc Received octets
2892 * @param recvd_octets_delta Received delta octets
2893 * @param recvd_total_packets_acc Received total packets
2894 * @param recvd_total_packets_delta Received delta total packets
2895 * @param recvd_ucast_packets_acc Received Unicast packets
2896 * @param recvd_ucast_packets_delta Received delta unicast packets
2897 * @param tx_bcast_packets_acc Transmitted broadcast packets
2898 * @param tx_bcast_packets_delta Transmitted delta broadcast packets
2899 * @param tx_discarded_packets_acc Transmitted packets discarded
2900 * @param tx_discarded_packets_delta Transmitted delta discarded packets
2901 * @param tx_error_packets_acc Transmitted error packets
2902 * @param tx_error_packets_delta Transmitted delta error packets
2903 * @param tx_mcast_packets_acc Transmitted multicast packets accumulated
2904 * @param tx_mcast_packets_delta Transmitted delta multicast packets
2905 * @param tx_octets_acc Transmitted octets
2906 * @param tx_octets_delta Transmitted delta octets
2907 * @param tx_total_packets_acc Transmitted total packets
2908 * @param tx_total_packets_delta Transmitted delta total packets
2909 * @param tx_ucast_packets_acc Transmitted Unicast packets
2910 * @param tx_ucast_packets_delta Transmitted delta Unicast packets
2911 *****************************************************************************/
2912 void evel_measurement_vnic_performance_add(EVENT_MEASUREMENT * const measurement,
2913 char * const vnic_id,
2915 double recvd_bcast_packets_acc,
2916 double recvd_bcast_packets_delta,
2917 double recvd_discarded_packets_acc,
2918 double recvd_discarded_packets_delta,
2919 double recvd_error_packets_acc,
2920 double recvd_error_packets_delta,
2921 double recvd_mcast_packets_acc,
2922 double recvd_mcast_packets_delta,
2923 double recvd_octets_acc,
2924 double recvd_octets_delta,
2925 double recvd_total_packets_acc,
2926 double recvd_total_packets_delta,
2927 double recvd_ucast_packets_acc,
2928 double recvd_ucast_packets_delta,
2929 double tx_bcast_packets_acc,
2930 double tx_bcast_packets_delta,
2931 double tx_discarded_packets_acc,
2932 double tx_discarded_packets_delta,
2933 double tx_error_packets_acc,
2934 double tx_error_packets_delta,
2935 double tx_mcast_packets_acc,
2936 double tx_mcast_packets_delta,
2937 double tx_octets_acc,
2938 double tx_octets_delta,
2939 double tx_total_packets_acc,
2940 double tx_total_packets_delta,
2941 double tx_ucast_packets_acc,
2942 double tx_ucast_packets_delta)
2944 MEASUREMENT_VNIC_PERFORMANCE * vnic_performance = NULL;
2947 /***************************************************************************/
2948 /* Trust the assertions in the underlying methods. */
2949 /***************************************************************************/
2950 vnic_performance = evel_measurement_new_vnic_performance(vnic_id, valset);
2952 evel_vnic_performance_rx_bcast_pkt_acc_set(vnic_performance, recvd_bcast_packets_acc);
2953 evel_vnic_performance_rx_bcast_pkt_delta_set(vnic_performance, recvd_bcast_packets_delta);
2954 evel_vnic_performance_rx_discard_pkt_acc_set(vnic_performance, recvd_discarded_packets_acc);
2955 evel_vnic_performance_rx_discard_pkt_delta_set(vnic_performance, recvd_discarded_packets_delta);
2956 evel_vnic_performance_rx_error_pkt_acc_set(vnic_performance, recvd_error_packets_acc);
2957 evel_vnic_performance_rx_error_pkt_delta_set(vnic_performance, recvd_error_packets_delta);
2958 evel_vnic_performance_rx_mcast_pkt_acc_set(vnic_performance, recvd_mcast_packets_acc);
2959 evel_vnic_performance_rx_mcast_pkt_delta_set(vnic_performance, recvd_mcast_packets_delta);
2960 evel_vnic_performance_rx_octets_acc_set(vnic_performance, recvd_octets_acc);
2961 evel_vnic_performance_rx_octets_delta_set(vnic_performance, recvd_octets_delta);
2962 evel_vnic_performance_rx_total_pkt_acc_set(vnic_performance, recvd_total_packets_acc);
2963 evel_vnic_performance_rx_total_pkt_delta_set(vnic_performance, recvd_total_packets_delta);
2964 evel_vnic_performance_rx_ucast_pkt_acc_set(vnic_performance, recvd_ucast_packets_acc);
2965 evel_vnic_performance_rx_ucast_pkt_delta_set(vnic_performance, recvd_ucast_packets_delta);
2966 evel_vnic_performance_tx_bcast_pkt_acc_set(vnic_performance, tx_bcast_packets_acc);
2967 evel_vnic_performance_tx_bcast_pkt_delta_set(vnic_performance, tx_bcast_packets_delta);
2968 evel_vnic_performance_tx_discarded_pkt_acc_set(vnic_performance, tx_discarded_packets_acc);
2969 evel_vnic_performance_tx_discarded_pkt_delta_set(vnic_performance, tx_discarded_packets_delta);
2970 evel_vnic_performance_tx_error_pkt_acc_set(vnic_performance, tx_error_packets_acc);
2971 evel_vnic_performance_tx_error_pkt_delta_set(vnic_performance, tx_error_packets_delta);
2972 evel_vnic_performance_tx_mcast_pkt_acc_set(vnic_performance, tx_mcast_packets_acc);
2973 evel_vnic_performance_tx_mcast_pkt_delta_set(vnic_performance, tx_mcast_packets_delta);
2974 evel_vnic_performance_tx_octets_acc_set(vnic_performance, tx_octets_acc);
2975 evel_vnic_performance_tx_octets_delta_set(vnic_performance, tx_octets_delta);
2976 evel_vnic_performance_tx_total_pkt_acc_set(vnic_performance, tx_total_packets_acc);
2977 evel_vnic_performance_tx_total_pkt_delta_set(vnic_performance, tx_total_packets_delta);
2978 evel_vnic_performance_tx_ucast_pkt_acc_set(vnic_performance, tx_ucast_packets_acc);
2979 evel_vnic_performance_tx_ucast_pkt_delta_set(vnic_performance, tx_ucast_packets_delta);
2980 evel_meas_vnic_performance_add(measurement, vnic_performance);
2983 /**************************************************************************//**
2984 * Encode the measurement as a JSON measurement.
2986 * @param jbuf Pointer to the ::EVEL_JSON_BUFFER to encode into.
2987 * @param event Pointer to the ::EVENT_HEADER to encode.
2988 *****************************************************************************/
2989 void evel_json_encode_measurement(EVEL_JSON_BUFFER * jbuf,
2990 EVENT_MEASUREMENT * event)
2992 MEASUREMENT_CPU_USE * cpu_use = NULL;
2993 MEASUREMENT_MEM_USE * mem_use = NULL;
2994 MEASUREMENT_DISK_USE * disk_use = NULL;
2995 MEASUREMENT_FSYS_USE * fsys_use = NULL;
2996 MEASUREMENT_LATENCY_BUCKET * bucket = NULL;
2997 MEASUREMENT_VNIC_PERFORMANCE * vnic_performance = NULL;
2998 MEASUREMENT_ERRORS * errors = NULL;
2999 MEASUREMENT_FEATURE_USE * feature_use = NULL;
3000 MEASUREMENT_CODEC_USE * codec_use = NULL;
3001 MEASUREMENT_GROUP * measurement_group = NULL;
3002 CUSTOM_MEASUREMENT * custom_measurement = NULL;
3003 DLIST_ITEM * item = NULL;
3004 DLIST_ITEM * nested_item = NULL;
3005 DLIST_ITEM * addl_info_item = NULL;
3006 OTHER_FIELD *addl_info = NULL;
3010 /***************************************************************************/
3011 /* Check preconditions. */
3012 /***************************************************************************/
3013 assert(event != NULL);
3014 assert(event->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
3016 evel_json_encode_header(jbuf, &event->header);
3017 evel_json_open_named_object(jbuf, "measurementsForVfScalingFields");
3019 /***************************************************************************/
3020 /* Mandatory fields. */
3021 /***************************************************************************/
3022 evel_enc_kv_int(jbuf, "measurementInterval", event->measurement_interval);
3024 /***************************************************************************/
3025 /* Optional fields. */
3026 /***************************************************************************/
3027 // additional fields
3028 evel_json_checkpoint(jbuf);
3029 if (evel_json_open_opt_named_list(jbuf, "additionalFields"))
3031 bool item_added = false;
3033 addl_info_item = dlist_get_first(&event->additional_info);
3034 while (addl_info_item != NULL)
3036 addl_info = (OTHER_FIELD*) addl_info_item->item;
3037 assert(addl_info != NULL);
3039 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3043 evel_json_open_object(jbuf);
3044 evel_enc_kv_string(jbuf, "name", addl_info->name);
3045 evel_enc_kv_string(jbuf, "value", addl_info->value);
3046 evel_json_close_object(jbuf);
3049 addl_info_item = dlist_get_next(addl_info_item);
3051 evel_json_close_list(jbuf);
3053 /*************************************************************************/
3054 /* If we've not written anything, rewind to before we opened the list. */
3055 /*************************************************************************/
3058 evel_json_rewind(jbuf);
3062 // TBD additional json objects
3063 evel_enc_kv_opt_int(jbuf, "concurrentSessions", &event->concurrent_sessions);
3064 evel_enc_kv_opt_int(jbuf, "configuredEntities", &event->configured_entities);
3066 /***************************************************************************/
3068 /***************************************************************************/
3069 evel_json_checkpoint(jbuf);
3070 if (evel_json_open_opt_named_list(jbuf, "cpuUsageArray"))
3072 bool item_added = false;
3074 item = dlist_get_first(&event->cpu_usage);
3075 while (item != NULL)
3077 cpu_use = (MEASUREMENT_CPU_USE*) item->item;
3078 assert(cpu_use != NULL);
3080 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3084 evel_json_open_object(jbuf);
3085 evel_enc_kv_string(jbuf, "cpuIdentifier", cpu_use->id);
3086 evel_enc_kv_opt_double(jbuf, "cpuIdle", &cpu_use->idle);
3087 evel_enc_kv_opt_double(jbuf, "cpuUsageInterrupt", &cpu_use->intrpt);
3088 evel_enc_kv_opt_double(jbuf, "cpuUsageNice", &cpu_use->nice);
3089 evel_enc_kv_opt_double(jbuf, "cpuUsageSoftIrq", &cpu_use->softirq);
3090 evel_enc_kv_opt_double(jbuf, "cpuUsageSteal", &cpu_use->steal);
3091 evel_enc_kv_opt_double(jbuf, "cpuUsageSystem", &cpu_use->sys);
3092 evel_enc_kv_opt_double(jbuf, "cpuUsageUser", &cpu_use->user);
3093 evel_enc_kv_opt_double(jbuf, "cpuWait", &cpu_use->wait);
3094 evel_enc_kv_double(jbuf, "percentUsage",cpu_use->usage);
3095 evel_json_close_object(jbuf);
3098 item = dlist_get_next(item);
3100 evel_json_close_list(jbuf);
3102 /*************************************************************************/
3103 /* If we've not written anything, rewind to before we opened the list. */
3104 /*************************************************************************/
3107 evel_json_rewind(jbuf);
3112 /***************************************************************************/
3113 /* Disk Use list. */
3114 /***************************************************************************/
3115 evel_json_checkpoint(jbuf);
3116 if (evel_json_open_opt_named_list(jbuf, "diskUsageArray"))
3118 bool item_added = false;
3120 item = dlist_get_first(&event->disk_usage);
3121 while (item != NULL)
3123 disk_use = (MEASUREMENT_DISK_USE*) item->item;
3124 assert(disk_use != NULL);
3126 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3130 evel_json_open_object(jbuf);
3131 evel_enc_kv_string(jbuf, "diskIdentifier", disk_use->id);
3132 evel_enc_kv_opt_double(jbuf, "diskIoTimeAvg", &disk_use->iotimeavg);
3133 evel_enc_kv_opt_double(jbuf, "diskIoTimeLast", &disk_use->iotimelast);
3134 evel_enc_kv_opt_double(jbuf, "diskIoTimeMax", &disk_use->iotimemax);
3135 evel_enc_kv_opt_double(jbuf, "diskIoTimeMin", &disk_use->iotimemin);
3136 evel_enc_kv_opt_double(jbuf, "diskMergedReadAvg", &disk_use->mergereadavg);
3137 evel_enc_kv_opt_double(jbuf, "diskMergedReadLast", &disk_use->mergereadlast);
3138 evel_enc_kv_opt_double(jbuf, "diskMergedReadMax", &disk_use->mergereadmax);
3139 evel_enc_kv_opt_double(jbuf, "diskMergedReadMin", &disk_use->mergereadmin);
3140 evel_enc_kv_opt_double(jbuf, "diskMergedWriteAvg", &disk_use->mergewriteavg);
3141 evel_enc_kv_opt_double(jbuf, "diskMergedWriteLast", &disk_use->mergewritelast);
3142 evel_enc_kv_opt_double(jbuf, "diskMergedWriteMax", &disk_use->mergewritemax);
3143 evel_enc_kv_opt_double(jbuf, "diskMergedWriteMin", &disk_use->mergewritemin);
3144 evel_enc_kv_opt_double(jbuf, "diskOctetsReadAvg", &disk_use->octetsreadavg);
3145 evel_enc_kv_opt_double(jbuf, "diskOctetsReadLast", &disk_use->octetsreadlast);
3146 evel_enc_kv_opt_double(jbuf, "diskOctetsReadMax", &disk_use->octetsreadmax);
3147 evel_enc_kv_opt_double(jbuf, "diskOctetsReadMin", &disk_use->octetsreadmin);
3148 evel_enc_kv_opt_double(jbuf, "diskOctetsWriteAvg", &disk_use->octetswriteavg);
3149 evel_enc_kv_opt_double(jbuf, "diskOctetsWriteLast", &disk_use->octetswritelast);
3150 evel_enc_kv_opt_double(jbuf, "diskOctetsWriteMax", &disk_use->octetswritemax);
3151 evel_enc_kv_opt_double(jbuf, "diskOctetsWriteMin", &disk_use->octetswritemin);
3152 evel_enc_kv_opt_double(jbuf, "diskOpsReadAvg", &disk_use->opsreadavg);
3153 evel_enc_kv_opt_double(jbuf, "diskOpsReadLast", &disk_use->opsreadlast);
3154 evel_enc_kv_opt_double(jbuf, "diskOpsReadMax", &disk_use->opsreadmax);
3155 evel_enc_kv_opt_double(jbuf, "diskOpsReadMin", &disk_use->opsreadmin);
3156 evel_enc_kv_opt_double(jbuf, "diskOpsWriteAvg", &disk_use->opswriteavg);
3157 evel_enc_kv_opt_double(jbuf, "diskOpsWriteLast", &disk_use->opswritelast);
3158 evel_enc_kv_opt_double(jbuf, "diskOpsWriteMax", &disk_use->opswritemax);
3159 evel_enc_kv_opt_double(jbuf, "diskOpsWriteMin", &disk_use->opswritemin);
3160 evel_enc_kv_opt_double(jbuf, "diskPendingOperationsAvg", &disk_use->pendingopsavg);
3161 evel_enc_kv_opt_double(jbuf, "diskPendingOperationsLast", &disk_use->pendingopslast);
3162 evel_enc_kv_opt_double(jbuf, "diskPendingOperationsMax", &disk_use->pendingopsmax);
3163 evel_enc_kv_opt_double(jbuf, "diskPendingOperationsMin", &disk_use->pendingopsmin);
3164 evel_enc_kv_opt_double(jbuf, "diskTimeReadAvg", &disk_use->timereadavg);
3165 evel_enc_kv_opt_double(jbuf, "diskTimeReadLast", &disk_use->timereadlast);
3166 evel_enc_kv_opt_double(jbuf, "diskTimeReadMax", &disk_use->timereadmax);
3167 evel_enc_kv_opt_double(jbuf, "diskTimeReadMin", &disk_use->timereadmin);
3168 evel_enc_kv_opt_double(jbuf, "diskTimeWriteAvg", &disk_use->timewriteavg);
3169 evel_enc_kv_opt_double(jbuf, "diskTimeWriteLast", &disk_use->timewritelast);
3170 evel_enc_kv_opt_double(jbuf, "diskTimeWriteMax", &disk_use->timewritemax);
3171 evel_enc_kv_opt_double(jbuf, "diskTimeWriteMin", &disk_use->timewritemin);
3172 evel_json_close_object(jbuf);
3175 item = dlist_get_next(item);
3177 evel_json_close_list(jbuf);
3179 /*************************************************************************/
3180 /* If we've not written anything, rewind to before we opened the list. */
3181 /*************************************************************************/
3184 evel_json_rewind(jbuf);
3188 /***************************************************************************/
3189 /* Filesystem Usage list. */
3190 /***************************************************************************/
3191 evel_json_checkpoint(jbuf);
3192 if (evel_json_open_opt_named_list(jbuf, "filesystemUsageArray"))
3194 bool item_added = false;
3196 item = dlist_get_first(&event->filesystem_usage);
3197 while (item != NULL)
3199 fsys_use = (MEASUREMENT_FSYS_USE *) item->item;
3200 assert(fsys_use != NULL);
3202 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3203 "filesystemUsageArray",
3204 fsys_use->filesystem_name))
3206 evel_json_open_object(jbuf);
3207 evel_enc_kv_string(jbuf, "filesystemName", fsys_use->filesystem_name);
3209 jbuf, "blockConfigured", fsys_use->block_configured);
3210 evel_enc_kv_double(jbuf, "blockIops", fsys_use->block_iops);
3211 evel_enc_kv_double(jbuf, "blockUsed", fsys_use->block_used);
3213 jbuf, "ephemeralConfigured", fsys_use->ephemeral_configured);
3214 evel_enc_kv_double(jbuf, "ephemeralIops", fsys_use->ephemeral_iops);
3215 evel_enc_kv_double(jbuf, "ephemeralUsed", fsys_use->ephemeral_used);
3216 evel_json_close_object(jbuf);
3219 item = dlist_get_next(item);
3221 evel_json_close_list(jbuf);
3223 /*************************************************************************/
3224 /* If we've not written anything, rewind to before we opened the list. */
3225 /*************************************************************************/
3228 evel_json_rewind(jbuf);
3232 /***************************************************************************/
3233 /* Latency distribution. */
3234 /***************************************************************************/
3235 item = dlist_get_first(&event->latency_distribution);
3236 if ((item != NULL) &&
3237 evel_json_open_opt_named_list(jbuf, "latencyDistribution"))
3239 while (item != NULL)
3241 bucket = (MEASUREMENT_LATENCY_BUCKET*) item->item;
3242 assert(bucket != NULL);
3244 evel_json_open_object(jbuf);
3245 evel_enc_kv_opt_double(
3246 jbuf, "lowEndOfLatencyBucket", &bucket->low_end);
3247 evel_enc_kv_opt_double(
3248 jbuf, "highEndOfLatencyBucket", &bucket->high_end);
3249 evel_enc_kv_int(jbuf, "countsInTheBucket", bucket->count);
3250 evel_json_close_object(jbuf);
3251 item = dlist_get_next(item);
3253 evel_json_close_list(jbuf);
3256 evel_enc_kv_opt_double(
3257 jbuf, "meanRequestLatency", &event->mean_request_latency);
3258 evel_enc_kv_opt_int(jbuf, "requestRate", &event->request_rate);
3260 /***************************************************************************/
3261 /* vNIC Usage TBD Performance array */
3262 /***************************************************************************/
3263 evel_json_checkpoint(jbuf);
3264 if (evel_json_open_opt_named_list(jbuf, "vNicUsageArray"))
3266 bool item_added = false;
3268 item = dlist_get_first(&event->vnic_usage);
3269 while (item != NULL)
3271 vnic_performance = (MEASUREMENT_VNIC_PERFORMANCE *) item->item;
3272 assert(vnic_performance != NULL);
3274 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3275 "vNicPerformanceArray",
3276 vnic_performance->vnic_id))
3278 evel_json_open_object(jbuf);
3280 /*********************************************************************/
3281 /* Optional fields. */
3282 /*********************************************************************/
3283 evel_enc_kv_opt_double( jbuf,
3284 "receivedBroadcastPacketsAccumulated", &vnic_performance->recvd_bcast_packets_acc);
3285 evel_enc_kv_opt_double( jbuf,
3286 "receivedBroadcastPacketsDelta", &vnic_performance->recvd_bcast_packets_delta);
3287 evel_enc_kv_opt_double( jbuf,
3288 "receivedDiscardedPacketsAccumulated", &vnic_performance->recvd_discarded_packets_acc);
3289 evel_enc_kv_opt_double( jbuf,
3290 "receivedDiscardedPacketsDelta", &vnic_performance->recvd_discarded_packets_delta);
3291 evel_enc_kv_opt_double( jbuf,
3292 "receivedErrorPacketsAccumulated", &vnic_performance->recvd_error_packets_acc);
3293 evel_enc_kv_opt_double( jbuf,
3294 "receivedErrorPacketsDelta", &vnic_performance->recvd_error_packets_delta);
3295 evel_enc_kv_opt_double( jbuf,
3296 "receivedMulticastPacketsAccumulated", &vnic_performance->recvd_mcast_packets_acc);
3297 evel_enc_kv_opt_double( jbuf,
3298 "receivedMulticastPacketsDelta", &vnic_performance->recvd_mcast_packets_delta);
3299 evel_enc_kv_opt_double( jbuf,
3300 "receivedOctetsAccumulated", &vnic_performance->recvd_octets_acc);
3301 evel_enc_kv_opt_double( jbuf,
3302 "receivedOctetsDelta", &vnic_performance->recvd_octets_delta);
3303 evel_enc_kv_opt_double( jbuf,
3304 "receivedTotalPacketsAccumulated", &vnic_performance->recvd_total_packets_acc);
3305 evel_enc_kv_opt_double( jbuf,
3306 "receivedTotalPacketsDelta", &vnic_performance->recvd_total_packets_delta);
3307 evel_enc_kv_opt_double( jbuf,
3308 "receivedUnicastPacketsAccumulated", &vnic_performance->recvd_ucast_packets_acc);
3309 evel_enc_kv_opt_double( jbuf,
3310 "receivedUnicastPacketsDelta", &vnic_performance->recvd_ucast_packets_delta);
3311 evel_enc_kv_opt_double( jbuf,
3312 "transmittedBroadcastPacketsAccumulated", &vnic_performance->tx_bcast_packets_acc);
3313 evel_enc_kv_opt_double( jbuf,
3314 "transmittedBroadcastPacketsDelta", &vnic_performance->tx_bcast_packets_delta);
3315 evel_enc_kv_opt_double( jbuf,
3316 "transmittedDiscardedPacketsAccumulated", &vnic_performance->tx_discarded_packets_acc);
3317 evel_enc_kv_opt_double( jbuf,
3318 "transmittedDiscardedPacketsDelta", &vnic_performance->tx_discarded_packets_delta);
3319 evel_enc_kv_opt_double( jbuf,
3320 "transmittedErrorPacketsAccumulated", &vnic_performance->tx_error_packets_acc);
3321 evel_enc_kv_opt_double( jbuf,
3322 "transmittedErrorPacketsDelta", &vnic_performance->tx_error_packets_delta);
3323 evel_enc_kv_opt_double( jbuf,
3324 "transmittedMulticastPacketsAccumulated", &vnic_performance->tx_mcast_packets_acc);
3325 evel_enc_kv_opt_double( jbuf,
3326 "transmittedMulticastPacketsDelta", &vnic_performance->tx_mcast_packets_delta);
3327 evel_enc_kv_opt_double( jbuf,
3328 "transmittedOctetsAccumulated", &vnic_performance->tx_octets_acc);
3329 evel_enc_kv_opt_double( jbuf,
3330 "transmittedOctetsDelta", &vnic_performance->tx_octets_delta);
3331 evel_enc_kv_opt_double( jbuf,
3332 "transmittedTotalPacketsAccumulated", &vnic_performance->tx_total_packets_acc);
3333 evel_enc_kv_opt_double( jbuf,
3334 "transmittedTotalPacketsDelta", &vnic_performance->tx_total_packets_delta);
3335 evel_enc_kv_opt_double( jbuf,
3336 "transmittedUnicastPacketsAccumulated", &vnic_performance->tx_ucast_packets_acc);
3337 evel_enc_kv_opt_double( jbuf,
3338 "transmittedUnicastPacketsDelta", &vnic_performance->tx_ucast_packets_delta);
3340 /*********************************************************************/
3341 /* Mandatory fields. */
3342 /*********************************************************************/
3343 evel_enc_kv_string(jbuf, "valuesAreSuspect", vnic_performance->valuesaresuspect);
3344 evel_enc_kv_string(jbuf, "vNicIdentifier", vnic_performance->vnic_id);
3346 evel_json_close_object(jbuf);
3349 item = dlist_get_next(item);
3352 evel_json_close_list(jbuf);
3354 /*************************************************************************/
3355 /* If we've not written anything, rewind to before we opened the list. */
3356 /*************************************************************************/
3359 evel_json_rewind(jbuf);
3364 /***************************************************************************/
3365 /* Memory Use list. */
3366 /***************************************************************************/
3367 evel_json_checkpoint(jbuf);
3368 if (evel_json_open_opt_named_list(jbuf, "memoryUsageArray"))
3370 bool item_added = false;
3372 item = dlist_get_first(&event->mem_usage);
3373 while (item != NULL)
3375 mem_use = (MEASUREMENT_MEM_USE*) item->item;
3376 assert(mem_use != NULL);
3378 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3382 evel_json_open_object(jbuf);
3383 evel_enc_kv_double(jbuf, "memoryBuffered", mem_use->membuffsz);
3384 evel_enc_kv_opt_double(jbuf, "memoryCached", &mem_use->memcache);
3385 evel_enc_kv_opt_double(jbuf, "memoryConfigured", &mem_use->memconfig);
3386 evel_enc_kv_opt_double(jbuf, "memoryFree", &mem_use->memfree);
3387 evel_enc_kv_opt_double(jbuf, "memorySlabRecl", &mem_use->slabrecl);
3388 evel_enc_kv_opt_double(jbuf, "memorySlabUnrecl", &mem_use->slabunrecl);
3389 evel_enc_kv_opt_double(jbuf, "memoryUsed", &mem_use->memused);
3390 evel_enc_kv_string(jbuf, "vmIdentifier", mem_use->id);
3391 evel_json_close_object(jbuf);
3394 item = dlist_get_next(item);
3396 evel_json_close_list(jbuf);
3398 /*************************************************************************/
3399 /* If we've not written anything, rewind to before we opened the list. */
3400 /*************************************************************************/
3403 evel_json_rewind(jbuf);
3408 evel_enc_kv_opt_int(
3409 jbuf, "numberOfMediaPortsInUse", &event->media_ports_in_use);
3410 evel_enc_kv_opt_int(
3411 jbuf, "vnfcScalingMetric", &event->vnfc_scaling_metric);
3413 /***************************************************************************/
3415 /***************************************************************************/
3416 if ((event->errors != NULL) &&
3417 evel_json_open_opt_named_object(jbuf, "errors"))
3419 errors = event->errors;
3420 evel_enc_kv_int(jbuf, "receiveDiscards", errors->receive_discards);
3421 evel_enc_kv_int(jbuf, "receiveErrors", errors->receive_errors);
3422 evel_enc_kv_int(jbuf, "transmitDiscards", errors->transmit_discards);
3423 evel_enc_kv_int(jbuf, "transmitErrors", errors->transmit_errors);
3424 evel_json_close_object(jbuf);
3427 /***************************************************************************/
3428 /* Feature Utilization list. */
3429 /***************************************************************************/
3430 evel_json_checkpoint(jbuf);
3431 if (evel_json_open_opt_named_list(jbuf, "featureUsageArray"))
3433 bool item_added = false;
3435 item = dlist_get_first(&event->feature_usage);
3436 while (item != NULL)
3438 feature_use = (MEASUREMENT_FEATURE_USE*) item->item;
3439 assert(feature_use != NULL);
3441 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3442 "featureUsageArray",
3443 feature_use->feature_id))
3445 evel_json_open_object(jbuf);
3446 evel_enc_kv_string(jbuf, "featureIdentifier", feature_use->feature_id);
3448 jbuf, "featureUtilization", feature_use->feature_utilization);
3449 evel_json_close_object(jbuf);
3452 item = dlist_get_next(item);
3454 evel_json_close_list(jbuf);
3456 /*************************************************************************/
3457 /* If we've not written anything, rewind to before we opened the list. */
3458 /*************************************************************************/
3461 evel_json_rewind(jbuf);
3465 /***************************************************************************/
3466 /* Codec Utilization list. */
3467 /***************************************************************************/
3468 evel_json_checkpoint(jbuf);
3469 if (evel_json_open_opt_named_list(jbuf, "codecUsageArray"))
3471 bool item_added = false;
3473 item = dlist_get_first(&event->codec_usage);
3474 while (item != NULL)
3476 codec_use = (MEASUREMENT_CODEC_USE*) item->item;
3477 assert(codec_use != NULL);
3479 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3481 codec_use->codec_id))
3483 evel_json_open_object(jbuf);
3484 evel_enc_kv_string(jbuf, "codecIdentifier", codec_use->codec_id);
3485 evel_enc_kv_int(jbuf, "numberInUse", codec_use->number_in_use);
3486 evel_json_close_object(jbuf);
3489 item = dlist_get_next(item);
3491 evel_json_close_list(jbuf);
3493 /*************************************************************************/
3494 /* If we've not written anything, rewind to before we opened the list. */
3495 /*************************************************************************/
3498 evel_json_rewind(jbuf);
3502 /***************************************************************************/
3503 /* Additional Measurement Groups list. */
3504 /***************************************************************************/
3505 evel_json_checkpoint(jbuf);
3506 if (evel_json_open_opt_named_list(jbuf, "additionalMeasurements"))
3508 bool item_added = false;
3510 item = dlist_get_first(&event->additional_measurements);
3511 while (item != NULL)
3513 measurement_group = (MEASUREMENT_GROUP *) item->item;
3514 assert(measurement_group != NULL);
3516 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3517 "additionalMeasurements",
3518 measurement_group->name))
3520 evel_json_open_object(jbuf);
3521 evel_enc_kv_string(jbuf, "name", measurement_group->name);
3522 evel_json_open_opt_named_list(jbuf, "arrayOfFields");
3524 /*********************************************************************/
3525 /* Measurements list. */
3526 /*********************************************************************/
3527 nested_item = dlist_get_first(&measurement_group->measurements);
3528 while (nested_item != NULL)
3530 custom_measurement = (CUSTOM_MEASUREMENT *) nested_item->item;
3531 assert(custom_measurement != NULL);
3533 evel_json_open_object(jbuf);
3534 evel_enc_kv_string(jbuf, "name", custom_measurement->name);
3535 evel_enc_kv_string(jbuf, "value", custom_measurement->value);
3536 evel_json_close_object(jbuf);
3537 nested_item = dlist_get_next(nested_item);
3539 evel_json_close_list(jbuf);
3540 evel_json_close_object(jbuf);
3543 item = dlist_get_next(item);
3545 evel_json_close_list(jbuf);
3547 /*************************************************************************/
3548 /* If we've not written anything, rewind to before we opened the list. */
3549 /*************************************************************************/
3552 evel_json_rewind(jbuf);
3556 /***************************************************************************/
3557 /* Although optional, we always generate the version. Note that this */
3558 /* closes the object, too. */
3559 /***************************************************************************/
3560 evel_enc_version(jbuf,
3561 "measurementsForVfScalingVersion",
3562 event->major_version,
3563 event->minor_version);
3564 evel_json_close_object(jbuf);
3569 /**************************************************************************//**
3570 * Free a Measurement.
3572 * Free off the Measurement supplied. Will free all the contained allocated
3575 * @note It does not free the Measurement itself, since that may be part of a
3577 *****************************************************************************/
3578 void evel_free_measurement(EVENT_MEASUREMENT * event)
3580 MEASUREMENT_CPU_USE * cpu_use = NULL;
3581 MEASUREMENT_DISK_USE * disk_use = NULL;
3582 MEASUREMENT_FSYS_USE * fsys_use = NULL;
3583 MEASUREMENT_LATENCY_BUCKET * bucket = NULL;
3584 MEASUREMENT_MEM_USE * mem_use = NULL;
3585 MEASUREMENT_VNIC_PERFORMANCE * vnic_performance = NULL;
3586 MEASUREMENT_FEATURE_USE * feature_use = NULL;
3587 MEASUREMENT_CODEC_USE * codec_use = NULL;
3588 MEASUREMENT_GROUP * measurement_group = NULL;
3589 CUSTOM_MEASUREMENT * measurement = NULL;
3590 OTHER_FIELD *addl_info = NULL;
3594 /***************************************************************************/
3595 /* Check preconditions. As an internal API we don't allow freeing NULL */
3596 /* events as we do on the public API. */
3597 /***************************************************************************/
3598 assert(event != NULL);
3599 assert(event->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
3601 /***************************************************************************/
3602 /* Free all internal strings then the header itself. */
3603 /***************************************************************************/
3604 addl_info = dlist_pop_last(&event->additional_info);
3605 while (addl_info != NULL)
3607 EVEL_DEBUG("Freeing Additional Info (%s, %s)",
3610 free(addl_info->name);
3611 free(addl_info->value);
3613 addl_info = dlist_pop_last(&event->additional_info);
3618 cpu_use = dlist_pop_last(&event->cpu_usage);
3619 while (cpu_use != NULL)
3621 EVEL_DEBUG("Freeing CPU use Info (%s)", cpu_use->id);
3624 cpu_use = dlist_pop_last(&event->cpu_usage);
3626 disk_use = dlist_pop_last(&event->disk_usage);
3627 while (disk_use != NULL)
3629 EVEL_DEBUG("Freeing Disk use Info (%s)", disk_use->id);
3632 disk_use = dlist_pop_last(&event->disk_usage);
3634 mem_use = dlist_pop_last(&event->mem_usage);
3635 while (mem_use != NULL)
3637 EVEL_DEBUG("Freeing Memory use Info (%s)", mem_use->id);
3639 free(mem_use->vmid);
3641 mem_use = dlist_pop_last(&event->mem_usage);
3644 fsys_use = dlist_pop_last(&event->filesystem_usage);
3645 while (fsys_use != NULL)
3647 EVEL_DEBUG("Freeing Filesystem Use info (%s)", fsys_use->filesystem_name);
3648 free(fsys_use->filesystem_name);
3650 fsys_use = dlist_pop_last(&event->filesystem_usage);
3653 bucket = dlist_pop_last(&event->latency_distribution);
3654 while (bucket != NULL)
3656 EVEL_DEBUG("Freeing Latency Bucket");
3658 bucket = dlist_pop_last(&event->latency_distribution);
3661 vnic_performance = dlist_pop_last(&event->vnic_usage);
3662 while (vnic_performance != NULL)
3664 EVEL_DEBUG("Freeing vNIC performance Info (%s)", vnic_performance->vnic_id);
3665 evel_measurement_free_vnic_performance(vnic_performance);
3666 free(vnic_performance);
3667 vnic_performance = dlist_pop_last(&event->vnic_usage);
3670 codec_use = dlist_pop_last(&event->codec_usage);
3671 while (codec_use != NULL)
3673 EVEL_DEBUG("Freeing Codec use Info (%s)", codec_use->codec_id);
3674 free(codec_use->codec_id);
3676 codec_use = dlist_pop_last(&event->codec_usage);
3679 if (event->errors != NULL)
3681 EVEL_DEBUG("Freeing Errors");
3682 free(event->errors);
3685 feature_use = dlist_pop_last(&event->feature_usage);
3686 while (feature_use != NULL)
3688 EVEL_DEBUG("Freeing Feature use Info (%s)", feature_use->feature_id);
3689 free(feature_use->feature_id);
3691 feature_use = dlist_pop_last(&event->feature_usage);
3694 measurement_group = dlist_pop_last(&event->additional_measurements);
3695 while (measurement_group != NULL)
3697 EVEL_DEBUG("Freeing Measurement Group (%s)", measurement_group->name);
3699 measurement = dlist_pop_last(&measurement_group->measurements);
3700 while (measurement != NULL)
3702 EVEL_DEBUG("Freeing Measurement (%s)", measurement->name);
3703 free(measurement->name);
3704 free(measurement->value);
3706 measurement = dlist_pop_last(&measurement_group->measurements);
3708 free(measurement_group->name);
3709 free(measurement_group);
3710 measurement_group = dlist_pop_last(&event->additional_measurements);
3713 evel_free_header(&event->header);