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 average 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_mergewriteavg_set(MEASUREMENT_DISK_USE * const disk_use,
1000 evel_set_option_double(&disk_use->mergewriteavg, val, "Disk writeavg set");
1003 /**************************************************************************//**
1004 * Set number of logical write operations that were merged into physical read
1005 * operations, e.g., two logical writes were served by one physical disk access;
1006 * provide the maximum 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_mergewritemin_set(MEASUREMENT_DISK_USE * const disk_use,
1019 evel_set_option_double(&disk_use->mergewritemin, val, "Disk writemin set");
1023 /**************************************************************************//**
1024 * Set number of octets per second read from a disk or partition;
1025 * provide the average 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_octetsreadavg_set(MEASUREMENT_DISK_USE * const disk_use,
1038 evel_set_option_double(&disk_use->octetsreadavg, val, "Octets readavg set");
1042 /**************************************************************************//**
1043 * Set number of octets per second read from a disk or partition;
1044 * provide the last 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_octetsreadlast_set(MEASUREMENT_DISK_USE * const disk_use,
1057 evel_set_option_double(&disk_use->octetsreadlast, val, "Octets readlast set");
1061 /**************************************************************************//**
1062 * Set number of octets per second read from a disk or partition;
1063 * provide the maximum measurement within the measurement interval
1065 * @note The property is treated as immutable: it is only valid to call
1066 * the setter once. However, we don't assert if the caller tries to
1067 * overwrite, just ignoring the update instead.
1069 * @param disk_use Pointer to the Disk Use.
1071 *****************************************************************************/
1072 void evel_measurement_disk_use_octetsreadmax_set(MEASUREMENT_DISK_USE * const disk_use,
1076 evel_set_option_double(&disk_use->octetsreadmax, val, "Octets readmax set");
1079 /**************************************************************************//**
1080 * Set number of octets per second read from a disk or partition;
1081 * provide the minimum measurement within the measurement interval
1083 * @note The property is treated as immutable: it is only valid to call
1084 * the setter once. However, we don't assert if the caller tries to
1085 * overwrite, just ignoring the update instead.
1087 * @param disk_use Pointer to the Disk Use.
1089 *****************************************************************************/
1090 void evel_measurement_disk_use_octetsreadmin_set(MEASUREMENT_DISK_USE * const disk_use,
1094 evel_set_option_double(&disk_use->octetsreadmin, val, "Octets readmin set");
1097 /**************************************************************************//**
1098 * Set number of octets per second written to a disk or partition;
1099 * provide the average measurement within the measurement interval
1101 * @note The property is treated as immutable: it is only valid to call
1102 * the setter once. However, we don't assert if the caller tries to
1103 * overwrite, just ignoring the update instead.
1105 * @param disk_use Pointer to the Disk Use.
1107 *****************************************************************************/
1108 void evel_measurement_disk_use_octetswriteavg_set(MEASUREMENT_DISK_USE * const disk_use,
1112 evel_set_option_double(&disk_use->octetswriteavg, val, "Octets writeavg set");
1115 /**************************************************************************//**
1116 * Set number of octets per second written to a disk or partition;
1117 * provide the last measurement within the measurement interval
1119 * @note The property is treated as immutable: it is only valid to call
1120 * the setter once. However, we don't assert if the caller tries to
1121 * overwrite, just ignoring the update instead.
1123 * @param disk_use Pointer to the Disk Use.
1125 *****************************************************************************/
1126 void evel_measurement_disk_use_octetswritelast_set(MEASUREMENT_DISK_USE * const disk_use,
1130 evel_set_option_double(&disk_use->octetswritelast, val, "Octets writelast set");
1133 /**************************************************************************//**
1134 * Set number of octets per second written to a disk or partition;
1135 * provide the maximum measurement within the measurement interval
1137 * @note The property is treated as immutable: it is only valid to call
1138 * the setter once. However, we don't assert if the caller tries to
1139 * overwrite, just ignoring the update instead.
1141 * @param disk_use Pointer to the Disk Use.
1143 *****************************************************************************/
1144 void evel_measurement_disk_use_octetswritemax_set(MEASUREMENT_DISK_USE * const disk_use,
1148 evel_set_option_double(&disk_use->octetswritemax, val, "Octets writemax set");
1151 /**************************************************************************//**
1152 * Set number of octets per second written to a disk or partition;
1153 * provide the minimum 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_octetswritemin_set(MEASUREMENT_DISK_USE * const disk_use,
1166 evel_set_option_double(&disk_use->octetswritemin, val, "Octets writemin set");
1170 /**************************************************************************//**
1171 * Set number of read operations per second issued to the disk;
1172 * provide the average measurement within the measurement interval
1174 * @note The property is treated as immutable: it is only valid to call
1175 * the setter once. However, we don't assert if the caller tries to
1176 * overwrite, just ignoring the update instead.
1178 * @param disk_use Pointer to the Disk Use.
1180 *****************************************************************************/
1181 void evel_measurement_disk_use_opsreadavg_set(MEASUREMENT_DISK_USE * const disk_use,
1185 evel_set_option_double(&disk_use->opsreadavg, val, "Disk read operation average set");
1188 /**************************************************************************//**
1189 * Set number of read operations per second issued to the disk;
1190 * provide the last measurement within the measurement interval
1192 * @note The property is treated as immutable: it is only valid to call
1193 * the setter once. However, we don't assert if the caller tries to
1194 * overwrite, just ignoring the update instead.
1196 * @param disk_use Pointer to the Disk Use.
1198 *****************************************************************************/
1199 void evel_measurement_disk_use_opsreadlast_set(MEASUREMENT_DISK_USE * const disk_use,
1203 evel_set_option_double(&disk_use->opsreadlast, val, "Disk read operation last set");
1206 /**************************************************************************//**
1207 * Set number of read operations per second issued to the disk;
1208 * provide the maximum measurement within the measurement interval
1210 * @note The property is treated as immutable: it is only valid to call
1211 * the setter once. However, we don't assert if the caller tries to
1212 * overwrite, just ignoring the update instead.
1214 * @param disk_use Pointer to the Disk Use.
1216 *****************************************************************************/
1217 void evel_measurement_disk_use_opsreadmax_set(MEASUREMENT_DISK_USE * const disk_use,
1221 evel_set_option_double(&disk_use->opsreadmax, val, "Disk read operation maximum set");
1224 /**************************************************************************//**
1225 * Set number of read operations per second issued to the disk;
1226 * provide the minimum measurement within the measurement interval
1228 * @note The property is treated as immutable: it is only valid to call
1229 * the setter once. However, we don't assert if the caller tries to
1230 * overwrite, just ignoring the update instead.
1232 * @param disk_use Pointer to the Disk Use.
1234 *****************************************************************************/
1235 void evel_measurement_disk_use_opsreadmin_set(MEASUREMENT_DISK_USE * const disk_use,
1239 evel_set_option_double(&disk_use->opsreadmin, val, "Disk read operation minimum set");
1242 /**************************************************************************//**
1243 * Set number of write operations per second issued to the disk;
1244 * provide the average measurement within the measurement interval
1246 * @note The property is treated as immutable: it is only valid to call
1247 * the setter once. However, we don't assert if the caller tries to
1248 * overwrite, just ignoring the update instead.
1250 * @param disk_use Pointer to the Disk Use.
1252 *****************************************************************************/
1253 void evel_measurement_disk_use_opswriteavg_set(MEASUREMENT_DISK_USE * const disk_use,
1257 evel_set_option_double(&disk_use->opswriteavg, val, "Disk write operation average set");
1260 /**************************************************************************//**
1261 * Set number of write operations per second issued to the disk;
1262 * provide the last 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_opswritelast_set(MEASUREMENT_DISK_USE * const disk_use,
1275 evel_set_option_double(&disk_use->opswritelast, val, "Disk write operation last set");
1279 /**************************************************************************//**
1280 * Set number of write operations per second issued to the disk;
1281 * provide the maximum measurement within the measurement interval
1283 * @note The property is treated as immutable: it is only valid to call
1284 * the setter once. However, we don't assert if the caller tries to
1285 * overwrite, just ignoring the update instead.
1287 * @param disk_use Pointer to the Disk Use.
1289 *****************************************************************************/
1290 void evel_measurement_disk_use_opswritemax_set(MEASUREMENT_DISK_USE * const disk_use,
1294 evel_set_option_double(&disk_use->opswritemax, val, "Disk write operation maximum set");
1297 /**************************************************************************//**
1298 * Set number of write operations per second issued to the disk;
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_opswritemin_set(MEASUREMENT_DISK_USE * const disk_use,
1312 evel_set_option_double(&disk_use->opswritemin, val, "Disk write operation minimum set");
1316 /**************************************************************************//**
1317 * Set queue size of pending I/O operations per second;
1318 * provide the average measurement within the measurement interval
1320 * @note The property is treated as immutable: it is only valid to call
1321 * the setter once. However, we don't assert if the caller tries to
1322 * overwrite, just ignoring the update instead.
1324 * @param disk_use Pointer to the Disk Use.
1326 *****************************************************************************/
1327 void evel_measurement_disk_use_pendingopsavg_set(MEASUREMENT_DISK_USE * const disk_use,
1331 evel_set_option_double(&disk_use->pendingopsavg, val, "Disk pending operation average set");
1334 /**************************************************************************//**
1335 * Set queue size of pending I/O operations per second;
1336 * provide the last measurement within the measurement interval
1338 * @note The property is treated as immutable: it is only valid to call
1339 * the setter once. However, we don't assert if the caller tries to
1340 * overwrite, just ignoring the update instead.
1342 * @param disk_use Pointer to the Disk Use.
1344 *****************************************************************************/
1345 void evel_measurement_disk_use_pendingopslast_set(MEASUREMENT_DISK_USE * const disk_use,
1349 evel_set_option_double(&disk_use->pendingopslast, val, "Disk pending operation last set");
1352 /**************************************************************************//**
1353 * Set queue size of pending I/O operations per second;
1354 * provide the maximum measurement within the measurement interval
1356 * @note The property is treated as immutable: it is only valid to call
1357 * the setter once. However, we don't assert if the caller tries to
1358 * overwrite, just ignoring the update instead.
1360 * @param disk_use Pointer to the Disk Use.
1362 *****************************************************************************/
1363 void evel_measurement_disk_use_pendingopsmax_set(MEASUREMENT_DISK_USE * const disk_use,
1367 evel_set_option_double(&disk_use->pendingopsmax, val, "Disk pending operation maximum set");
1370 /**************************************************************************//**
1371 * Set queue size of pending I/O operations per second;
1372 * provide the minimum 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_pendingopsmin_set(MEASUREMENT_DISK_USE * const disk_use,
1385 evel_set_option_double(&disk_use->pendingopsmin, val, "Disk pending operation min set");
1389 /**************************************************************************//**
1390 * Set milliseconds a read operation took to complete;
1391 * provide the average measurement within the measurement interval
1393 * @note The property is treated as immutable: it is only valid to call
1394 * the setter once. However, we don't assert if the caller tries to
1395 * overwrite, just ignoring the update instead.
1397 * @param disk_use Pointer to the Disk Use.
1399 *****************************************************************************/
1400 void evel_measurement_disk_use_timereadavg_set(MEASUREMENT_DISK_USE * const disk_use,
1404 evel_set_option_double(&disk_use->timereadavg, val, "Disk read time average set");
1407 /**************************************************************************//**
1408 * Set milliseconds a read operation took to complete;
1409 * provide the last measurement within the measurement interval
1411 * @note The property is treated as immutable: it is only valid to call
1412 * the setter once. However, we don't assert if the caller tries to
1413 * overwrite, just ignoring the update instead.
1415 * @param disk_use Pointer to the Disk Use.
1417 *****************************************************************************/
1418 void evel_measurement_disk_use_timereadlast_set(MEASUREMENT_DISK_USE * const disk_use,
1422 evel_set_option_double(&disk_use->timereadlast, val, "Disk read time last set");
1425 /**************************************************************************//**
1426 * Set milliseconds a read operation took to complete;
1427 * provide the maximum measurement within the measurement interval
1429 * @note The property is treated as immutable: it is only valid to call
1430 * the setter once. However, we don't assert if the caller tries to
1431 * overwrite, just ignoring the update instead.
1433 * @param disk_use Pointer to the Disk Use.
1435 *****************************************************************************/
1436 void evel_measurement_disk_use_timereadmax_set(MEASUREMENT_DISK_USE * const disk_use,
1440 evel_set_option_double(&disk_use->timereadmax, val, "Disk read time maximum set");
1443 /**************************************************************************//**
1444 * Set milliseconds a read operation took to complete;
1445 * provide the minimum measurement within the measurement interval
1447 * @note The property is treated as immutable: it is only valid to call
1448 * the setter once. However, we don't assert if the caller tries to
1449 * overwrite, just ignoring the update instead.
1451 * @param disk_use Pointer to the Disk Use.
1453 *****************************************************************************/
1454 void evel_measurement_disk_use_timereadmin_set(MEASUREMENT_DISK_USE * const disk_use,
1458 evel_set_option_double(&disk_use->timereadmin, val, "Disk read time minimum set");
1461 /**************************************************************************//**
1462 * Set milliseconds a write operation took to complete;
1463 * provide the average 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_timewriteavg_set(MEASUREMENT_DISK_USE * const disk_use,
1476 evel_set_option_double(&disk_use->timewriteavg, val, "Disk write time average set");
1480 /**************************************************************************//**
1481 * Set milliseconds a write operation took to complete;
1482 * provide the last measurement within the measurement interval
1484 * @note The property is treated as immutable: it is only valid to call
1485 * the setter once. However, we don't assert if the caller tries to
1486 * overwrite, just ignoring the update instead.
1488 * @param disk_use Pointer to the Disk Use.
1490 *****************************************************************************/
1491 void evel_measurement_disk_use_timewritelast_set(MEASUREMENT_DISK_USE * const disk_use,
1495 evel_set_option_double(&disk_use->timewritelast, val, "Disk write time last set");
1498 /**************************************************************************//**
1499 * Set milliseconds a write operation took to complete;
1500 * provide the maximum measurement within the measurement interval
1502 * @note The property is treated as immutable: it is only valid to call
1503 * the setter once. However, we don't assert if the caller tries to
1504 * overwrite, just ignoring the update instead.
1506 * @param disk_use Pointer to the Disk Use.
1508 *****************************************************************************/
1509 void evel_measurement_disk_use_timewritemax_set(MEASUREMENT_DISK_USE * const disk_use,
1513 evel_set_option_double(&disk_use->timewritemax, val, "Disk write time max set");
1516 /**************************************************************************//**
1517 * Set milliseconds a write operation took to complete;
1518 * provide the average measurement within the measurement interval
1520 * @note The property is treated as immutable: it is only valid to call
1521 * the setter once. However, we don't assert if the caller tries to
1522 * overwrite, just ignoring the update instead.
1524 * @param disk_use Pointer to the Disk Use.
1526 *****************************************************************************/
1527 void evel_measurement_disk_use_timewritemin_set(MEASUREMENT_DISK_USE * const disk_use,
1531 evel_set_option_double(&disk_use->timewritemin, val, "Disk write time min set");
1535 /**************************************************************************//**
1536 * Add an additional File System usage value name/value pair to the
1539 * The filesystem_name is null delimited ASCII string. The library takes a
1540 * copy so the caller does not have to preserve values after the function
1543 * @param measurement Pointer to the measurement.
1544 * @param filesystem_name ASCIIZ string with the file-system's UUID.
1545 * @param block_configured Block storage configured.
1546 * @param block_used Block storage in use.
1547 * @param block_iops Block storage IOPS.
1548 * @param ephemeral_configured Ephemeral storage configured.
1549 * @param ephemeral_used Ephemeral storage in use.
1550 * @param ephemeral_iops Ephemeral storage IOPS.
1551 *****************************************************************************/
1552 void evel_measurement_fsys_use_add(EVENT_MEASUREMENT * measurement,
1553 char * filesystem_name,
1554 double block_configured,
1557 double ephemeral_configured,
1558 double ephemeral_used,
1559 double ephemeral_iops)
1561 MEASUREMENT_FSYS_USE * fsys_use = NULL;
1564 /***************************************************************************/
1565 /* Check assumptions. */
1566 /***************************************************************************/
1567 assert(measurement != NULL);
1568 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1569 assert(filesystem_name != NULL);
1570 assert(block_configured >= 0.0);
1571 assert(block_used >= 0.0);
1572 assert(block_iops >= 0.0);
1573 assert(ephemeral_configured >= 0.0);
1574 assert(ephemeral_used >= 0.0);
1575 assert(ephemeral_iops >= 0.0);
1577 /***************************************************************************/
1578 /* Allocate a container for the value and push onto the list. */
1579 /***************************************************************************/
1580 EVEL_DEBUG("Adding filesystem_name=%s", filesystem_name);
1581 fsys_use = malloc(sizeof(MEASUREMENT_FSYS_USE));
1582 assert(fsys_use != NULL);
1583 memset(fsys_use, 0, sizeof(MEASUREMENT_FSYS_USE));
1584 fsys_use->filesystem_name = strdup(filesystem_name);
1585 fsys_use->block_configured = block_configured;
1586 fsys_use->block_used = block_used;
1587 fsys_use->block_iops = block_iops;
1588 fsys_use->ephemeral_configured = ephemeral_configured;
1589 fsys_use->ephemeral_used = ephemeral_used;
1590 fsys_use->ephemeral_iops = ephemeral_iops;
1592 dlist_push_last(&measurement->filesystem_usage, fsys_use);
1597 /**************************************************************************//**
1598 * Add a Feature usage value name/value pair to the Measurement.
1600 * The name is null delimited ASCII string. The library takes
1601 * a copy so the caller does not have to preserve values after the function
1604 * @param measurement Pointer to the measurement.
1605 * @param feature ASCIIZ string with the feature's name.
1606 * @param utilization Utilization of the feature.
1607 *****************************************************************************/
1608 void evel_measurement_feature_use_add(EVENT_MEASUREMENT * measurement,
1612 MEASUREMENT_FEATURE_USE * feature_use = NULL;
1615 /***************************************************************************/
1616 /* Check assumptions. */
1617 /***************************************************************************/
1618 assert(measurement != NULL);
1619 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1620 assert(feature != NULL);
1621 assert(utilization >= 0);
1623 /***************************************************************************/
1624 /* Allocate a container for the value and push onto the list. */
1625 /***************************************************************************/
1626 EVEL_DEBUG("Adding Feature=%s Use=%d", feature, utilization);
1627 feature_use = malloc(sizeof(MEASUREMENT_FEATURE_USE));
1628 assert(feature_use != NULL);
1629 memset(feature_use, 0, sizeof(MEASUREMENT_FEATURE_USE));
1630 feature_use->feature_id = strdup(feature);
1631 assert(feature_use->feature_id != NULL);
1632 feature_use->feature_utilization = utilization;
1634 dlist_push_last(&measurement->feature_usage, feature_use);
1639 /**************************************************************************//**
1640 * Add a Additional Measurement value name/value pair to the Report.
1642 * The name is null delimited ASCII string. The library takes
1643 * a copy so the caller does not have to preserve values after the function
1646 * @param measurement Pointer to the Measaurement.
1647 * @param group ASCIIZ string with the measurement group's name.
1648 * @param name ASCIIZ string containing the measurement's name.
1649 * @param value ASCIIZ string containing the measurement's value.
1650 *****************************************************************************/
1651 void evel_measurement_custom_measurement_add(EVENT_MEASUREMENT * measurement,
1652 const char * const group,
1653 const char * const name,
1654 const char * const value)
1656 MEASUREMENT_GROUP * measurement_group = NULL;
1657 CUSTOM_MEASUREMENT * custom_measurement = NULL;
1658 DLIST_ITEM * item = NULL;
1661 /***************************************************************************/
1662 /* Check assumptions. */
1663 /***************************************************************************/
1664 assert(measurement != NULL);
1665 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1666 assert(group != NULL);
1667 assert(name != NULL);
1668 assert(value != NULL);
1670 /***************************************************************************/
1671 /* Allocate a container for the name/value pair. */
1672 /***************************************************************************/
1673 EVEL_DEBUG("Adding Measurement Group=%s Name=%s Value=%s",
1674 group, name, value);
1675 custom_measurement = malloc(sizeof(CUSTOM_MEASUREMENT));
1676 assert(custom_measurement != NULL);
1677 memset(custom_measurement, 0, sizeof(CUSTOM_MEASUREMENT));
1678 custom_measurement->name = strdup(name);
1679 assert(custom_measurement->name != NULL);
1680 custom_measurement->value = strdup(value);
1681 assert(custom_measurement->value != NULL);
1683 /***************************************************************************/
1684 /* See if we have that group already. */
1685 /***************************************************************************/
1686 item = dlist_get_first(&measurement->additional_measurements);
1687 while (item != NULL)
1689 measurement_group = (MEASUREMENT_GROUP *) item->item;
1690 assert(measurement_group != NULL);
1692 EVEL_DEBUG("Got measurement group %s", measurement_group->name);
1693 if (strcmp(group, measurement_group->name) == 0)
1695 EVEL_DEBUG("Found existing Measurement Group");
1698 item = dlist_get_next(item);
1701 /***************************************************************************/
1702 /* If we didn't have the group already, create it. */
1703 /***************************************************************************/
1706 EVEL_DEBUG("Creating new Measurement Group");
1707 measurement_group = malloc(sizeof(MEASUREMENT_GROUP));
1708 assert(measurement_group != NULL);
1709 memset(measurement_group, 0, sizeof(MEASUREMENT_GROUP));
1710 measurement_group->name = strdup(group);
1711 assert(measurement_group->name != NULL);
1712 dlist_initialize(&measurement_group->measurements);
1713 dlist_push_last(&measurement->additional_measurements, measurement_group);
1716 /***************************************************************************/
1717 /* If we didn't have the group already, create it. */
1718 /***************************************************************************/
1719 dlist_push_last(&measurement_group->measurements, custom_measurement);
1724 /**************************************************************************//**
1725 * Add a Codec usage value name/value pair to the Measurement.
1727 * The name is null delimited ASCII string. The library takes
1728 * a copy so the caller does not have to preserve values after the function
1731 * @param measurement Pointer to the measurement.
1732 * @param codec ASCIIZ string with the codec's name.
1733 * @param utilization Number of codecs in use.
1734 *****************************************************************************/
1735 void evel_measurement_codec_use_add(EVENT_MEASUREMENT * measurement,
1739 MEASUREMENT_CODEC_USE * codec_use = NULL;
1742 /***************************************************************************/
1743 /* Check assumptions. */
1744 /***************************************************************************/
1745 assert(measurement != NULL);
1746 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1747 assert(codec != NULL);
1748 assert(utilization >= 0.0);
1750 /***************************************************************************/
1751 /* Allocate a container for the value and push onto the list. */
1752 /***************************************************************************/
1753 EVEL_DEBUG("Adding Codec=%s Use=%d", codec, utilization);
1754 codec_use = malloc(sizeof(MEASUREMENT_CODEC_USE));
1755 assert(codec_use != NULL);
1756 memset(codec_use, 0, sizeof(MEASUREMENT_CODEC_USE));
1757 codec_use->codec_id = strdup(codec);
1758 assert(codec_use->codec_id != NULL);
1759 codec_use->number_in_use = utilization;
1761 dlist_push_last(&measurement->codec_usage, codec_use);
1767 /**************************************************************************//**
1768 * Set the Media Ports in Use property of the Measurement.
1770 * @note The property is treated as immutable: it is only valid to call
1771 * the setter once. However, we don't assert if the caller tries to
1772 * overwrite, just ignoring the update instead.
1774 * @param measurement Pointer to the measurement.
1775 * @param media_ports_in_use The media port usage to set.
1776 *****************************************************************************/
1777 void evel_measurement_media_port_use_set(EVENT_MEASUREMENT * measurement,
1778 int media_ports_in_use)
1782 /***************************************************************************/
1783 /* Check preconditions. */
1784 /***************************************************************************/
1785 assert(measurement != NULL);
1786 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1787 assert(media_ports_in_use >= 0);
1789 evel_set_option_int(&measurement->media_ports_in_use,
1791 "Media Ports In Use");
1795 /**************************************************************************//**
1796 * Set the VNFC Scaling Metric property of the Measurement.
1798 * @note The property is treated as immutable: it is only valid to call
1799 * the setter once. However, we don't assert if the caller tries to
1800 * overwrite, just ignoring the update instead.
1802 * @param measurement Pointer to the measurement.
1803 * @param scaling_metric The scaling metric to set.
1804 *****************************************************************************/
1805 void evel_measurement_vnfc_scaling_metric_set(EVENT_MEASUREMENT * measurement,
1810 /***************************************************************************/
1811 /* Check preconditions. */
1812 /***************************************************************************/
1813 assert(measurement != NULL);
1814 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1815 assert(scaling_metric >= 0.0);
1817 evel_set_option_int(&measurement->vnfc_scaling_metric,
1819 "VNFC Scaling Metric");
1823 /**************************************************************************//**
1824 * Create a new Latency Bucket to be added to a Measurement event.
1826 * @note The mandatory fields on the ::MEASUREMENT_LATENCY_BUCKET must be
1827 * supplied to this factory function and are immutable once set.
1828 * Optional fields have explicit setter functions, but again values
1829 * may only be set once so that the ::MEASUREMENT_LATENCY_BUCKET has
1830 * immutable properties.
1832 * @param count Count of events in this bucket.
1834 * @returns pointer to the newly manufactured ::MEASUREMENT_LATENCY_BUCKET.
1835 * If the structure is not used it must be released using free.
1836 * @retval NULL Failed to create the Latency Bucket.
1837 *****************************************************************************/
1838 MEASUREMENT_LATENCY_BUCKET * evel_new_meas_latency_bucket(const int count)
1840 MEASUREMENT_LATENCY_BUCKET * bucket;
1844 /***************************************************************************/
1845 /* Check preconditions. */
1846 /***************************************************************************/
1849 /***************************************************************************/
1850 /* Allocate, then set Mandatory Parameters. */
1851 /***************************************************************************/
1852 EVEL_DEBUG("Creating bucket, count = %d", count);
1853 bucket = malloc(sizeof(MEASUREMENT_LATENCY_BUCKET));
1854 assert(bucket != NULL);
1856 /***************************************************************************/
1857 /* Set Mandatory Parameters. */
1858 /***************************************************************************/
1859 bucket->count = count;
1861 /***************************************************************************/
1862 /* Initialize Optional Parameters. */
1863 /***************************************************************************/
1864 evel_init_option_double(&bucket->high_end);
1865 evel_init_option_double(&bucket->low_end);
1872 /**************************************************************************//**
1873 * Set the High End property of the Measurement Latency Bucket.
1875 * @note The property is treated as immutable: it is only valid to call
1876 * the setter once. However, we don't assert if the caller tries to
1877 * overwrite, just ignoring the update instead.
1879 * @param bucket Pointer to the Measurement Latency Bucket.
1880 * @param high_end High end of the bucket's range.
1881 *****************************************************************************/
1882 void evel_meas_latency_bucket_high_end_set(
1883 MEASUREMENT_LATENCY_BUCKET * const bucket,
1884 const double high_end)
1888 /***************************************************************************/
1889 /* Check preconditions. */
1890 /***************************************************************************/
1891 assert(high_end >= 0.0);
1892 evel_set_option_double(&bucket->high_end, high_end, "High End");
1897 /**************************************************************************//**
1898 * Set the Low End property of the Measurement Latency Bucket.
1900 * @note The property is treated as immutable: it is only valid to call
1901 * the setter once. However, we don't assert if the caller tries to
1902 * overwrite, just ignoring the update instead.
1904 * @param bucket Pointer to the Measurement Latency Bucket.
1905 * @param low_end Low end of the bucket's range.
1906 *****************************************************************************/
1907 void evel_meas_latency_bucket_low_end_set(
1908 MEASUREMENT_LATENCY_BUCKET * const bucket,
1909 const double low_end)
1913 /***************************************************************************/
1914 /* Check preconditions. */
1915 /***************************************************************************/
1916 assert(low_end >= 0.0);
1917 evel_set_option_double(&bucket->low_end, low_end, "Low End");
1921 /**************************************************************************//**
1922 * Add an additional Measurement Latency Bucket to the specified event.
1924 * @param measurement Pointer to the Measurement event.
1925 * @param bucket Pointer to the Measurement Latency Bucket to add.
1926 *****************************************************************************/
1927 void evel_meas_latency_bucket_add(EVENT_MEASUREMENT * const measurement,
1928 MEASUREMENT_LATENCY_BUCKET * const bucket)
1932 /***************************************************************************/
1933 /* Check preconditions. */
1934 /***************************************************************************/
1935 assert(measurement != NULL);
1936 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
1937 assert(bucket != NULL);
1938 dlist_push_last(&measurement->latency_distribution, bucket);
1943 /**************************************************************************//**
1944 * Add an additional Latency Distribution bucket to the Measurement.
1946 * This function implements the previous API, purely for convenience.
1948 * @param measurement Pointer to the measurement.
1949 * @param low_end Low end of the bucket's range.
1950 * @param high_end High end of the bucket's range.
1951 * @param count Count of events in this bucket.
1952 *****************************************************************************/
1953 void evel_measurement_latency_add(EVENT_MEASUREMENT * const measurement,
1954 const double low_end,
1955 const double high_end,
1958 MEASUREMENT_LATENCY_BUCKET * bucket = NULL;
1962 /***************************************************************************/
1963 /* Trust the assertions in the underlying methods. */
1964 /***************************************************************************/
1965 bucket = evel_new_meas_latency_bucket(count);
1966 evel_meas_latency_bucket_low_end_set(bucket, low_end);
1967 evel_meas_latency_bucket_high_end_set(bucket, high_end);
1968 evel_meas_latency_bucket_add(measurement, bucket);
1973 /**************************************************************************//**
1974 * Create a new vNIC Use to be added to a Measurement event.
1976 * @note The mandatory fields on the ::MEASUREMENT_VNIC_PERFORMANCE must be supplied
1977 * to this factory function and are immutable once set. Optional
1978 * fields have explicit setter functions, but again values may only be
1979 * set once so that the ::MEASUREMENT_VNIC_PERFORMANCE has immutable
1982 * @param vnic_id ASCIIZ string with the vNIC's ID.
1983 * @param val_suspect True or false confidence in data.
1985 * @returns pointer to the newly manufactured ::MEASUREMENT_VNIC_PERFORMANCE.
1986 * If the structure is not used it must be released using
1987 * ::evel_measurement_free_vnic_performance.
1988 * @retval NULL Failed to create the vNIC Use.
1989 *****************************************************************************/
1990 MEASUREMENT_VNIC_PERFORMANCE * evel_measurement_new_vnic_performance(char * const vnic_id,
1991 char * const val_suspect)
1993 MEASUREMENT_VNIC_PERFORMANCE * vnic_performance;
1997 /***************************************************************************/
1998 /* Check preconditions. */
1999 /***************************************************************************/
2000 assert(vnic_id != NULL);
2001 assert(!strcmp(val_suspect,"true") || !strcmp(val_suspect,"false"));
2003 /***************************************************************************/
2004 /* Allocate, then set Mandatory Parameters. */
2005 /***************************************************************************/
2006 EVEL_DEBUG("Adding VNIC ID=%s", vnic_id);
2007 vnic_performance = malloc(sizeof(MEASUREMENT_VNIC_PERFORMANCE));
2008 assert(vnic_performance != NULL);
2009 vnic_performance->vnic_id = strdup(vnic_id);
2010 vnic_performance->valuesaresuspect = strdup(val_suspect);
2012 /***************************************************************************/
2013 /* Initialize Optional Parameters. */
2014 /***************************************************************************/
2015 evel_init_option_double(&vnic_performance-> recvd_bcast_packets_acc);
2016 evel_init_option_double(&vnic_performance-> recvd_bcast_packets_delta);
2017 evel_init_option_double(&vnic_performance-> recvd_discarded_packets_acc);
2018 evel_init_option_double(&vnic_performance-> recvd_discarded_packets_delta);
2019 evel_init_option_double(&vnic_performance-> recvd_error_packets_acc);
2020 evel_init_option_double(&vnic_performance-> recvd_error_packets_delta);
2021 evel_init_option_double(&vnic_performance-> recvd_mcast_packets_acc);
2022 evel_init_option_double(&vnic_performance-> recvd_mcast_packets_delta);
2023 evel_init_option_double(&vnic_performance-> recvd_octets_acc);
2024 evel_init_option_double(&vnic_performance-> recvd_octets_delta);
2025 evel_init_option_double(&vnic_performance-> recvd_total_packets_acc);
2026 evel_init_option_double(&vnic_performance-> recvd_total_packets_delta);
2027 evel_init_option_double(&vnic_performance-> recvd_ucast_packets_acc);
2028 evel_init_option_double(&vnic_performance-> recvd_ucast_packets_delta);
2029 evel_init_option_double(&vnic_performance-> tx_bcast_packets_acc);
2030 evel_init_option_double(&vnic_performance-> tx_bcast_packets_delta);
2031 evel_init_option_double(&vnic_performance-> tx_discarded_packets_acc);
2032 evel_init_option_double(&vnic_performance-> tx_discarded_packets_delta);
2033 evel_init_option_double(&vnic_performance-> tx_error_packets_acc);
2034 evel_init_option_double(&vnic_performance-> tx_error_packets_delta);
2035 evel_init_option_double(&vnic_performance-> tx_mcast_packets_acc);
2036 evel_init_option_double(&vnic_performance-> tx_mcast_packets_delta);
2037 evel_init_option_double(&vnic_performance-> tx_octets_acc);
2038 evel_init_option_double(&vnic_performance-> tx_octets_delta);
2039 evel_init_option_double(&vnic_performance-> tx_total_packets_acc);
2040 evel_init_option_double(&vnic_performance-> tx_total_packets_delta);
2041 evel_init_option_double(&vnic_performance-> tx_ucast_packets_acc);
2042 evel_init_option_double(&vnic_performance-> tx_ucast_packets_delta);
2046 return vnic_performance;
2049 /**************************************************************************//**
2052 * Free off the ::MEASUREMENT_VNIC_PERFORMANCE supplied. Will free all the contained
2055 * @note It does not free the vNIC Use itself, since that may be part of a
2057 *****************************************************************************/
2058 void evel_measurement_free_vnic_performance(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance)
2062 /***************************************************************************/
2063 /* Check preconditions. */
2064 /***************************************************************************/
2065 assert(vnic_performance != NULL);
2066 assert(vnic_performance->vnic_id != NULL);
2067 assert(vnic_performance->valuesaresuspect != NULL);
2069 /***************************************************************************/
2070 /* Free the duplicated string. */
2071 /***************************************************************************/
2072 free(vnic_performance->vnic_id);
2073 free(vnic_performance->valuesaresuspect);
2074 vnic_performance->vnic_id = NULL;
2079 /**************************************************************************//**
2080 * Set the Accumulated Broadcast Packets Received in measurement interval
2081 * property of the vNIC performance.
2083 * @note The property is treated as immutable: it is only valid to call
2084 * the setter once. However, we don't assert if the caller tries to
2085 * overwrite, just ignoring the update instead.
2087 * @param vnic_performance Pointer to the vNIC Use.
2088 * @param recvd_bcast_packets_acc
2089 *****************************************************************************/
2090 void evel_vnic_performance_rx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2091 const double recvd_bcast_packets_acc)
2095 /***************************************************************************/
2096 /* Check preconditions. */
2097 /***************************************************************************/
2098 assert(recvd_bcast_packets_acc >= 0.0);
2100 evel_set_option_double(&vnic_performance->recvd_bcast_packets_acc,
2101 recvd_bcast_packets_acc,
2102 "Broadcast Packets accumulated");
2107 /**************************************************************************//**
2108 * Set the Delta Broadcast Packets Received in measurement interval
2109 * property of the vNIC performance.
2111 * @note The property is treated as immutable: it is only valid to call
2112 * the setter once. However, we don't assert if the caller tries to
2113 * overwrite, just ignoring the update instead.
2115 * @param vnic_performance Pointer to the vNIC Use.
2116 * @param recvd_bcast_packets_delta
2117 *****************************************************************************/
2118 void evel_vnic_performance_rx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2119 const double recvd_bcast_packets_delta)
2123 /***************************************************************************/
2124 /* Check preconditions. */
2125 /***************************************************************************/
2126 assert(recvd_bcast_packets_delta >= 0.0);
2128 evel_set_option_double(&vnic_performance->recvd_bcast_packets_delta,
2129 recvd_bcast_packets_delta,
2130 "Delta Broadcast Packets recieved");
2136 /**************************************************************************//**
2137 * Set the Discarded Packets Received in measurement interval
2138 * property of the vNIC performance.
2140 * @note The property is treated as immutable: it is only valid to call
2141 * the setter once. However, we don't assert if the caller tries to
2142 * overwrite, just ignoring the update instead.
2144 * @param vnic_performance Pointer to the vNIC Use.
2145 * @param recvd_discard_packets_acc
2146 *****************************************************************************/
2147 void evel_vnic_performance_rx_discard_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2148 const double recvd_discard_packets_acc)
2152 /***************************************************************************/
2153 /* Check preconditions. */
2154 /***************************************************************************/
2155 assert(recvd_discard_packets_acc >= 0.0);
2157 evel_set_option_double(&vnic_performance->recvd_discarded_packets_acc,
2158 recvd_discard_packets_acc,
2159 "Discarded Packets accumulated");
2164 /**************************************************************************//**
2165 * Set the Delta Discarded Packets Received in measurement interval
2166 * property of the vNIC performance.
2168 * @note The property is treated as immutable: it is only valid to call
2169 * the setter once. However, we don't assert if the caller tries to
2170 * overwrite, just ignoring the update instead.
2172 * @param vnic_performance Pointer to the vNIC Use.
2173 * @param recvd_discard_packets_delta
2174 *****************************************************************************/
2175 void evel_vnic_performance_rx_discard_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2176 const double recvd_discard_packets_delta)
2180 /***************************************************************************/
2181 /* Check preconditions. */
2182 /***************************************************************************/
2183 assert(recvd_discard_packets_delta >= 0.0);
2185 evel_set_option_double(&vnic_performance->recvd_discarded_packets_delta,
2186 recvd_discard_packets_delta,
2187 "Delta Discarded Packets recieved");
2193 /**************************************************************************//**
2194 * Set the Error Packets Received in measurement interval
2195 * property of the vNIC performance.
2197 * @note The property is treated as immutable: it is only valid to call
2198 * the setter once. However, we don't assert if the caller tries to
2199 * overwrite, just ignoring the update instead.
2201 * @param vnic_performance Pointer to the vNIC Use.
2202 * @param recvd_error_packets_acc
2203 *****************************************************************************/
2204 void evel_vnic_performance_rx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2205 const double recvd_error_packets_acc)
2209 /***************************************************************************/
2210 /* Check preconditions. */
2211 /***************************************************************************/
2212 assert(recvd_error_packets_acc >= 0.0);
2214 evel_set_option_double(&vnic_performance->recvd_error_packets_acc,
2215 recvd_error_packets_acc,
2216 "Error Packets received accumulated");
2221 /**************************************************************************//**
2222 * Set the Delta Error Packets Received in measurement interval
2223 * property of the vNIC performance.
2225 * @note The property is treated as immutable: it is only valid to call
2226 * the setter once. However, we don't assert if the caller tries to
2227 * overwrite, just ignoring the update instead.
2229 * @param vnic_performance Pointer to the vNIC Use.
2230 * @param recvd_error_packets_delta
2231 *****************************************************************************/
2232 void evel_vnic_performance_rx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2233 const double recvd_error_packets_delta)
2237 /***************************************************************************/
2238 /* Check preconditions. */
2239 /***************************************************************************/
2240 assert(recvd_error_packets_delta >= 0.0);
2242 evel_set_option_double(&vnic_performance->recvd_error_packets_delta,
2243 recvd_error_packets_delta,
2244 "Delta Error Packets recieved");
2249 /**************************************************************************//**
2250 * Set the Accumulated Multicast Packets Received in measurement interval
2251 * property of the vNIC performance.
2253 * @note The property is treated as immutable: it is only valid to call
2254 * the setter once. However, we don't assert if the caller tries to
2255 * overwrite, just ignoring the update instead.
2257 * @param vnic_performance Pointer to the vNIC Use.
2258 * @param recvd_mcast_packets_acc
2259 *****************************************************************************/
2260 void evel_vnic_performance_rx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2261 const double recvd_mcast_packets_acc)
2265 /***************************************************************************/
2266 /* Check preconditions. */
2267 /***************************************************************************/
2268 assert(recvd_mcast_packets_acc >= 0.0);
2270 evel_set_option_double(&vnic_performance->recvd_mcast_packets_acc,
2271 recvd_mcast_packets_acc,
2272 "Multicast Packets accumulated");
2277 /**************************************************************************//**
2278 * Set the Delta Multicast Packets Received in measurement interval
2279 * property of the vNIC performance.
2281 * @note The property is treated as immutable: it is only valid to call
2282 * the setter once. However, we don't assert if the caller tries to
2283 * overwrite, just ignoring the update instead.
2285 * @param vnic_performance Pointer to the vNIC Use.
2286 * @param recvd_mcast_packets_delta
2287 *****************************************************************************/
2288 void evel_vnic_performance_rx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2289 const double recvd_mcast_packets_delta)
2293 /***************************************************************************/
2294 /* Check preconditions. */
2295 /***************************************************************************/
2296 assert(recvd_mcast_packets_delta >= 0.0);
2298 evel_set_option_double(&vnic_performance->recvd_mcast_packets_delta,
2299 recvd_mcast_packets_delta,
2300 "Delta Multicast Packets recieved");
2305 /**************************************************************************//**
2306 * Set the Accumulated Octets Received in measurement interval
2307 * property of the vNIC performance.
2309 * @note The property is treated as immutable: it is only valid to call
2310 * the setter once. However, we don't assert if the caller tries to
2311 * overwrite, just ignoring the update instead.
2313 * @param vnic_performance Pointer to the vNIC Use.
2314 * @param recvd_octets_acc
2315 *****************************************************************************/
2316 void evel_vnic_performance_rx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2317 const double recvd_octets_acc)
2321 /***************************************************************************/
2322 /* Check preconditions. */
2323 /***************************************************************************/
2324 assert(recvd_octets_acc >= 0.0);
2326 evel_set_option_double(&vnic_performance->recvd_octets_acc,
2328 "Octets received accumulated");
2333 /**************************************************************************//**
2334 * Set the Delta Octets Received in measurement interval
2335 * property of the vNIC performance.
2337 * @note The property is treated as immutable: it is only valid to call
2338 * the setter once. However, we don't assert if the caller tries to
2339 * overwrite, just ignoring the update instead.
2341 * @param vnic_performance Pointer to the vNIC Use.
2342 * @param recvd_octets_delta
2343 *****************************************************************************/
2344 void evel_vnic_performance_rx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2345 const double recvd_octets_delta)
2349 /***************************************************************************/
2350 /* Check preconditions. */
2351 /***************************************************************************/
2352 assert(recvd_octets_delta >= 0.0);
2354 evel_set_option_double(&vnic_performance->recvd_octets_delta,
2356 "Delta Octets recieved");
2361 /**************************************************************************//**
2362 * Set the Accumulated Total Packets Received in measurement interval
2363 * property of the vNIC performance.
2365 * @note The property is treated as immutable: it is only valid to call
2366 * the setter once. However, we don't assert if the caller tries to
2367 * overwrite, just ignoring the update instead.
2369 * @param vnic_performance Pointer to the vNIC Use.
2370 * @param recvd_total_packets_acc
2371 *****************************************************************************/
2372 void evel_vnic_performance_rx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2373 const double recvd_total_packets_acc)
2377 /***************************************************************************/
2378 /* Check preconditions. */
2379 /***************************************************************************/
2380 assert(recvd_total_packets_acc >= 0.0);
2382 evel_set_option_double(&vnic_performance->recvd_total_packets_acc,
2383 recvd_total_packets_acc,
2384 "Total Packets accumulated");
2389 /**************************************************************************//**
2390 * Set the Delta Total Packets Received in measurement interval
2391 * property of the vNIC performance.
2393 * @note The property is treated as immutable: it is only valid to call
2394 * the setter once. However, we don't assert if the caller tries to
2395 * overwrite, just ignoring the update instead.
2397 * @param vnic_performance Pointer to the vNIC Use.
2398 * @param recvd_total_packets_delta
2399 *****************************************************************************/
2400 void evel_vnic_performance_rx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2401 const double recvd_total_packets_delta)
2405 /***************************************************************************/
2406 /* Check preconditions. */
2407 /***************************************************************************/
2408 assert(recvd_total_packets_delta >= 0.0);
2410 evel_set_option_double(&vnic_performance->recvd_total_packets_delta,
2411 recvd_total_packets_delta,
2412 "Delta Total Packets recieved");
2417 /**************************************************************************//**
2418 * Set the Accumulated Unicast Packets Received in measurement interval
2419 * property of the vNIC performance.
2421 * @note The property is treated as immutable: it is only valid to call
2422 * the setter once. However, we don't assert if the caller tries to
2423 * overwrite, just ignoring the update instead.
2425 * @param vnic_performance Pointer to the vNIC Use.
2426 * @param recvd_ucast_packets_acc
2427 *****************************************************************************/
2428 void evel_vnic_performance_rx_ucast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2429 const double recvd_ucast_packets_acc)
2433 /***************************************************************************/
2434 /* Check preconditions. */
2435 /***************************************************************************/
2436 assert(recvd_ucast_packets_acc >= 0.0);
2438 evel_set_option_double(&vnic_performance->recvd_ucast_packets_acc,
2439 recvd_ucast_packets_acc,
2440 "Unicast Packets received accumulated");
2445 /**************************************************************************//**
2446 * Set the Delta Unicast packets Received in measurement interval
2447 * property of the vNIC performance.
2449 * @note The property is treated as immutable: it is only valid to call
2450 * the setter once. However, we don't assert if the caller tries to
2451 * overwrite, just ignoring the update instead.
2453 * @param vnic_performance Pointer to the vNIC Use.
2454 * @param recvd_ucast_packets_delta
2455 *****************************************************************************/
2456 void evel_vnic_performance_rx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2457 const double recvd_ucast_packets_delta)
2461 /***************************************************************************/
2462 /* Check preconditions. */
2463 /***************************************************************************/
2464 assert(recvd_ucast_packets_delta >= 0.0);
2466 evel_set_option_double(&vnic_performance->recvd_ucast_packets_delta,
2467 recvd_ucast_packets_delta,
2468 "Delta Unicast packets recieved");
2473 /**************************************************************************//**
2474 * Set the Transmitted Broadcast Packets in measurement interval
2475 * property of the vNIC performance.
2477 * @note The property is treated as immutable: it is only valid to call
2478 * the setter once. However, we don't assert if the caller tries to
2479 * overwrite, just ignoring the update instead.
2481 * @param vnic_performance Pointer to the vNIC Use.
2482 * @param tx_bcast_packets_acc
2483 *****************************************************************************/
2484 void evel_vnic_performance_tx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2485 const double tx_bcast_packets_acc)
2489 /***************************************************************************/
2490 /* Check preconditions. */
2491 /***************************************************************************/
2492 assert(tx_bcast_packets_acc >= 0.0);
2494 evel_set_option_double(&vnic_performance->tx_bcast_packets_acc,
2495 tx_bcast_packets_acc,
2496 "Transmitted Broadcast Packets accumulated");
2501 /**************************************************************************//**
2502 * Set the Delta Broadcast packets Transmitted in measurement interval
2503 * property of the vNIC performance.
2505 * @note The property is treated as immutable: it is only valid to call
2506 * the setter once. However, we don't assert if the caller tries to
2507 * overwrite, just ignoring the update instead.
2509 * @param vnic_performance Pointer to the vNIC Use.
2510 * @param tx_bcast_packets_delta
2511 *****************************************************************************/
2512 void evel_vnic_performance_tx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2513 const double tx_bcast_packets_delta)
2517 /***************************************************************************/
2518 /* Check preconditions. */
2519 /***************************************************************************/
2520 assert(tx_bcast_packets_delta >= 0.0);
2522 evel_set_option_double(&vnic_performance->tx_bcast_packets_delta,
2523 tx_bcast_packets_delta,
2524 "Delta Transmitted Broadcast packets ");
2529 /**************************************************************************//**
2530 * Set the Transmitted Discarded Packets in measurement interval
2531 * property of the vNIC performance.
2533 * @note The property is treated as immutable: it is only valid to call
2534 * the setter once. However, we don't assert if the caller tries to
2535 * overwrite, just ignoring the update instead.
2537 * @param vnic_performance Pointer to the vNIC Use.
2538 * @param tx_discarded_packets_acc
2539 *****************************************************************************/
2540 void evel_vnic_performance_tx_discarded_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2541 const double tx_discarded_packets_acc)
2545 /***************************************************************************/
2546 /* Check preconditions. */
2547 /***************************************************************************/
2548 assert(tx_discarded_packets_acc >= 0.0);
2550 evel_set_option_double(&vnic_performance->tx_discarded_packets_acc,
2551 tx_discarded_packets_acc,
2552 "Transmitted Discarded Packets accumulated");
2557 /**************************************************************************//**
2558 * Set the Delta Discarded packets Transmitted in measurement interval
2559 * property of the vNIC performance.
2561 * @note The property is treated as immutable: it is only valid to call
2562 * the setter once. However, we don't assert if the caller tries to
2563 * overwrite, just ignoring the update instead.
2565 * @param vnic_performance Pointer to the vNIC Use.
2566 * @param tx_discarded_packets_delta
2567 *****************************************************************************/
2568 void evel_vnic_performance_tx_discarded_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2569 const double tx_discarded_packets_delta)
2573 /***************************************************************************/
2574 /* Check preconditions. */
2575 /***************************************************************************/
2576 assert(tx_discarded_packets_delta >= 0.0);
2578 evel_set_option_double(&vnic_performance->tx_discarded_packets_delta,
2579 tx_discarded_packets_delta,
2580 "Delta Transmitted Discarded packets ");
2585 /**************************************************************************//**
2586 * Set the Transmitted Errored Packets in measurement interval
2587 * property of the vNIC performance.
2589 * @note The property is treated as immutable: it is only valid to call
2590 * the setter once. However, we don't assert if the caller tries to
2591 * overwrite, just ignoring the update instead.
2593 * @param vnic_performance Pointer to the vNIC Use.
2594 * @param tx_error_packets_acc
2595 *****************************************************************************/
2596 void evel_vnic_performance_tx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2597 const double tx_error_packets_acc)
2601 /***************************************************************************/
2602 /* Check preconditions. */
2603 /***************************************************************************/
2604 assert(tx_error_packets_acc >= 0.0);
2606 evel_set_option_double(&vnic_performance->tx_error_packets_acc,
2607 tx_error_packets_acc,
2608 "Transmitted Error Packets accumulated");
2613 /**************************************************************************//**
2614 * Set the Delta Errored packets Transmitted in measurement interval
2615 * property of the vNIC performance.
2617 * @note The property is treated as immutable: it is only valid to call
2618 * the setter once. However, we don't assert if the caller tries to
2619 * overwrite, just ignoring the update instead.
2621 * @param vnic_performance Pointer to the vNIC Use.
2622 * @param tx_error_packets_delta
2623 *****************************************************************************/
2624 void evel_vnic_performance_tx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2625 const double tx_error_packets_delta)
2629 /***************************************************************************/
2630 /* Check preconditions. */
2631 /***************************************************************************/
2632 assert(tx_error_packets_delta >= 0.0);
2634 evel_set_option_double(&vnic_performance->tx_error_packets_delta,
2635 tx_error_packets_delta,
2636 "Delta Transmitted Error packets ");
2641 /**************************************************************************//**
2642 * Set the Transmitted Multicast Packets in measurement interval
2643 * property of the vNIC performance.
2645 * @note The property is treated as immutable: it is only valid to call
2646 * the setter once. However, we don't assert if the caller tries to
2647 * overwrite, just ignoring the update instead.
2649 * @param vnic_performance Pointer to the vNIC Use.
2650 * @param tx_mcast_packets_acc
2651 *****************************************************************************/
2652 void evel_vnic_performance_tx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2653 const double tx_mcast_packets_acc)
2657 /***************************************************************************/
2658 /* Check preconditions. */
2659 /***************************************************************************/
2660 assert(tx_mcast_packets_acc >= 0.0);
2662 evel_set_option_double(&vnic_performance->tx_mcast_packets_acc,
2663 tx_mcast_packets_acc,
2664 "Transmitted Multicast Packets accumulated");
2669 /**************************************************************************//**
2670 * Set the Delta Multicast packets Transmitted in measurement interval
2671 * property of the vNIC performance.
2673 * @note The property is treated as immutable: it is only valid to call
2674 * the setter once. However, we don't assert if the caller tries to
2675 * overwrite, just ignoring the update instead.
2677 * @param vnic_performance Pointer to the vNIC Use.
2678 * @param tx_mcast_packets_delta
2679 *****************************************************************************/
2680 void evel_vnic_performance_tx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2681 const double tx_mcast_packets_delta)
2685 /***************************************************************************/
2686 /* Check preconditions. */
2687 /***************************************************************************/
2688 assert(tx_mcast_packets_delta >= 0.0);
2690 evel_set_option_double(&vnic_performance->tx_mcast_packets_delta,
2691 tx_mcast_packets_delta,
2692 "Delta Transmitted Multicast packets ");
2697 /**************************************************************************//**
2698 * Set the Transmitted Octets in measurement interval
2699 * property of the vNIC performance.
2701 * @note The property is treated as immutable: it is only valid to call
2702 * the setter once. However, we don't assert if the caller tries to
2703 * overwrite, just ignoring the update instead.
2705 * @param vnic_performance Pointer to the vNIC Use.
2706 * @param tx_octets_acc
2707 *****************************************************************************/
2708 void evel_vnic_performance_tx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2709 const double tx_octets_acc)
2713 /***************************************************************************/
2714 /* Check preconditions. */
2715 /***************************************************************************/
2716 assert(tx_octets_acc >= 0.0);
2718 evel_set_option_double(&vnic_performance->tx_octets_acc,
2720 "Transmitted Octets accumulated");
2725 /**************************************************************************//**
2726 * Set the Delta Octets Transmitted in measurement interval
2727 * property of the vNIC performance.
2729 * @note The property is treated as immutable: it is only valid to call
2730 * the setter once. However, we don't assert if the caller tries to
2731 * overwrite, just ignoring the update instead.
2733 * @param vnic_performance Pointer to the vNIC Use.
2734 * @param tx_octets_delta
2735 *****************************************************************************/
2736 void evel_vnic_performance_tx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2737 const double tx_octets_delta)
2741 /***************************************************************************/
2742 /* Check preconditions. */
2743 /***************************************************************************/
2744 assert(tx_octets_delta >= 0.0);
2746 evel_set_option_double(&vnic_performance->tx_octets_delta,
2748 "Delta Transmitted Octets ");
2754 /**************************************************************************//**
2755 * Set the Transmitted Total Packets in measurement interval
2756 * property of the vNIC performance.
2758 * @note The property is treated as immutable: it is only valid to call
2759 * the setter once. However, we don't assert if the caller tries to
2760 * overwrite, just ignoring the update instead.
2762 * @param vnic_performance Pointer to the vNIC Use.
2763 * @param tx_total_packets_acc
2764 *****************************************************************************/
2765 void evel_vnic_performance_tx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2766 const double tx_total_packets_acc)
2770 /***************************************************************************/
2771 /* Check preconditions. */
2772 /***************************************************************************/
2773 assert(tx_total_packets_acc >= 0.0);
2775 evel_set_option_double(&vnic_performance->tx_total_packets_acc,
2776 tx_total_packets_acc,
2777 "Transmitted Total Packets accumulated");
2782 /**************************************************************************//**
2783 * Set the Delta Total Packets Transmitted in measurement interval
2784 * property of the vNIC performance.
2786 * @note The property is treated as immutable: it is only valid to call
2787 * the setter once. However, we don't assert if the caller tries to
2788 * overwrite, just ignoring the update instead.
2790 * @param vnic_performance Pointer to the vNIC Use.
2791 * @param tx_total_packets_delta
2792 *****************************************************************************/
2793 void evel_vnic_performance_tx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2794 const double tx_total_packets_delta)
2798 /***************************************************************************/
2799 /* Check preconditions. */
2800 /***************************************************************************/
2801 assert(tx_total_packets_delta >= 0.0);
2803 evel_set_option_double(&vnic_performance->tx_total_packets_delta,
2804 tx_total_packets_delta,
2805 "Delta Transmitted Total Packets ");
2811 /**************************************************************************//**
2812 * Set the Transmitted Unicast Packets in measurement interval
2813 * property of the vNIC performance.
2815 * @note The property is treated as immutable: it is only valid to call
2816 * the setter once. However, we don't assert if the caller tries to
2817 * overwrite, just ignoring the update instead.
2819 * @param vnic_performance Pointer to the vNIC Use.
2820 * @param tx_ucast_packets_acc
2821 *****************************************************************************/
2822 void evel_vnic_performance_tx_ucast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2823 const double tx_ucast_packets_acc)
2827 /***************************************************************************/
2828 /* Check preconditions. */
2829 /***************************************************************************/
2830 assert(tx_ucast_packets_acc >= 0.0);
2832 evel_set_option_double(&vnic_performance->tx_ucast_packets_acc,
2833 tx_ucast_packets_acc,
2834 "Transmitted Unicast Packets accumulated");
2839 /**************************************************************************//**
2840 * Set the Delta Octets Transmitted in measurement interval
2841 * property of the vNIC performance.
2843 * @note The property is treated as immutable: it is only valid to call
2844 * the setter once. However, we don't assert if the caller tries to
2845 * overwrite, just ignoring the update instead.
2847 * @param vnic_performance Pointer to the vNIC Use.
2848 * @param tx_ucast_packets_delta
2849 *****************************************************************************/
2850 void evel_vnic_performance_tx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2851 const double tx_ucast_packets_delta)
2855 /***************************************************************************/
2856 /* Check preconditions. */
2857 /***************************************************************************/
2858 assert(tx_ucast_packets_delta >= 0.0);
2860 evel_set_option_double(&vnic_performance->tx_ucast_packets_delta,
2861 tx_ucast_packets_delta,
2862 "Delta Transmitted Unicast Packets ");
2868 /**************************************************************************//**
2869 * Add an additional vNIC Use to the specified Measurement event.
2871 * @param measurement Pointer to the measurement.
2872 * @param vnic_performance Pointer to the vNIC Use to add.
2873 *****************************************************************************/
2874 void evel_meas_vnic_performance_add(EVENT_MEASUREMENT * const measurement,
2875 MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance)
2879 /***************************************************************************/
2880 /* Check preconditions. */
2881 /***************************************************************************/
2882 assert(measurement != NULL);
2883 assert(measurement->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
2884 assert(vnic_performance != NULL);
2886 dlist_push_last(&measurement->vnic_usage, vnic_performance);
2891 /**************************************************************************//**
2892 * Add an additional vNIC usage record Measurement.
2894 * This function implements the previous API, purely for convenience.
2896 * The ID is null delimited ASCII string. The library takes a copy so the
2897 * caller does not have to preserve values after the function returns.
2899 * @param measurement Pointer to the measurement.
2900 * @param vnic_id ASCIIZ string with the vNIC's ID.
2901 * @param valset true or false confidence level
2902 * @param recvd_bcast_packets_acc Recieved broadcast packets
2903 * @param recvd_bcast_packets_delta Received delta broadcast packets
2904 * @param recvd_discarded_packets_acc Recieved discarded packets
2905 * @param recvd_discarded_packets_delta Received discarded delta packets
2906 * @param recvd_error_packets_acc Received error packets
2907 * @param recvd_error_packets_delta, Received delta error packets
2908 * @param recvd_mcast_packets_acc Received multicast packets
2909 * @param recvd_mcast_packets_delta Received delta multicast packets
2910 * @param recvd_octets_acc Received octets
2911 * @param recvd_octets_delta Received delta octets
2912 * @param recvd_total_packets_acc Received total packets
2913 * @param recvd_total_packets_delta Received delta total packets
2914 * @param recvd_ucast_packets_acc Received Unicast packets
2915 * @param recvd_ucast_packets_delta Received delta unicast packets
2916 * @param tx_bcast_packets_acc Transmitted broadcast packets
2917 * @param tx_bcast_packets_delta Transmitted delta broadcast packets
2918 * @param tx_discarded_packets_acc Transmitted packets discarded
2919 * @param tx_discarded_packets_delta Transmitted delta discarded packets
2920 * @param tx_error_packets_acc Transmitted error packets
2921 * @param tx_error_packets_delta Transmitted delta error packets
2922 * @param tx_mcast_packets_acc Transmitted multicast packets accumulated
2923 * @param tx_mcast_packets_delta Transmitted delta multicast packets
2924 * @param tx_octets_acc Transmitted octets
2925 * @param tx_octets_delta Transmitted delta octets
2926 * @param tx_total_packets_acc Transmitted total packets
2927 * @param tx_total_packets_delta Transmitted delta total packets
2928 * @param tx_ucast_packets_acc Transmitted Unicast packets
2929 * @param tx_ucast_packets_delta Transmitted delta Unicast packets
2930 *****************************************************************************/
2931 void evel_measurement_vnic_performance_add(EVENT_MEASUREMENT * const measurement,
2932 char * const vnic_id,
2934 double recvd_bcast_packets_acc,
2935 double recvd_bcast_packets_delta,
2936 double recvd_discarded_packets_acc,
2937 double recvd_discarded_packets_delta,
2938 double recvd_error_packets_acc,
2939 double recvd_error_packets_delta,
2940 double recvd_mcast_packets_acc,
2941 double recvd_mcast_packets_delta,
2942 double recvd_octets_acc,
2943 double recvd_octets_delta,
2944 double recvd_total_packets_acc,
2945 double recvd_total_packets_delta,
2946 double recvd_ucast_packets_acc,
2947 double recvd_ucast_packets_delta,
2948 double tx_bcast_packets_acc,
2949 double tx_bcast_packets_delta,
2950 double tx_discarded_packets_acc,
2951 double tx_discarded_packets_delta,
2952 double tx_error_packets_acc,
2953 double tx_error_packets_delta,
2954 double tx_mcast_packets_acc,
2955 double tx_mcast_packets_delta,
2956 double tx_octets_acc,
2957 double tx_octets_delta,
2958 double tx_total_packets_acc,
2959 double tx_total_packets_delta,
2960 double tx_ucast_packets_acc,
2961 double tx_ucast_packets_delta)
2963 MEASUREMENT_VNIC_PERFORMANCE * vnic_performance = NULL;
2966 /***************************************************************************/
2967 /* Trust the assertions in the underlying methods. */
2968 /***************************************************************************/
2969 vnic_performance = evel_measurement_new_vnic_performance(vnic_id, valset);
2971 evel_vnic_performance_rx_bcast_pkt_acc_set(vnic_performance, recvd_bcast_packets_acc);
2972 evel_vnic_performance_rx_bcast_pkt_delta_set(vnic_performance, recvd_bcast_packets_delta);
2973 evel_vnic_performance_rx_discard_pkt_acc_set(vnic_performance, recvd_discarded_packets_acc);
2974 evel_vnic_performance_rx_discard_pkt_delta_set(vnic_performance, recvd_discarded_packets_delta);
2975 evel_vnic_performance_rx_error_pkt_acc_set(vnic_performance, recvd_error_packets_acc);
2976 evel_vnic_performance_rx_error_pkt_delta_set(vnic_performance, recvd_error_packets_delta);
2977 evel_vnic_performance_rx_mcast_pkt_acc_set(vnic_performance, recvd_mcast_packets_acc);
2978 evel_vnic_performance_rx_mcast_pkt_delta_set(vnic_performance, recvd_mcast_packets_delta);
2979 evel_vnic_performance_rx_octets_acc_set(vnic_performance, recvd_octets_acc);
2980 evel_vnic_performance_rx_octets_delta_set(vnic_performance, recvd_octets_delta);
2981 evel_vnic_performance_rx_total_pkt_acc_set(vnic_performance, recvd_total_packets_acc);
2982 evel_vnic_performance_rx_total_pkt_delta_set(vnic_performance, recvd_total_packets_delta);
2983 evel_vnic_performance_rx_ucast_pkt_acc_set(vnic_performance, recvd_ucast_packets_acc);
2984 evel_vnic_performance_rx_ucast_pkt_delta_set(vnic_performance, recvd_ucast_packets_delta);
2985 evel_vnic_performance_tx_bcast_pkt_acc_set(vnic_performance, tx_bcast_packets_acc);
2986 evel_vnic_performance_tx_bcast_pkt_delta_set(vnic_performance, tx_bcast_packets_delta);
2987 evel_vnic_performance_tx_discarded_pkt_acc_set(vnic_performance, tx_discarded_packets_acc);
2988 evel_vnic_performance_tx_discarded_pkt_delta_set(vnic_performance, tx_discarded_packets_delta);
2989 evel_vnic_performance_tx_error_pkt_acc_set(vnic_performance, tx_error_packets_acc);
2990 evel_vnic_performance_tx_error_pkt_delta_set(vnic_performance, tx_error_packets_delta);
2991 evel_vnic_performance_tx_mcast_pkt_acc_set(vnic_performance, tx_mcast_packets_acc);
2992 evel_vnic_performance_tx_mcast_pkt_delta_set(vnic_performance, tx_mcast_packets_delta);
2993 evel_vnic_performance_tx_octets_acc_set(vnic_performance, tx_octets_acc);
2994 evel_vnic_performance_tx_octets_delta_set(vnic_performance, tx_octets_delta);
2995 evel_vnic_performance_tx_total_pkt_acc_set(vnic_performance, tx_total_packets_acc);
2996 evel_vnic_performance_tx_total_pkt_delta_set(vnic_performance, tx_total_packets_delta);
2997 evel_vnic_performance_tx_ucast_pkt_acc_set(vnic_performance, tx_ucast_packets_acc);
2998 evel_vnic_performance_tx_ucast_pkt_delta_set(vnic_performance, tx_ucast_packets_delta);
2999 evel_meas_vnic_performance_add(measurement, vnic_performance);
3002 /**************************************************************************//**
3003 * Encode the measurement as a JSON measurement.
3005 * @param jbuf Pointer to the ::EVEL_JSON_BUFFER to encode into.
3006 * @param event Pointer to the ::EVENT_HEADER to encode.
3007 *****************************************************************************/
3008 void evel_json_encode_measurement(EVEL_JSON_BUFFER * jbuf,
3009 EVENT_MEASUREMENT * event)
3011 MEASUREMENT_CPU_USE * cpu_use = NULL;
3012 MEASUREMENT_MEM_USE * mem_use = NULL;
3013 MEASUREMENT_DISK_USE * disk_use = NULL;
3014 MEASUREMENT_FSYS_USE * fsys_use = NULL;
3015 MEASUREMENT_LATENCY_BUCKET * bucket = NULL;
3016 MEASUREMENT_VNIC_PERFORMANCE * vnic_performance = NULL;
3017 MEASUREMENT_ERRORS * errors = NULL;
3018 MEASUREMENT_FEATURE_USE * feature_use = NULL;
3019 MEASUREMENT_CODEC_USE * codec_use = NULL;
3020 MEASUREMENT_GROUP * measurement_group = NULL;
3021 CUSTOM_MEASUREMENT * custom_measurement = NULL;
3022 DLIST_ITEM * item = NULL;
3023 DLIST_ITEM * nested_item = NULL;
3024 DLIST_ITEM * addl_info_item = NULL;
3025 OTHER_FIELD *addl_info = NULL;
3029 /***************************************************************************/
3030 /* Check preconditions. */
3031 /***************************************************************************/
3032 assert(event != NULL);
3033 assert(event->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
3035 evel_json_encode_header(jbuf, &event->header);
3036 evel_json_open_named_object(jbuf, "measurementsForVfScalingFields");
3038 /***************************************************************************/
3039 /* Mandatory fields. */
3040 /***************************************************************************/
3041 evel_enc_kv_int(jbuf, "measurementInterval", event->measurement_interval);
3043 /***************************************************************************/
3044 /* Optional fields. */
3045 /***************************************************************************/
3046 // additional fields
3047 evel_json_checkpoint(jbuf);
3048 if (evel_json_open_opt_named_list(jbuf, "additionalFields"))
3050 bool item_added = false;
3052 addl_info_item = dlist_get_first(&event->additional_info);
3053 while (addl_info_item != NULL)
3055 addl_info = (OTHER_FIELD*) addl_info_item->item;
3056 assert(addl_info != NULL);
3058 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3062 evel_json_open_object(jbuf);
3063 evel_enc_kv_string(jbuf, "name", addl_info->name);
3064 evel_enc_kv_string(jbuf, "value", addl_info->value);
3065 evel_json_close_object(jbuf);
3068 addl_info_item = dlist_get_next(addl_info_item);
3070 evel_json_close_list(jbuf);
3072 /*************************************************************************/
3073 /* If we've not written anything, rewind to before we opened the list. */
3074 /*************************************************************************/
3077 evel_json_rewind(jbuf);
3081 // TBD additional json objects
3082 evel_enc_kv_opt_int(jbuf, "concurrentSessions", &event->concurrent_sessions);
3083 evel_enc_kv_opt_int(jbuf, "configuredEntities", &event->configured_entities);
3085 /***************************************************************************/
3087 /***************************************************************************/
3088 evel_json_checkpoint(jbuf);
3089 if (evel_json_open_opt_named_list(jbuf, "cpuUsageArray"))
3091 bool item_added = false;
3093 item = dlist_get_first(&event->cpu_usage);
3094 while (item != NULL)
3096 cpu_use = (MEASUREMENT_CPU_USE*) item->item;
3097 assert(cpu_use != NULL);
3099 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3103 evel_json_open_object(jbuf);
3104 evel_enc_kv_string(jbuf, "cpuIdentifier", cpu_use->id);
3105 evel_enc_kv_opt_double(jbuf, "cpuIdle", &cpu_use->idle);
3106 evel_enc_kv_opt_double(jbuf, "cpuUsageInterrupt", &cpu_use->intrpt);
3107 evel_enc_kv_opt_double(jbuf, "cpuUsageNice", &cpu_use->nice);
3108 evel_enc_kv_opt_double(jbuf, "cpuUsageSoftIrq", &cpu_use->softirq);
3109 evel_enc_kv_opt_double(jbuf, "cpuUsageSteal", &cpu_use->steal);
3110 evel_enc_kv_opt_double(jbuf, "cpuUsageSystem", &cpu_use->sys);
3111 evel_enc_kv_opt_double(jbuf, "cpuUsageUser", &cpu_use->user);
3112 evel_enc_kv_opt_double(jbuf, "cpuWait", &cpu_use->wait);
3113 evel_enc_kv_double(jbuf, "percentUsage",cpu_use->usage);
3114 evel_json_close_object(jbuf);
3117 item = dlist_get_next(item);
3119 evel_json_close_list(jbuf);
3121 /*************************************************************************/
3122 /* If we've not written anything, rewind to before we opened the list. */
3123 /*************************************************************************/
3126 evel_json_rewind(jbuf);
3131 /***************************************************************************/
3132 /* Disk Use list. */
3133 /***************************************************************************/
3134 evel_json_checkpoint(jbuf);
3135 if (evel_json_open_opt_named_list(jbuf, "diskUsageArray"))
3137 bool item_added = false;
3139 item = dlist_get_first(&event->disk_usage);
3140 while (item != NULL)
3142 disk_use = (MEASUREMENT_DISK_USE*) item->item;
3143 assert(disk_use != NULL);
3145 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3149 evel_json_open_object(jbuf);
3150 evel_enc_kv_string(jbuf, "diskIdentifier", disk_use->id);
3151 evel_enc_kv_opt_double(jbuf, "diskIoTimeAvg", &disk_use->iotimeavg);
3152 evel_enc_kv_opt_double(jbuf, "diskIoTimeLast", &disk_use->iotimelast);
3153 evel_enc_kv_opt_double(jbuf, "diskIoTimeMax", &disk_use->iotimemax);
3154 evel_enc_kv_opt_double(jbuf, "diskIoTimeMin", &disk_use->iotimemin);
3155 evel_enc_kv_opt_double(jbuf, "diskMergedReadAvg", &disk_use->mergereadavg);
3156 evel_enc_kv_opt_double(jbuf, "diskMergedReadLast", &disk_use->mergereadlast);
3157 evel_enc_kv_opt_double(jbuf, "diskMergedReadMax", &disk_use->mergereadmax);
3158 evel_enc_kv_opt_double(jbuf, "diskMergedReadMin", &disk_use->mergereadmin);
3159 evel_enc_kv_opt_double(jbuf, "diskMergedWriteAvg", &disk_use->mergewriteavg);
3160 evel_enc_kv_opt_double(jbuf, "diskMergedWriteLast", &disk_use->mergewritelast);
3161 evel_enc_kv_opt_double(jbuf, "diskMergedWriteMax", &disk_use->mergewritemax);
3162 evel_enc_kv_opt_double(jbuf, "diskMergedWriteMin", &disk_use->mergewritemin);
3163 evel_enc_kv_opt_double(jbuf, "diskOctetsReadAvg", &disk_use->octetsreadavg);
3164 evel_enc_kv_opt_double(jbuf, "diskOctetsReadLast", &disk_use->octetsreadlast);
3165 evel_enc_kv_opt_double(jbuf, "diskOctetsReadMax", &disk_use->octetsreadmax);
3166 evel_enc_kv_opt_double(jbuf, "diskOctetsReadMin", &disk_use->octetsreadmin);
3167 evel_enc_kv_opt_double(jbuf, "diskOctetsWriteAvg", &disk_use->octetswriteavg);
3168 evel_enc_kv_opt_double(jbuf, "diskOctetsWriteLast", &disk_use->octetswritelast);
3169 evel_enc_kv_opt_double(jbuf, "diskOctetsWriteMax", &disk_use->octetswritemax);
3170 evel_enc_kv_opt_double(jbuf, "diskOctetsWriteMin", &disk_use->octetswritemin);
3171 evel_enc_kv_opt_double(jbuf, "diskOpsReadAvg", &disk_use->opsreadavg);
3172 evel_enc_kv_opt_double(jbuf, "diskOpsReadLast", &disk_use->opsreadlast);
3173 evel_enc_kv_opt_double(jbuf, "diskOpsReadMax", &disk_use->opsreadmax);
3174 evel_enc_kv_opt_double(jbuf, "diskOpsReadMin", &disk_use->opsreadmin);
3175 evel_enc_kv_opt_double(jbuf, "diskOpsWriteAvg", &disk_use->opswriteavg);
3176 evel_enc_kv_opt_double(jbuf, "diskOpsWriteLast", &disk_use->opswritelast);
3177 evel_enc_kv_opt_double(jbuf, "diskOpsWriteMax", &disk_use->opswritemax);
3178 evel_enc_kv_opt_double(jbuf, "diskOpsWriteMin", &disk_use->opswritemin);
3179 evel_enc_kv_opt_double(jbuf, "diskPendingOperationsAvg", &disk_use->pendingopsavg);
3180 evel_enc_kv_opt_double(jbuf, "diskPendingOperationsLast", &disk_use->pendingopslast);
3181 evel_enc_kv_opt_double(jbuf, "diskPendingOperationsMax", &disk_use->pendingopsmax);
3182 evel_enc_kv_opt_double(jbuf, "diskPendingOperationsMin", &disk_use->pendingopsmin);
3183 evel_enc_kv_opt_double(jbuf, "diskTimeReadAvg", &disk_use->timereadavg);
3184 evel_enc_kv_opt_double(jbuf, "diskTimeReadLast", &disk_use->timereadlast);
3185 evel_enc_kv_opt_double(jbuf, "diskTimeReadMax", &disk_use->timereadmax);
3186 evel_enc_kv_opt_double(jbuf, "diskTimeReadMin", &disk_use->timereadmin);
3187 evel_enc_kv_opt_double(jbuf, "diskTimeWriteAvg", &disk_use->timewriteavg);
3188 evel_enc_kv_opt_double(jbuf, "diskTimeWriteLast", &disk_use->timewritelast);
3189 evel_enc_kv_opt_double(jbuf, "diskTimeWriteMax", &disk_use->timewritemax);
3190 evel_enc_kv_opt_double(jbuf, "diskTimeWriteMin", &disk_use->timewritemin);
3191 evel_json_close_object(jbuf);
3194 item = dlist_get_next(item);
3196 evel_json_close_list(jbuf);
3198 /*************************************************************************/
3199 /* If we've not written anything, rewind to before we opened the list. */
3200 /*************************************************************************/
3203 evel_json_rewind(jbuf);
3207 /***************************************************************************/
3208 /* Filesystem Usage list. */
3209 /***************************************************************************/
3210 evel_json_checkpoint(jbuf);
3211 if (evel_json_open_opt_named_list(jbuf, "filesystemUsageArray"))
3213 bool item_added = false;
3215 item = dlist_get_first(&event->filesystem_usage);
3216 while (item != NULL)
3218 fsys_use = (MEASUREMENT_FSYS_USE *) item->item;
3219 assert(fsys_use != NULL);
3221 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3222 "filesystemUsageArray",
3223 fsys_use->filesystem_name))
3225 evel_json_open_object(jbuf);
3226 evel_enc_kv_string(jbuf, "filesystemName", fsys_use->filesystem_name);
3228 jbuf, "blockConfigured", fsys_use->block_configured);
3229 evel_enc_kv_double(jbuf, "blockIops", fsys_use->block_iops);
3230 evel_enc_kv_double(jbuf, "blockUsed", fsys_use->block_used);
3232 jbuf, "ephemeralConfigured", fsys_use->ephemeral_configured);
3233 evel_enc_kv_double(jbuf, "ephemeralIops", fsys_use->ephemeral_iops);
3234 evel_enc_kv_double(jbuf, "ephemeralUsed", fsys_use->ephemeral_used);
3235 evel_json_close_object(jbuf);
3238 item = dlist_get_next(item);
3240 evel_json_close_list(jbuf);
3242 /*************************************************************************/
3243 /* If we've not written anything, rewind to before we opened the list. */
3244 /*************************************************************************/
3247 evel_json_rewind(jbuf);
3251 /***************************************************************************/
3252 /* Latency distribution. */
3253 /***************************************************************************/
3254 item = dlist_get_first(&event->latency_distribution);
3255 if ((item != NULL) &&
3256 evel_json_open_opt_named_list(jbuf, "latencyDistribution"))
3258 while (item != NULL)
3260 bucket = (MEASUREMENT_LATENCY_BUCKET*) item->item;
3261 assert(bucket != NULL);
3263 evel_json_open_object(jbuf);
3264 evel_enc_kv_opt_double(
3265 jbuf, "lowEndOfLatencyBucket", &bucket->low_end);
3266 evel_enc_kv_opt_double(
3267 jbuf, "highEndOfLatencyBucket", &bucket->high_end);
3268 evel_enc_kv_int(jbuf, "countsInTheBucket", bucket->count);
3269 evel_json_close_object(jbuf);
3270 item = dlist_get_next(item);
3272 evel_json_close_list(jbuf);
3275 evel_enc_kv_opt_double(
3276 jbuf, "meanRequestLatency", &event->mean_request_latency);
3277 evel_enc_kv_opt_int(jbuf, "requestRate", &event->request_rate);
3279 /***************************************************************************/
3280 /* vNIC Usage TBD Performance array */
3281 /***************************************************************************/
3282 evel_json_checkpoint(jbuf);
3283 if (evel_json_open_opt_named_list(jbuf, "vNicUsageArray"))
3285 bool item_added = false;
3287 item = dlist_get_first(&event->vnic_usage);
3288 while (item != NULL)
3290 vnic_performance = (MEASUREMENT_VNIC_PERFORMANCE *) item->item;
3291 assert(vnic_performance != NULL);
3293 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3294 "vNicPerformanceArray",
3295 vnic_performance->vnic_id))
3297 evel_json_open_object(jbuf);
3299 /*********************************************************************/
3300 /* Optional fields. */
3301 /*********************************************************************/
3302 evel_enc_kv_opt_double( jbuf,
3303 "receivedBroadcastPacketsAccumulated", &vnic_performance->recvd_bcast_packets_acc);
3304 evel_enc_kv_opt_double( jbuf,
3305 "receivedBroadcastPacketsDelta", &vnic_performance->recvd_bcast_packets_delta);
3306 evel_enc_kv_opt_double( jbuf,
3307 "receivedDiscardedPacketsAccumulated", &vnic_performance->recvd_discarded_packets_acc);
3308 evel_enc_kv_opt_double( jbuf,
3309 "receivedDiscardedPacketsDelta", &vnic_performance->recvd_discarded_packets_delta);
3310 evel_enc_kv_opt_double( jbuf,
3311 "receivedErrorPacketsAccumulated", &vnic_performance->recvd_error_packets_acc);
3312 evel_enc_kv_opt_double( jbuf,
3313 "receivedErrorPacketsDelta", &vnic_performance->recvd_error_packets_delta);
3314 evel_enc_kv_opt_double( jbuf,
3315 "receivedMulticastPacketsAccumulated", &vnic_performance->recvd_mcast_packets_acc);
3316 evel_enc_kv_opt_double( jbuf,
3317 "receivedMulticastPacketsDelta", &vnic_performance->recvd_mcast_packets_delta);
3318 evel_enc_kv_opt_double( jbuf,
3319 "receivedOctetsAccumulated", &vnic_performance->recvd_octets_acc);
3320 evel_enc_kv_opt_double( jbuf,
3321 "receivedOctetsDelta", &vnic_performance->recvd_octets_delta);
3322 evel_enc_kv_opt_double( jbuf,
3323 "receivedTotalPacketsAccumulated", &vnic_performance->recvd_total_packets_acc);
3324 evel_enc_kv_opt_double( jbuf,
3325 "receivedTotalPacketsDelta", &vnic_performance->recvd_total_packets_delta);
3326 evel_enc_kv_opt_double( jbuf,
3327 "receivedUnicastPacketsAccumulated", &vnic_performance->recvd_ucast_packets_acc);
3328 evel_enc_kv_opt_double( jbuf,
3329 "receivedUnicastPacketsDelta", &vnic_performance->recvd_ucast_packets_delta);
3330 evel_enc_kv_opt_double( jbuf,
3331 "transmittedBroadcastPacketsAccumulated", &vnic_performance->tx_bcast_packets_acc);
3332 evel_enc_kv_opt_double( jbuf,
3333 "transmittedBroadcastPacketsDelta", &vnic_performance->tx_bcast_packets_delta);
3334 evel_enc_kv_opt_double( jbuf,
3335 "transmittedDiscardedPacketsAccumulated", &vnic_performance->tx_discarded_packets_acc);
3336 evel_enc_kv_opt_double( jbuf,
3337 "transmittedDiscardedPacketsDelta", &vnic_performance->tx_discarded_packets_delta);
3338 evel_enc_kv_opt_double( jbuf,
3339 "transmittedErrorPacketsAccumulated", &vnic_performance->tx_error_packets_acc);
3340 evel_enc_kv_opt_double( jbuf,
3341 "transmittedErrorPacketsDelta", &vnic_performance->tx_error_packets_delta);
3342 evel_enc_kv_opt_double( jbuf,
3343 "transmittedMulticastPacketsAccumulated", &vnic_performance->tx_mcast_packets_acc);
3344 evel_enc_kv_opt_double( jbuf,
3345 "transmittedMulticastPacketsDelta", &vnic_performance->tx_mcast_packets_delta);
3346 evel_enc_kv_opt_double( jbuf,
3347 "transmittedOctetsAccumulated", &vnic_performance->tx_octets_acc);
3348 evel_enc_kv_opt_double( jbuf,
3349 "transmittedOctetsDelta", &vnic_performance->tx_octets_delta);
3350 evel_enc_kv_opt_double( jbuf,
3351 "transmittedTotalPacketsAccumulated", &vnic_performance->tx_total_packets_acc);
3352 evel_enc_kv_opt_double( jbuf,
3353 "transmittedTotalPacketsDelta", &vnic_performance->tx_total_packets_delta);
3354 evel_enc_kv_opt_double( jbuf,
3355 "transmittedUnicastPacketsAccumulated", &vnic_performance->tx_ucast_packets_acc);
3356 evel_enc_kv_opt_double( jbuf,
3357 "transmittedUnicastPacketsDelta", &vnic_performance->tx_ucast_packets_delta);
3359 /*********************************************************************/
3360 /* Mandatory fields. */
3361 /*********************************************************************/
3362 evel_enc_kv_string(jbuf, "valuesAreSuspect", vnic_performance->valuesaresuspect);
3363 evel_enc_kv_string(jbuf, "vNicIdentifier", vnic_performance->vnic_id);
3365 evel_json_close_object(jbuf);
3368 item = dlist_get_next(item);
3371 evel_json_close_list(jbuf);
3373 /*************************************************************************/
3374 /* If we've not written anything, rewind to before we opened the list. */
3375 /*************************************************************************/
3378 evel_json_rewind(jbuf);
3383 /***************************************************************************/
3384 /* Memory Use list. */
3385 /***************************************************************************/
3386 evel_json_checkpoint(jbuf);
3387 if (evel_json_open_opt_named_list(jbuf, "memoryUsageArray"))
3389 bool item_added = false;
3391 item = dlist_get_first(&event->mem_usage);
3392 while (item != NULL)
3394 mem_use = (MEASUREMENT_MEM_USE*) item->item;
3395 assert(mem_use != NULL);
3397 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3401 evel_json_open_object(jbuf);
3402 evel_enc_kv_double(jbuf, "memoryBuffered", mem_use->membuffsz);
3403 evel_enc_kv_opt_double(jbuf, "memoryCached", &mem_use->memcache);
3404 evel_enc_kv_opt_double(jbuf, "memoryConfigured", &mem_use->memconfig);
3405 evel_enc_kv_opt_double(jbuf, "memoryFree", &mem_use->memfree);
3406 evel_enc_kv_opt_double(jbuf, "memorySlabRecl", &mem_use->slabrecl);
3407 evel_enc_kv_opt_double(jbuf, "memorySlabUnrecl", &mem_use->slabunrecl);
3408 evel_enc_kv_opt_double(jbuf, "memoryUsed", &mem_use->memused);
3409 evel_enc_kv_string(jbuf, "vmIdentifier", mem_use->id);
3410 evel_json_close_object(jbuf);
3413 item = dlist_get_next(item);
3415 evel_json_close_list(jbuf);
3417 /*************************************************************************/
3418 /* If we've not written anything, rewind to before we opened the list. */
3419 /*************************************************************************/
3422 evel_json_rewind(jbuf);
3427 evel_enc_kv_opt_int(
3428 jbuf, "numberOfMediaPortsInUse", &event->media_ports_in_use);
3429 evel_enc_kv_opt_int(
3430 jbuf, "vnfcScalingMetric", &event->vnfc_scaling_metric);
3432 /***************************************************************************/
3434 /***************************************************************************/
3435 if ((event->errors != NULL) &&
3436 evel_json_open_opt_named_object(jbuf, "errors"))
3438 errors = event->errors;
3439 evel_enc_kv_int(jbuf, "receiveDiscards", errors->receive_discards);
3440 evel_enc_kv_int(jbuf, "receiveErrors", errors->receive_errors);
3441 evel_enc_kv_int(jbuf, "transmitDiscards", errors->transmit_discards);
3442 evel_enc_kv_int(jbuf, "transmitErrors", errors->transmit_errors);
3443 evel_json_close_object(jbuf);
3446 /***************************************************************************/
3447 /* Feature Utilization list. */
3448 /***************************************************************************/
3449 evel_json_checkpoint(jbuf);
3450 if (evel_json_open_opt_named_list(jbuf, "featureUsageArray"))
3452 bool item_added = false;
3454 item = dlist_get_first(&event->feature_usage);
3455 while (item != NULL)
3457 feature_use = (MEASUREMENT_FEATURE_USE*) item->item;
3458 assert(feature_use != NULL);
3460 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3461 "featureUsageArray",
3462 feature_use->feature_id))
3464 evel_json_open_object(jbuf);
3465 evel_enc_kv_string(jbuf, "featureIdentifier", feature_use->feature_id);
3467 jbuf, "featureUtilization", feature_use->feature_utilization);
3468 evel_json_close_object(jbuf);
3471 item = dlist_get_next(item);
3473 evel_json_close_list(jbuf);
3475 /*************************************************************************/
3476 /* If we've not written anything, rewind to before we opened the list. */
3477 /*************************************************************************/
3480 evel_json_rewind(jbuf);
3484 /***************************************************************************/
3485 /* Codec Utilization list. */
3486 /***************************************************************************/
3487 evel_json_checkpoint(jbuf);
3488 if (evel_json_open_opt_named_list(jbuf, "codecUsageArray"))
3490 bool item_added = false;
3492 item = dlist_get_first(&event->codec_usage);
3493 while (item != NULL)
3495 codec_use = (MEASUREMENT_CODEC_USE*) item->item;
3496 assert(codec_use != NULL);
3498 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3500 codec_use->codec_id))
3502 evel_json_open_object(jbuf);
3503 evel_enc_kv_string(jbuf, "codecIdentifier", codec_use->codec_id);
3504 evel_enc_kv_int(jbuf, "numberInUse", codec_use->number_in_use);
3505 evel_json_close_object(jbuf);
3508 item = dlist_get_next(item);
3510 evel_json_close_list(jbuf);
3512 /*************************************************************************/
3513 /* If we've not written anything, rewind to before we opened the list. */
3514 /*************************************************************************/
3517 evel_json_rewind(jbuf);
3521 /***************************************************************************/
3522 /* Additional Measurement Groups list. */
3523 /***************************************************************************/
3524 evel_json_checkpoint(jbuf);
3525 if (evel_json_open_opt_named_list(jbuf, "additionalMeasurements"))
3527 bool item_added = false;
3529 item = dlist_get_first(&event->additional_measurements);
3530 while (item != NULL)
3532 measurement_group = (MEASUREMENT_GROUP *) item->item;
3533 assert(measurement_group != NULL);
3535 if (!evel_throttle_suppress_nv_pair(jbuf->throttle_spec,
3536 "additionalMeasurements",
3537 measurement_group->name))
3539 evel_json_open_object(jbuf);
3540 evel_enc_kv_string(jbuf, "name", measurement_group->name);
3541 evel_json_open_opt_named_list(jbuf, "arrayOfFields");
3543 /*********************************************************************/
3544 /* Measurements list. */
3545 /*********************************************************************/
3546 nested_item = dlist_get_first(&measurement_group->measurements);
3547 while (nested_item != NULL)
3549 custom_measurement = (CUSTOM_MEASUREMENT *) nested_item->item;
3550 assert(custom_measurement != NULL);
3552 evel_json_open_object(jbuf);
3553 evel_enc_kv_string(jbuf, "name", custom_measurement->name);
3554 evel_enc_kv_string(jbuf, "value", custom_measurement->value);
3555 evel_json_close_object(jbuf);
3556 nested_item = dlist_get_next(nested_item);
3558 evel_json_close_list(jbuf);
3559 evel_json_close_object(jbuf);
3562 item = dlist_get_next(item);
3564 evel_json_close_list(jbuf);
3566 /*************************************************************************/
3567 /* If we've not written anything, rewind to before we opened the list. */
3568 /*************************************************************************/
3571 evel_json_rewind(jbuf);
3575 /***************************************************************************/
3576 /* Although optional, we always generate the version. Note that this */
3577 /* closes the object, too. */
3578 /***************************************************************************/
3579 evel_enc_version(jbuf,
3580 "measurementsForVfScalingVersion",
3581 event->major_version,
3582 event->minor_version);
3583 evel_json_close_object(jbuf);
3588 /**************************************************************************//**
3589 * Free a Measurement.
3591 * Free off the Measurement supplied. Will free all the contained allocated
3594 * @note It does not free the Measurement itself, since that may be part of a
3596 *****************************************************************************/
3597 void evel_free_measurement(EVENT_MEASUREMENT * event)
3599 MEASUREMENT_CPU_USE * cpu_use = NULL;
3600 MEASUREMENT_DISK_USE * disk_use = NULL;
3601 MEASUREMENT_FSYS_USE * fsys_use = NULL;
3602 MEASUREMENT_LATENCY_BUCKET * bucket = NULL;
3603 MEASUREMENT_MEM_USE * mem_use = NULL;
3604 MEASUREMENT_VNIC_PERFORMANCE * vnic_performance = NULL;
3605 MEASUREMENT_FEATURE_USE * feature_use = NULL;
3606 MEASUREMENT_CODEC_USE * codec_use = NULL;
3607 MEASUREMENT_GROUP * measurement_group = NULL;
3608 CUSTOM_MEASUREMENT * measurement = NULL;
3609 OTHER_FIELD *addl_info = NULL;
3613 /***************************************************************************/
3614 /* Check preconditions. As an internal API we don't allow freeing NULL */
3615 /* events as we do on the public API. */
3616 /***************************************************************************/
3617 assert(event != NULL);
3618 assert(event->header.event_domain == EVEL_DOMAIN_MEASUREMENT);
3620 /***************************************************************************/
3621 /* Free all internal strings then the header itself. */
3622 /***************************************************************************/
3623 addl_info = dlist_pop_last(&event->additional_info);
3624 while (addl_info != NULL)
3626 EVEL_DEBUG("Freeing Additional Info (%s, %s)",
3629 free(addl_info->name);
3630 free(addl_info->value);
3632 addl_info = dlist_pop_last(&event->additional_info);
3637 cpu_use = dlist_pop_last(&event->cpu_usage);
3638 while (cpu_use != NULL)
3640 EVEL_DEBUG("Freeing CPU use Info (%s)", cpu_use->id);
3643 cpu_use = dlist_pop_last(&event->cpu_usage);
3645 disk_use = dlist_pop_last(&event->disk_usage);
3646 while (disk_use != NULL)
3648 EVEL_DEBUG("Freeing Disk use Info (%s)", disk_use->id);
3651 disk_use = dlist_pop_last(&event->disk_usage);
3653 mem_use = dlist_pop_last(&event->mem_usage);
3654 while (mem_use != NULL)
3656 EVEL_DEBUG("Freeing Memory use Info (%s)", mem_use->id);
3658 free(mem_use->vmid);
3660 mem_use = dlist_pop_last(&event->mem_usage);
3663 fsys_use = dlist_pop_last(&event->filesystem_usage);
3664 while (fsys_use != NULL)
3666 EVEL_DEBUG("Freeing Filesystem Use info (%s)", fsys_use->filesystem_name);
3667 free(fsys_use->filesystem_name);
3669 fsys_use = dlist_pop_last(&event->filesystem_usage);
3672 bucket = dlist_pop_last(&event->latency_distribution);
3673 while (bucket != NULL)
3675 EVEL_DEBUG("Freeing Latency Bucket");
3677 bucket = dlist_pop_last(&event->latency_distribution);
3680 vnic_performance = dlist_pop_last(&event->vnic_usage);
3681 while (vnic_performance != NULL)
3683 EVEL_DEBUG("Freeing vNIC performance Info (%s)", vnic_performance->vnic_id);
3684 evel_measurement_free_vnic_performance(vnic_performance);
3685 free(vnic_performance);
3686 vnic_performance = dlist_pop_last(&event->vnic_usage);
3689 codec_use = dlist_pop_last(&event->codec_usage);
3690 while (codec_use != NULL)
3692 EVEL_DEBUG("Freeing Codec use Info (%s)", codec_use->codec_id);
3693 free(codec_use->codec_id);
3695 codec_use = dlist_pop_last(&event->codec_usage);
3698 if (event->errors != NULL)
3700 EVEL_DEBUG("Freeing Errors");
3701 free(event->errors);
3704 feature_use = dlist_pop_last(&event->feature_usage);
3705 while (feature_use != NULL)
3707 EVEL_DEBUG("Freeing Feature use Info (%s)", feature_use->feature_id);
3708 free(feature_use->feature_id);
3710 feature_use = dlist_pop_last(&event->feature_usage);
3713 measurement_group = dlist_pop_last(&event->additional_measurements);
3714 while (measurement_group != NULL)
3716 EVEL_DEBUG("Freeing Measurement Group (%s)", measurement_group->name);
3718 measurement = dlist_pop_last(&measurement_group->measurements);
3719 while (measurement != NULL)
3721 EVEL_DEBUG("Freeing Measurement (%s)", measurement->name);
3722 free(measurement->name);
3723 free(measurement->value);
3725 measurement = dlist_pop_last(&measurement_group->measurements);
3727 free(measurement_group->name);
3728 free(measurement_group);
3729 measurement_group = dlist_pop_last(&event->additional_measurements);
3732 evel_free_header(&event->header);