1 package evel_javalibrary.att.com;
\r
2 /**************************************************************************//**
\r
4 * Evel Scaling Measurement class
\r
6 * This file implements the Evel Scaling Measurement Event class which is intended to provide a
\r
7 * simple wrapper around the complexity of AT&T's Vendor Event Listener API so
\r
8 * that VNFs can use it to send CPU, Memory, Disk Measurements to Collector.
\r
12 * Unless otherwise specified, all software contained herein is
\r
13 * Licensed under the Apache License, Version 2.0 (the "License");
\r
14 * you may not use this file except in compliance with the License.
\r
15 * You may obtain a copy of the License at
\r
16 * http://www.apache.org/licenses/LICENSE-2.0
\r
18 * Unless required by applicable law or agreed to in writing, software
\r
19 * distributed under the License is distributed on an "AS IS" BASIS,
\r
20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
21 * See the License for the specific language governing permissions and
\r
22 * limitations under the License.
\r
23 *****************************************************************************/
\r
25 import java.text.MessageFormat;
\r
26 import java.util.ArrayList;
\r
28 import javax.json.Json;
\r
29 import javax.json.JsonArrayBuilder;
\r
30 import javax.json.JsonObject;
\r
31 import javax.json.JsonObjectBuilder;
\r
33 import org.apache.log4j.Logger;
\r
34 import org.slf4j.helpers.MessageFormatter;
\r
37 public class EvelScalingMeasurement extends EvelHeader {
\r
39 int major_version = 2;
\r
40 int minor_version = 1;
\r
42 /**************************************************************************//**
\r
44 * JSON equivalent field: cpuUsage
\r
45 *****************************************************************************/
\r
46 public class MEASUREMENT_CPU_USE {
\r
49 public EvelOptionDouble idle;
\r
50 public EvelOptionDouble intrpt;
\r
51 public EvelOptionDouble nice;
\r
52 public EvelOptionDouble softirq;
\r
53 public EvelOptionDouble steal;
\r
54 public EvelOptionDouble sys;
\r
55 public EvelOptionDouble user;
\r
56 public EvelOptionDouble wait;
\r
60 /**************************************************************************//**
\r
62 * JSON equivalent field: diskUsage
\r
63 *****************************************************************************/
\r
64 public class MEASUREMENT_DISK_USE {
\r
66 public EvelOptionDouble iotimeavg;
\r
67 public EvelOptionDouble iotimelast;
\r
68 public EvelOptionDouble iotimemax;
\r
69 public EvelOptionDouble iotimemin;
\r
70 public EvelOptionDouble mergereadavg;
\r
71 public EvelOptionDouble mergereadlast;
\r
72 public EvelOptionDouble mergereadmax;
\r
73 public EvelOptionDouble mergereadmin;
\r
74 public EvelOptionDouble mergewriteavg;
\r
75 public EvelOptionDouble mergewritelast;
\r
76 public EvelOptionDouble mergewritemax;
\r
77 public EvelOptionDouble mergewritemin;
\r
78 public EvelOptionDouble octetsreadavg;
\r
79 public EvelOptionDouble octetsreadlast;
\r
80 public EvelOptionDouble octetsreadmax;
\r
81 public EvelOptionDouble octetsreadmin;
\r
82 public EvelOptionDouble octetswriteavg;
\r
83 public EvelOptionDouble octetswritelast;
\r
84 public EvelOptionDouble octetswritemax;
\r
85 public EvelOptionDouble octetswritemin;
\r
86 public EvelOptionDouble opsreadavg;
\r
87 public EvelOptionDouble opsreadlast;
\r
88 public EvelOptionDouble opsreadmax;
\r
89 public EvelOptionDouble opsreadmin;
\r
90 public EvelOptionDouble opswriteavg;
\r
91 public EvelOptionDouble opswritelast;
\r
92 public EvelOptionDouble opswritemax;
\r
93 public EvelOptionDouble opswritemin;
\r
94 public EvelOptionDouble pendingopsavg;
\r
95 public EvelOptionDouble pendingopslast;
\r
96 public EvelOptionDouble pendingopsmax;
\r
97 public EvelOptionDouble pendingopsmin;
\r
98 public EvelOptionDouble timereadavg;
\r
99 public EvelOptionDouble timereadlast;
\r
100 public EvelOptionDouble timereadmax;
\r
101 public EvelOptionDouble timereadmin;
\r
102 public EvelOptionDouble timewriteavg;
\r
103 public EvelOptionDouble timewritelast;
\r
104 public EvelOptionDouble timewritemax;
\r
105 public EvelOptionDouble timewritemin;
\r
109 /**************************************************************************//**
\r
110 * Filesystem Usage.
\r
111 * JSON equivalent field: filesystemUsage
\r
112 *****************************************************************************/
\r
113 public class MEASUREMENT_FSYS_USE {
\r
114 String filesystem_name;
\r
115 double block_configured;
\r
118 double ephemeral_configured;
\r
119 double ephemeral_iops;
\r
120 double ephemeral_used;
\r
123 /**************************************************************************//**
\r
125 * JSON equivalent field: memoryUsage
\r
126 *****************************************************************************/
\r
127 public class MEASUREMENT_MEM_USE {
\r
131 public EvelOptionDouble memcache;
\r
132 public EvelOptionDouble memconfig;
\r
133 public EvelOptionDouble memfree;
\r
134 public EvelOptionDouble slabrecl;
\r
135 public EvelOptionDouble slabunrecl;
\r
136 public EvelOptionDouble memused;
\r
139 /**************************************************************************//**
\r
141 * JSON equivalent field: myerrors
\r
142 *****************************************************************************/
\r
143 public class MEASUREMENT_ERRORS {
\r
144 int receive_discards;
\r
145 int receive_myerrors;
\r
146 int transmit_discards;
\r
147 int transmit_myerrors;
\r
150 /**************************************************************************//**
\r
152 * JSON equivalent field: latencyBucketMeasure
\r
153 *****************************************************************************/
\r
154 public class MEASUREMENT_LATENCY_BUCKET {
\r
157 /***************************************************************************/
\r
158 /* Optional fields */
\r
159 /***************************************************************************/
\r
160 public EvelOptionDouble high_end;
\r
161 public EvelOptionDouble low_end;
\r
165 /**************************************************************************//**
\r
166 * Virtual NIC usage.
\r
167 * JSON equivalent field: vNicUsage
\r
168 *****************************************************************************/
\r
169 public class MEASUREMENT_VNIC_PERFORMANCE {
\r
171 String valuesaresuspect;
\r
172 /***************************************************************************/
\r
173 /* Optional fields */
\r
174 /***************************************************************************/
\r
175 /*Cumulative count of broadcast packets received as read at the end of
\r
176 the measurement interval*/
\r
177 public EvelOptionDouble recvd_bcast_packets_acc;
\r
178 /*Count of broadcast packets received within the measurement interval*/
\r
179 public EvelOptionDouble recvd_bcast_packets_delta;
\r
180 /*Cumulative count of discarded packets received as read at the end of
\r
181 the measurement interval*/
\r
182 public EvelOptionDouble recvd_discarded_packets_acc;
\r
183 /*Count of discarded packets received within the measurement interval*/
\r
184 public EvelOptionDouble recvd_discarded_packets_delta;
\r
185 /*Cumulative count of error packets received as read at the end of
\r
186 the measurement interval*/
\r
187 public EvelOptionDouble recvd_error_packets_acc;
\r
188 /*Count of error packets received within the measurement interval*/
\r
189 public EvelOptionDouble recvd_error_packets_delta;
\r
190 /*Cumulative count of multicast packets received as read at the end of
\r
191 the measurement interval*/
\r
192 public EvelOptionDouble recvd_mcast_packets_acc;
\r
193 /*Count of mcast packets received within the measurement interval*/
\r
194 public EvelOptionDouble recvd_mcast_packets_delta;
\r
195 /*Cumulative count of octets received as read at the end of
\r
196 the measurement interval*/
\r
197 public EvelOptionDouble recvd_octets_acc;
\r
198 /*Count of octets received within the measurement interval*/
\r
199 public EvelOptionDouble recvd_octets_delta;
\r
200 /*Cumulative count of all packets received as read at the end of
\r
201 the measurement interval*/
\r
202 public EvelOptionDouble recvd_total_packets_acc;
\r
203 /*Count of all packets received within the measurement interval*/
\r
204 public EvelOptionDouble recvd_total_packets_delta;
\r
205 /*Cumulative count of unicast packets received as read at the end of
\r
206 the measurement interval*/
\r
207 public EvelOptionDouble recvd_ucast_packets_acc;
\r
208 /*Count of unicast packets received within the measurement interval*/
\r
209 public EvelOptionDouble recvd_ucast_packets_delta;
\r
210 /*Cumulative count of transmitted broadcast packets at the end of
\r
211 the measurement interval*/
\r
212 public EvelOptionDouble tx_bcast_packets_acc;
\r
213 /*Count of transmitted broadcast packets within the measurement interval*/
\r
214 public EvelOptionDouble tx_bcast_packets_delta;
\r
215 /*Cumulative count of transmit discarded packets at the end of
\r
216 the measurement interval*/
\r
217 public EvelOptionDouble tx_discarded_packets_acc;
\r
218 /*Count of transmit discarded packets within the measurement interval*/
\r
219 public EvelOptionDouble tx_discarded_packets_delta;
\r
220 /*Cumulative count of transmit error packets at the end of
\r
221 the measurement interval*/
\r
222 public EvelOptionDouble tx_error_packets_acc;
\r
223 /*Count of transmit error packets within the measurement interval*/
\r
224 public EvelOptionDouble tx_error_packets_delta;
\r
225 /*Cumulative count of transmit multicast packets at the end of
\r
226 the measurement interval*/
\r
227 public EvelOptionDouble tx_mcast_packets_acc;
\r
228 /*Count of transmit multicast packets within the measurement interval*/
\r
229 public EvelOptionDouble tx_mcast_packets_delta;
\r
230 /*Cumulative count of transmit octets at the end of
\r
231 the measurement interval*/
\r
232 public EvelOptionDouble tx_octets_acc;
\r
233 /*Count of transmit octets received within the measurement interval*/
\r
234 public EvelOptionDouble tx_octets_delta;
\r
235 /*Cumulative count of all transmit packets at the end of
\r
236 the measurement interval*/
\r
237 public EvelOptionDouble tx_total_packets_acc;
\r
238 /*Count of transmit packets within the measurement interval*/
\r
239 public EvelOptionDouble tx_total_packets_delta;
\r
240 /*Cumulative count of all transmit unicast packets at the end of
\r
241 the measurement interval*/
\r
242 public EvelOptionDouble tx_ucast_packets_acc;
\r
243 /*Count of transmit unicast packets within the measurement interval*/
\r
244 public EvelOptionDouble tx_ucast_packets_delta;
\r
247 /**************************************************************************//**
\r
249 * JSON equivalent field: codecsInUse
\r
250 *****************************************************************************/
\r
251 public class MEASUREMENT_CODEC_USE {
\r
256 /**************************************************************************//**
\r
258 * JSON equivalent field: featuresInUse
\r
259 *****************************************************************************/
\r
260 public class MEASUREMENT_FEATURE_USE {
\r
262 int feature_utilization;
\r
266 /**************************************************************************//**
\r
267 * Custom Defined Measurement.
\r
268 * JSON equivalent field: measurements
\r
269 *****************************************************************************/
\r
270 public class CUSTOM_MEASUREMENT {
\r
275 /**************************************************************************//**
\r
276 * Measurement Group.
\r
277 * JSON equivalent field: additionalMeasurements
\r
278 *****************************************************************************/
\r
279 public class MEASUREMENT_GROUP {
\r
281 ArrayList<CUSTOM_MEASUREMENT> measurements;
\r
285 /***************************************************************************/
\r
286 /* Mandatory fields */
\r
287 /***************************************************************************/
\r
288 double measurement_interval;
\r
290 /***************************************************************************/
\r
291 /* Optional fields */
\r
292 /***************************************************************************/
\r
293 ArrayList<String[]> additional_info;
\r
294 ArrayList<MEASUREMENT_GROUP> additional_measurements;
\r
295 ArrayList<javax.json.JsonObject> additional_objects;
\r
296 ArrayList<MEASUREMENT_CODEC_USE> codec_usage;
\r
297 EvelOptionInt concurrent_sessions;
\r
298 EvelOptionInt configured_entities;
\r
299 ArrayList<MEASUREMENT_CPU_USE> cpu_usage;
\r
300 ArrayList<MEASUREMENT_DISK_USE> disk_usage;
\r
302 MEASUREMENT_ERRORS myerrors;
\r
303 ArrayList<MEASUREMENT_FEATURE_USE> feature_usage;
\r
304 ArrayList<MEASUREMENT_FSYS_USE> filesystem_usage;
\r
305 ArrayList<MEASUREMENT_LATENCY_BUCKET> latency_distribution;
\r
306 EvelOptionDouble mean_request_latency;
\r
307 ArrayList<MEASUREMENT_MEM_USE> mem_usage;
\r
308 EvelOptionInt media_ports_in_use;
\r
309 EvelOptionInt request_rate;
\r
310 EvelOptionInt vnfc_scaling_metric;
\r
311 ArrayList<MEASUREMENT_VNIC_PERFORMANCE> vnic_usage;
\r
314 /***************************************************************************/
\r
315 /* Optional fields */
\r
316 /***************************************************************************/
\r
318 private static final Logger LOGGER = Logger.getLogger( EvelScalingMeasurement.class.getName() );
\r
321 /**************************************************************************//**
\r
322 * Constructs a new Measurement event.
\r
324 * @note The mandatory fields on the Measurement must be supplied to this
\r
325 * factory function and are immutable once set. Optional fields have
\r
326 * explicit setter functions, but again values may only be set once so
\r
327 * that the Measurement has immutable properties.
\r
329 * @param measurement_interval
\r
331 *****************************************************************************/
\r
332 public EvelScalingMeasurement(double meas_interval,String evname,String evid)
\r
334 super(evname,evid);
\r
338 /***************************************************************************/
\r
339 /* Check preconditions. */
\r
340 /***************************************************************************/
\r
341 assert(meas_interval >= 0.0);
\r
343 LOGGER.debug("New measurement is at "+meas_interval);
\r
345 /***************************************************************************/
\r
346 /* Initialize the header & the measurement fields. */
\r
347 /***************************************************************************/
\r
348 event_domain = EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT;
\r
349 //initialize optional fields
\r
350 measurement_interval = meas_interval;
\r
351 additional_info = null;
\r
352 additional_measurements = null;
\r
353 additional_objects = null;
\r
357 filesystem_usage = null;
\r
358 latency_distribution = null;
\r
360 codec_usage = null;
\r
361 feature_usage = null;
\r
364 mean_request_latency = new EvelOptionDouble(false, 0.0);
\r
365 vnfc_scaling_metric = new EvelOptionInt(false, 0);
\r
366 concurrent_sessions = new EvelOptionInt(false, 0);
\r
367 configured_entities = new EvelOptionInt(false, 0);
\r
368 media_ports_in_use = new EvelOptionInt(false, 0);
\r
369 request_rate = new EvelOptionInt(false, 0);
\r
375 /**************************************************************************//**
\r
376 * Set the Event Type property of the Measurement.
\r
378 * @note The property is treated as immutable: it is only valid to call
\r
379 * the setter once. However, we don't assert if the caller tries to
\r
380 * overwrite, just ignoring the update instead.
\r
383 * @param type The Event Type to be set. ASCIIZ string. The caller
\r
384 * does not need to preserve the value once the function
\r
386 *****************************************************************************/
\r
387 public void evel_measurement_type_set(String typ)
\r
391 /***************************************************************************/
\r
392 /* Check preconditions and call evel_header_type_set. */
\r
393 /***************************************************************************/
\r
394 assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT);
\r
395 evel_header_type_set(typ);
\r
400 /**************************************************************************//**
\r
401 * Add an additional value name/value pair to the Measurement.
\r
403 * The name and value are null delimited ASCII strings. The library takes
\r
404 * a copy so the caller does not have to preserve values after the function
\r
407 * @param name ASCIIZ string with the attribute's name. The caller
\r
408 * does not need to preserve the value once the function
\r
410 * @param value ASCIIZ string with the attribute's value. The caller
\r
411 * does not need to preserve the value once the function
\r
413 *****************************************************************************/
\r
414 public void evel_measurement_addl_info_add(String name, String value)
\r
416 String[] addl_info = null;
\r
419 /***************************************************************************/
\r
420 /* Check preconditions. */
\r
421 /***************************************************************************/
\r
422 assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT);
\r
423 assert(name != null);
\r
424 assert(value != null);
\r
426 if( additional_info == null )
\r
428 additional_info = new ArrayList<String[]>();
\r
431 LOGGER.debug(MessageFormat.format("Adding name={0} value={1}", name, value));
\r
432 addl_info = new String[2];
\r
433 assert(addl_info != null);
\r
434 addl_info[0] = name;
\r
435 addl_info[1] = value;
\r
437 additional_info.add(addl_info);
\r
442 /**************************************************************************//**
\r
443 * Set the Concurrent Sessions property of the Measurement.
\r
445 * @note The property is treated as immutable: it is only valid to call
\r
446 * the setter once. However, we don't assert if the caller tries to
\r
447 * overwrite, just ignoring the update instead.
\r
450 * @param concurrent_sessions The Concurrent Sessions to be set.
\r
451 *****************************************************************************/
\r
452 public void evel_measurement_conc_sess_set(int conc_sessions)
\r
456 /***************************************************************************/
\r
457 /* Check preconditions. */
\r
458 /***************************************************************************/
\r
459 assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT);
\r
460 assert(conc_sessions >= 0);
\r
462 concurrent_sessions.SetValuePr(conc_sessions,"Concurrent Sessions");
\r
467 /**************************************************************************//**
\r
468 * Set the Configured Entities property of the Measurement.
\r
470 * @note The property is treated as immutable: it is only valid to call
\r
471 * the setter once. However, we don't assert if the caller tries to
\r
472 * overwrite, just ignoring the update instead.
\r
475 * @param configured_entities The Configured Entities to be set.
\r
476 *****************************************************************************/
\r
477 public void evel_measurement_cfg_ents_set(EvelScalingMeasurement measurement,
\r
478 int config_entities)
\r
482 /***************************************************************************/
\r
483 /* Check preconditions. */
\r
484 /***************************************************************************/
\r
485 assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT);
\r
486 assert(config_entities >= 0);
\r
488 configured_entities.SetValuePr(config_entities,"Configured Entities");
\r
493 /**************************************************************************//**
\r
494 * Add an additional set of myerrors to the Measurement.
\r
496 * @note The property is treated as immutable: it is only valid to call
\r
497 * the setter once. However, we don't assert if the caller tries to
\r
498 * overwrite, just ignoring the update instead.
\r
500 * @param measurement Pointer to the measurement.
\r
501 * @param receive_discard The number of receive discards.
\r
502 * @param receive_error The number of receive myerrors.
\r
503 * @param transmit_discard The number of transmit discards.
\r
504 * @param transmit_error The number of transmit myerrors.
\r
505 *****************************************************************************/
\r
506 public void evel_measurement_myerrors_set(
\r
507 int receive_discard,
\r
509 int transmit_discard,
\r
510 int transmit_error)
\r
515 /***************************************************************************/
\r
516 /* Check preconditions. */
\r
517 /***************************************************************************/
\r
518 assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT);
\r
519 assert(receive_discard >= 0);
\r
520 assert(receive_error >= 0);
\r
521 assert(transmit_discard >= 0);
\r
522 assert(transmit_error >= 0);
\r
524 if (errstat == false)
\r
527 LOGGER.debug(MessageFormat.format("Adding myerrors: {0}, {1}, {2}, {3}",
\r
532 if( myerrors == null )myerrors = new MEASUREMENT_ERRORS();
\r
533 myerrors.receive_discards = receive_discard;
\r
534 myerrors.receive_myerrors = receive_error;
\r
535 myerrors.transmit_discards = transmit_discard;
\r
536 myerrors.transmit_myerrors = transmit_error;
\r
540 LOGGER.debug(MessageFormat.format("Adding myerrors: {0}, {1}; {2}, {3} myerrors already set: {4}, {5}; {6}, {7}",
\r
545 myerrors.receive_discards,
\r
546 myerrors.receive_myerrors,
\r
547 myerrors.transmit_discards,
\r
548 myerrors.transmit_myerrors));
\r
554 /**************************************************************************//**
\r
555 * Set the Mean Request Latency property of the Measurement.
\r
557 * @note The property is treated as immutable: it is only valid to call
\r
558 * the setter once. However, we don't assert if the caller tries to
\r
559 * overwrite, just ignoring the update instead.
\r
562 * @param mean_request_latency The Mean Request Latency to be set.
\r
563 *****************************************************************************/
\r
564 public void evel_measurement_mean_req_lat_set(
\r
565 double mean_req_latency)
\r
569 /***************************************************************************/
\r
570 /* Check preconditions. */
\r
571 /***************************************************************************/
\r
572 assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT);
\r
573 assert(mean_req_latency >= 0.0);
\r
575 mean_request_latency.SetValuePr(mean_req_latency,"Mean Request Latency");
\r
581 /**************************************************************************//**
\r
582 * Set the Request Rate property of the Measurement.
\r
584 * @note The property is treated as immutable: it is only valid to call
\r
585 * the setter once. However, we don't assert if the caller tries to
\r
586 * overwrite, just ignoring the update instead.
\r
589 * @param request_rate The Request Rate to be set.
\r
590 *****************************************************************************/
\r
591 public void evel_measurement_request_rate_set(int req_rate)
\r
595 /***************************************************************************/
\r
596 /* Check preconditions. */
\r
597 /***************************************************************************/
\r
598 assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT);
\r
599 assert(req_rate >= 0);
\r
601 request_rate.SetValuePr(req_rate,"Request Rate");
\r
606 /**************************************************************************//**
\r
607 * Add an additional CPU usage value name/value pair to the Measurement.
\r
609 * The name and value are null delimited ASCII strings. The library takes
\r
610 * a copy so the caller does not have to preserve values after the function
\r
614 * @param id ASCIIZ string with the CPU's identifier.
\r
615 * @param usage CPU utilization.
\r
616 *****************************************************************************/
\r
617 public MEASUREMENT_CPU_USE evel_measurement_new_cpu_use_add(String id, double usage)
\r
621 /***************************************************************************/
\r
622 /* Check assumptions. */
\r
623 /***************************************************************************/
\r
624 assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT);
\r
625 assert(id != null);
\r
626 assert(usage >= 0.0);
\r
628 /***************************************************************************/
\r
629 /* Allocate a container for the value and push onto the list. */
\r
630 /***************************************************************************/
\r
631 LOGGER.debug(MessageFormatter.format("Adding id={0} usage={1}", id, usage));
\r
632 MEASUREMENT_CPU_USE cpu_use = new MEASUREMENT_CPU_USE();
\r
633 assert(cpu_use != null);
\r
635 cpu_use.usage = usage;
\r
636 cpu_use.idle = new EvelOptionDouble();
\r
637 cpu_use.intrpt = new EvelOptionDouble();
\r
638 cpu_use.nice = new EvelOptionDouble();
\r
639 cpu_use.softirq = new EvelOptionDouble();
\r
640 cpu_use.steal = new EvelOptionDouble();
\r
641 cpu_use.sys = new EvelOptionDouble();
\r
642 cpu_use.user = new EvelOptionDouble();
\r
643 cpu_use.wait = new EvelOptionDouble();
\r
645 if( cpu_usage == null ){
\r
646 cpu_usage = new ArrayList<MEASUREMENT_CPU_USE>();
\r
647 if( cpu_usage == null)LOGGER.error("Unable to allocate new cpu usage");
\r
650 cpu_usage.add(cpu_use);
\r
656 /**************************************************************************//**
\r
657 * Set the CPU Idle value in measurement interval
\r
658 * percentage of CPU time spent in the idle task
\r
660 * @note The property is treated as immutable: it is only valid to call
\r
661 * the setter once. However, we don't assert if the caller tries to
\r
662 * overwrite, just ignoring the update instead.
\r
664 * @param cpu_use Pointer to the CPU Use.
\r
665 * @param val double
\r
666 *****************************************************************************/
\r
667 public void evel_measurement_cpu_use_idle_set(MEASUREMENT_CPU_USE cpu_use,
\r
671 cpu_use.idle.SetValuePr(val,"CPU idle time");
\r
675 /**************************************************************************//**
\r
676 * Set the percentage of time spent servicing interrupts
\r
678 * @note The property is treated as immutable: it is only valid to call
\r
679 * the setter once. However, we don't assert if the caller tries to
\r
680 * overwrite, just ignoring the update instead.
\r
682 * @param cpu_use Pointer to the CPU Use.
\r
683 * @param val double
\r
684 *****************************************************************************/
\r
685 public void evel_measurement_cpu_use_interrupt_set(MEASUREMENT_CPU_USE cpu_use,
\r
689 cpu_use.intrpt.SetValuePr(val,"CPU interrupt value");
\r
695 /**************************************************************************//**
\r
696 * Set the percentage of time spent running user space processes that have been niced
\r
698 * @note The property is treated as immutable: it is only valid to call
\r
699 * the setter once. However, we don't assert if the caller tries to
\r
700 * overwrite, just ignoring the update instead.
\r
702 * @param cpu_use Pointer to the CPU Use.
\r
703 * @param val double
\r
704 *****************************************************************************/
\r
705 public void evel_measurement_cpu_use_nice_set(MEASUREMENT_CPU_USE cpu_use,
\r
709 cpu_use.nice.SetValuePr(val, "CPU nice value");
\r
715 /**************************************************************************//**
\r
716 * Set the percentage of time spent handling soft irq interrupts
\r
718 * @note The property is treated as immutable: it is only valid to call
\r
719 * the setter once. However, we don't assert if the caller tries to
\r
720 * overwrite, just ignoring the update instead.
\r
722 * @param cpu_use Pointer to the CPU Use.
\r
723 * @param val double
\r
724 *****************************************************************************/
\r
725 public void evel_measurement_cpu_use_softirq_set(MEASUREMENT_CPU_USE cpu_use,
\r
729 cpu_use.softirq.SetValuePr(val, "CPU Soft IRQ value");
\r
734 /**************************************************************************//**
\r
735 * Set the percentage of time spent in involuntary wait
\r
737 * @note The property is treated as immutable: it is only valid to call
\r
738 * the setter once. However, we don't assert if the caller tries to
\r
739 * overwrite, just ignoring the update instead.
\r
741 * @param cpu_use Pointer to the CPU Use.
\r
742 * @param val double
\r
743 *****************************************************************************/
\r
744 public void evel_measurement_cpu_use_steal_set(MEASUREMENT_CPU_USE cpu_use,
\r
748 cpu_use.steal.SetValuePr(val,"CPU involuntary wait");
\r
753 /**************************************************************************//**
\r
754 * Set the percentage of time spent on system tasks running the kernel
\r
756 * @note The property is treated as immutable: it is only valid to call
\r
757 * the setter once. However, we don't assert if the caller tries to
\r
758 * overwrite, just ignoring the update instead.
\r
760 * @param cpu_use Pointer to the CPU Use.
\r
761 * @param val double
\r
762 *****************************************************************************/
\r
763 public void evel_measurement_cpu_use_system_set(MEASUREMENT_CPU_USE cpu_use,
\r
767 cpu_use.sys.SetValuePr(val,"CPU System load");
\r
772 /**************************************************************************//**
\r
773 * Set the percentage of time spent running un-niced user space processes
\r
775 * @note The property is treated as immutable: it is only valid to call
\r
776 * the setter once. However, we don't assert if the caller tries to
\r
777 * overwrite, just ignoring the update instead.
\r
779 * @param cpu_use Pointer to the CPU Use.
\r
780 * @param val double
\r
781 *****************************************************************************/
\r
782 public void evel_measurement_cpu_use_usageuser_set(MEASUREMENT_CPU_USE cpu_use,
\r
786 cpu_use.user.SetValuePr(val,"CPU User load value");
\r
791 /**************************************************************************//**
\r
792 * Set the percentage of CPU time spent waiting for I/O operations to complete
\r
794 * @note The property is treated as immutable: it is only valid to call
\r
795 * the setter once. However, we don't assert if the caller tries to
\r
796 * overwrite, just ignoring the update instead.
\r
798 * @param cpu_use Pointer to the CPU Use.
\r
799 * @param val double
\r
800 *****************************************************************************/
\r
801 public void evel_measurement_cpu_use_wait_set(MEASUREMENT_CPU_USE cpu_use,
\r
805 cpu_use.wait.SetValuePr(val, "CPU Wait IO value");
\r
811 /**************************************************************************//**
\r
812 * Add an additional Memory usage value name/value pair to the Measurement.
\r
814 * The name and value are null delimited ASCII strings. The library takes
\r
815 * a copy so the caller does not have to preserve values after the function
\r
819 * @param id ASCIIZ string with the Memory identifier.
\r
820 * @param vmidentifier ASCIIZ string with the VM's identifier.
\r
821 * @param membuffsz Memory Size.
\r
823 * @return Returns pointer to memory use structure in measurements
\r
824 *****************************************************************************/
\r
825 public MEASUREMENT_MEM_USE evel_measurement_new_mem_use_add(
\r
826 String id, String vmidentifier, double membuffsz)
\r
828 MEASUREMENT_MEM_USE mem_use = null;
\r
831 /***************************************************************************/
\r
832 /* Check assumptions. */
\r
833 /***************************************************************************/
\r
834 assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT);
\r
835 assert(id != null);
\r
836 assert(membuffsz >= 0.0);
\r
838 /***************************************************************************/
\r
839 /* Allocate a container for the value and push onto the list. */
\r
840 /***************************************************************************/
\r
841 LOGGER.debug(MessageFormatter.format("Adding id={0} buffer size={1}", id, membuffsz));
\r
842 mem_use = new MEASUREMENT_MEM_USE();
\r
843 assert(mem_use != null);
\r
845 mem_use.vmid = vmidentifier;
\r
846 mem_use.membuffsz = membuffsz;
\r
847 mem_use.memcache = new EvelOptionDouble();
\r
848 mem_use.memconfig= new EvelOptionDouble();
\r
849 mem_use.memfree= new EvelOptionDouble();
\r
850 mem_use.slabrecl= new EvelOptionDouble();
\r
851 mem_use.slabunrecl= new EvelOptionDouble();
\r
852 mem_use.memused= new EvelOptionDouble();
\r
854 assert(mem_use.id != null);
\r
856 if( mem_usage == null ){
\r
857 mem_usage = new ArrayList<MEASUREMENT_MEM_USE>();
\r
858 if( mem_usage == null )LOGGER.error("Unable to allocate new memory usage");
\r
862 mem_usage.add(mem_use);
\r
868 /**************************************************************************//**
\r
869 * Set kilobytes of memory used for cache
\r
871 * @note The property is treated as immutable: it is only valid to call
\r
872 * the setter once. However, we don't assert if the caller tries to
\r
873 * overwrite, just ignoring the update instead.
\r
875 * @param mem_use Pointer to the Memory Use.
\r
876 * @param val double
\r
877 *****************************************************************************/
\r
878 public void evel_measurement_mem_use_memcache_set(MEASUREMENT_MEM_USE mem_use,
\r
882 mem_use.memcache.SetValuePr(val,"Memory cache value");
\r
887 /**************************************************************************//**
\r
888 * Set kilobytes of memory configured in the virtual machine on which the VNFC reporting
\r
890 * @note The property is treated as immutable: it is only valid to call
\r
891 * the setter once. However, we don't assert if the caller tries to
\r
892 * overwrite, just ignoring the update instead.
\r
894 * @param mem_use Pointer to the Memory Use.
\r
895 * @param val double
\r
896 *****************************************************************************/
\r
897 public void evel_measurement_mem_use_memconfig_set(MEASUREMENT_MEM_USE mem_use,
\r
901 mem_use.memconfig.SetValuePr(val, "Memory configured value");
\r
905 /**************************************************************************//**
\r
906 * Set kilobytes of physical RAM left unused by the system
\r
908 * @note The property is treated as immutable: it is only valid to call
\r
909 * the setter once. However, we don't assert if the caller tries to
\r
910 * overwrite, just ignoring the update instead.
\r
912 * @param mem_use Pointer to the Memory Use.
\r
913 * @param val double
\r
914 *****************************************************************************/
\r
915 public void evel_measurement_mem_use_memfree_set(MEASUREMENT_MEM_USE mem_use,
\r
919 mem_use.memfree.SetValuePr(val, "Memory freely available value");
\r
923 /**************************************************************************//**
\r
924 * Set the part of the slab that can be reclaimed such as caches measured in kilobytes
\r
926 * @note The property is treated as immutable: it is only valid to call
\r
927 * the setter once. However, we don't assert if the caller tries to
\r
928 * overwrite, just ignoring the update instead.
\r
930 * @param mem_use Pointer to the Memory Use.
\r
931 * @param val double
\r
932 *****************************************************************************/
\r
933 public void evel_measurement_mem_use_slab_reclaimed_set(MEASUREMENT_MEM_USE mem_use,
\r
937 mem_use.slabrecl.SetValuePr(val, "Memory reclaimable slab set");
\r
941 /**************************************************************************//**
\r
942 * Set the part of the slab that cannot be reclaimed such as caches measured in kilobytes
\r
944 * @note The property is treated as immutable: it is only valid to call
\r
945 * the setter once. However, we don't assert if the caller tries to
\r
946 * overwrite, just ignoring the update instead.
\r
948 * @param mem_use Pointer to the Memory Use.
\r
949 * @param val double
\r
950 *****************************************************************************/
\r
951 public void evel_measurement_mem_use_slab_unreclaimable_set(MEASUREMENT_MEM_USE mem_use,
\r
955 mem_use.slabunrecl.SetValuePr(val, "Memory unreclaimable slab set");
\r
959 /**************************************************************************//**
\r
960 * Set the total memory minus the sum of free, buffered, cached and slab memory in kilobytes
\r
962 * @note The property is treated as immutable: it is only valid to call
\r
963 * the setter once. However, we don't assert if the caller tries to
\r
964 * overwrite, just ignoring the update instead.
\r
966 * @param mem_use Pointer to the Memory Use.
\r
967 * @param val double
\r
968 *****************************************************************************/
\r
969 public void evel_measurement_mem_use_usedup_set(MEASUREMENT_MEM_USE mem_use,
\r
973 mem_use.memused.SetValuePr(val, "Memory usedup total set");
\r
977 /**************************************************************************//**
\r
978 * Add an additional Disk usage value name/value pair to the Measurement.
\r
980 * The name and value are null delimited ASCII strings. The library takes
\r
981 * a copy so the caller does not have to preserve values after the function
\r
985 * @param id ASCIIZ string with the CPU's identifier.
\r
986 * @param usage Disk utilization.
\r
987 *****************************************************************************/
\r
988 public MEASUREMENT_DISK_USE evel_measurement_new_disk_use_add(String id)
\r
990 MEASUREMENT_DISK_USE disk_use = null;
\r
993 /***************************************************************************/
\r
994 /* Check assumptions. */
\r
995 /***************************************************************************/
\r
996 assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT);
\r
997 assert(id != null);
\r
999 /***************************************************************************/
\r
1000 /* Allocate a container for the value and push onto the list. */
\r
1001 /***************************************************************************/
\r
1002 LOGGER.debug(MessageFormatter.format("Adding id={0} disk usage", id));
\r
1003 disk_use = new MEASUREMENT_DISK_USE();
\r
1004 assert(disk_use != null);
\r
1006 assert(disk_use.id != null);
\r
1008 disk_use.iotimeavg= new EvelOptionDouble();
\r
1009 disk_use.iotimelast= new EvelOptionDouble();
\r
1010 disk_use.iotimemax= new EvelOptionDouble();
\r
1011 disk_use.iotimemin= new EvelOptionDouble();
\r
1012 disk_use.mergereadavg= new EvelOptionDouble();
\r
1013 disk_use.mergereadlast= new EvelOptionDouble();
\r
1014 disk_use.mergereadmax= new EvelOptionDouble();
\r
1015 disk_use.mergereadmin= new EvelOptionDouble();
\r
1016 disk_use.mergewriteavg= new EvelOptionDouble();
\r
1017 disk_use.mergewritelast= new EvelOptionDouble();
\r
1018 disk_use.mergewritemax= new EvelOptionDouble();
\r
1019 disk_use.mergewritemin= new EvelOptionDouble();
\r
1020 disk_use.octetsreadavg= new EvelOptionDouble();
\r
1021 disk_use.octetsreadlast= new EvelOptionDouble();
\r
1022 disk_use.octetsreadmax= new EvelOptionDouble();
\r
1023 disk_use.octetsreadmin= new EvelOptionDouble();
\r
1024 disk_use.octetswriteavg= new EvelOptionDouble();
\r
1025 disk_use.octetswritelast= new EvelOptionDouble();
\r
1026 disk_use.octetswritemax= new EvelOptionDouble();
\r
1027 disk_use.octetswritemin= new EvelOptionDouble();
\r
1028 disk_use.opsreadavg= new EvelOptionDouble();
\r
1029 disk_use.opsreadlast= new EvelOptionDouble();
\r
1030 disk_use.opsreadmax= new EvelOptionDouble();
\r
1031 disk_use.opsreadmin= new EvelOptionDouble();
\r
1032 disk_use.opswriteavg= new EvelOptionDouble();
\r
1033 disk_use.opswritelast= new EvelOptionDouble();
\r
1034 disk_use.opswritemax= new EvelOptionDouble();
\r
1035 disk_use.opswritemin= new EvelOptionDouble();
\r
1036 disk_use.pendingopsavg= new EvelOptionDouble();
\r
1037 disk_use.pendingopslast= new EvelOptionDouble();
\r
1038 disk_use.pendingopsmax= new EvelOptionDouble();
\r
1039 disk_use.pendingopsmin= new EvelOptionDouble();
\r
1040 disk_use.timereadavg= new EvelOptionDouble();
\r
1041 disk_use.timereadlast= new EvelOptionDouble();
\r
1042 disk_use.timereadmax= new EvelOptionDouble();
\r
1043 disk_use.timereadmin= new EvelOptionDouble();
\r
1044 disk_use.timewriteavg= new EvelOptionDouble();
\r
1045 disk_use.timewritelast= new EvelOptionDouble();
\r
1046 disk_use.timewritemax= new EvelOptionDouble();
\r
1047 disk_use.timewritemin= new EvelOptionDouble();
\r
1049 if( disk_usage == null ){
\r
1050 disk_usage = new ArrayList<MEASUREMENT_DISK_USE>();
\r
1051 if( disk_usage == null ) LOGGER.error("Unable to allocate new disk usage");
\r
1055 disk_usage.add(disk_use);
\r
1062 /**************************************************************************//**
\r
1063 * Set milliseconds spent doing input/output operations over 1 sec; treat
\r
1064 * this metric as a device load percentage where 1000ms matches 100% load;
\r
1065 * provide the average over the measurement interval
\r
1067 * @note The property is treated as immutable: it is only valid to call
\r
1068 * the setter once. However, we don't assert if the caller tries to
\r
1069 * overwrite, just ignoring the update instead.
\r
1071 * @param disk_use Pointer to the Disk Use.
\r
1072 * @param val double
\r
1073 *****************************************************************************/
\r
1074 public void evel_measurement_disk_use_iotimeavg_set(MEASUREMENT_DISK_USE disk_use,
\r
1078 disk_use.iotimeavg.SetValuePr(val,"Disk ioload set");
\r
1082 /**************************************************************************//**
\r
1083 * Set milliseconds spent doing input/output operations over 1 sec; treat
\r
1084 * this metric as a device load percentage where 1000ms matches 100% load;
\r
1085 * provide the last value within the measurement interval
\r
1087 * @note The property is treated as immutable: it is only valid to call
\r
1088 * the setter once. However, we don't assert if the caller tries to
\r
1089 * overwrite, just ignoring the update instead.
\r
1091 * @param disk_use Pointer to the Disk Use.
\r
1092 * @param val double
\r
1093 *****************************************************************************/
\r
1094 public void evel_measurement_disk_use_iotimelast_set(MEASUREMENT_DISK_USE disk_use,
\r
1098 disk_use.iotimelast.SetValuePr(val, "Disk ioloadlast set");
\r
1102 /**************************************************************************//**
\r
1103 * Set milliseconds spent doing input/output operations over 1 sec; treat
\r
1104 * this metric as a device load percentage where 1000ms matches 100% load;
\r
1105 * provide the maximum value within the measurement interval
\r
1107 * @note The property is treated as immutable: it is only valid to call
\r
1108 * the setter once. However, we don't assert if the caller tries to
\r
1109 * overwrite, just ignoring the update instead.
\r
1111 * @param disk_use Pointer to the Disk Use.
\r
1112 * @param val double
\r
1113 *****************************************************************************/
\r
1114 public void evel_measurement_disk_use_iotimemax_set(MEASUREMENT_DISK_USE disk_use,
\r
1118 disk_use.iotimemax.SetValuePr(val, "Disk ioloadmax set");
\r
1122 /**************************************************************************//**
\r
1123 * Set milliseconds spent doing input/output operations over 1 sec; treat
\r
1124 * this metric as a device load percentage where 1000ms matches 100% load;
\r
1125 * provide the minimum value within the measurement interval
\r
1127 * @note The property is treated as immutable: it is only valid to call
\r
1128 * the setter once. However, we don't assert if the caller tries to
\r
1129 * overwrite, just ignoring the update instead.
\r
1131 * @param disk_use Pointer to the Disk Use.
\r
1132 * @param val double
\r
1133 *****************************************************************************/
\r
1134 public void evel_measurement_disk_use_iotimemin_set(MEASUREMENT_DISK_USE disk_use,
\r
1138 disk_use.iotimemin.SetValuePr(val, "Disk ioloadmin set");
\r
1142 /**************************************************************************//**
\r
1143 * Set number of logical read operations that were merged into physical read
\r
1144 * operations, e.g., two logical reads were served by one physical disk access;
\r
1145 * provide the average measurement within the measurement interval
\r
1147 * @note The property is treated as immutable: it is only valid to call
\r
1148 * the setter once. However, we don't assert if the caller tries to
\r
1149 * overwrite, just ignoring the update instead.
\r
1151 * @param disk_use Pointer to the Disk Use.
\r
1152 * @param val double
\r
1153 *****************************************************************************/
\r
1154 public void evel_measurement_disk_use_mergereadavg_set(MEASUREMENT_DISK_USE disk_use,
\r
1158 disk_use.mergereadavg.SetValuePr(val, "Disk Merged read average set");
\r
1161 /**************************************************************************//**
\r
1162 * Set number of logical read operations that were merged into physical read
\r
1163 * operations, e.g., two logical reads were served by one physical disk access;
\r
1164 * provide the last measurement within the measurement interval
\r
1166 * @note The property is treated as immutable: it is only valid to call
\r
1167 * the setter once. However, we don't assert if the caller tries to
\r
1168 * overwrite, just ignoring the update instead.
\r
1170 * @param disk_use Pointer to the Disk Use.
\r
1171 * @param val double
\r
1172 *****************************************************************************/
\r
1173 public void evel_measurement_disk_use_mergereadlast_set(MEASUREMENT_DISK_USE disk_use,
\r
1177 disk_use.mergereadlast.SetValuePr(val, "Disk mergedload last set");
\r
1180 /**************************************************************************//**
\r
1181 * Set number of logical read operations that were merged into physical read
\r
1182 * operations, e.g., two logical reads were served by one physical disk access;
\r
1183 * provide the maximum measurement within the measurement interval
\r
1185 * @note The property is treated as immutable: it is only valid to call
\r
1186 * the setter once. However, we don't assert if the caller tries to
\r
1187 * overwrite, just ignoring the update instead.
\r
1189 * @param disk_use Pointer to the Disk Use.
\r
1190 * @param val double
\r
1191 *****************************************************************************/
\r
1192 public void evel_measurement_disk_use_mergereadmax_set(MEASUREMENT_DISK_USE disk_use,
\r
1196 disk_use.mergereadmax.SetValuePr(val, "Disk merged loadmax set");
\r
1200 /**************************************************************************//**
\r
1201 * Set number of logical read operations that were merged into physical read
\r
1202 * operations, e.g., two logical reads were served by one physical disk access;
\r
1203 * provide the minimum measurement within the measurement interval
\r
1205 * @note The property is treated as immutable: it is only valid to call
\r
1206 * the setter once. However, we don't assert if the caller tries to
\r
1207 * overwrite, just ignoring the update instead.
\r
1209 * @param disk_use Pointer to the Disk Use.
\r
1210 * @param val double
\r
1211 *****************************************************************************/
\r
1212 public void evel_measurement_disk_use_mergereadmin_set(MEASUREMENT_DISK_USE disk_use,
\r
1216 disk_use.mergereadmin.SetValuePr(val, "Disk merged loadmin set");
\r
1219 /**************************************************************************//**
\r
1220 * Set number of logical write operations that were merged into physical read
\r
1221 * operations, e.g., two logical writes were served by one physical disk access;
\r
1222 * provide the last measurement within the measurement interval
\r
1224 * @note The property is treated as immutable: it is only valid to call
\r
1225 * the setter once. However, we don't assert if the caller tries to
\r
1226 * overwrite, just ignoring the update instead.
\r
1228 * @param disk_use Pointer to the Disk Use.
\r
1229 * @param val double
\r
1230 *****************************************************************************/
\r
1231 public void evel_measurement_disk_use_mergewritelast_set(MEASUREMENT_DISK_USE disk_use,
\r
1235 disk_use.mergewritelast.SetValuePr(val, "Disk merged writelast set");
\r
1238 /**************************************************************************//**
\r
1239 * Set number of logical write operations that were merged into physical read
\r
1240 * operations, e.g., two logical writes were served by one physical disk access;
\r
1241 * provide the maximum measurement within the measurement interval
\r
1243 * @note The property is treated as immutable: it is only valid to call
\r
1244 * the setter once. However, we don't assert if the caller tries to
\r
1245 * overwrite, just ignoring the update instead.
\r
1247 * @param disk_use Pointer to the Disk Use.
\r
1248 * @param val double
\r
1249 *****************************************************************************/
\r
1250 public void evel_measurement_disk_use_mergewritemax_set(MEASUREMENT_DISK_USE disk_use,
\r
1254 disk_use.mergewritemax.SetValuePr(val, "Disk writemax set");
\r
1257 /**************************************************************************//**
\r
1258 * Set number of logical write operations that were merged into physical read
\r
1259 * operations, e.g., two logical writes were served by one physical disk access;
\r
1260 * provide the maximum measurement within the measurement interval
\r
1262 * @note The property is treated as immutable: it is only valid to call
\r
1263 * the setter once. However, we don't assert if the caller tries to
\r
1264 * overwrite, just ignoring the update instead.
\r
1266 * @param disk_use Pointer to the Disk Use.
\r
1267 * @param val double
\r
1268 *****************************************************************************/
\r
1269 public void evel_measurement_disk_use_mergewritemin_set(MEASUREMENT_DISK_USE disk_use,
\r
1273 disk_use.mergewritemin.SetValuePr(val, "Disk writemin set");
\r
1277 /**************************************************************************//**
\r
1278 * Set number of octets per second read from a disk or partition;
\r
1279 * provide the average measurement within the measurement interval
\r
1281 * @note The property is treated as immutable: it is only valid to call
\r
1282 * the setter once. However, we don't assert if the caller tries to
\r
1283 * overwrite, just ignoring the update instead.
\r
1285 * @param disk_use Pointer to the Disk Use.
\r
1286 * @param val double
\r
1287 *****************************************************************************/
\r
1288 public void evel_measurement_disk_use_octetsreadavg_set(MEASUREMENT_DISK_USE disk_use,
\r
1292 disk_use.octetsreadavg.SetValuePr(val, "Octets readavg set");
\r
1296 /**************************************************************************//**
\r
1297 * Set number of octets per second read from a disk or partition;
\r
1298 * provide the last measurement within the measurement interval
\r
1300 * @note The property is treated as immutable: it is only valid to call
\r
1301 * the setter once. However, we don't assert if the caller tries to
\r
1302 * overwrite, just ignoring the update instead.
\r
1304 * @param disk_use Pointer to the Disk Use.
\r
1305 * @param val double
\r
1306 *****************************************************************************/
\r
1307 public void evel_measurement_disk_use_octetsreadlast_set(MEASUREMENT_DISK_USE disk_use,
\r
1311 disk_use.octetsreadlast.SetValuePr(val, "Octets readlast set");
\r
1315 /**************************************************************************//**
\r
1316 * Set number of octets per second read from a disk or partition;
\r
1317 * provide the maximum measurement within the measurement interval
\r
1319 * @note The property is treated as immutable: it is only valid to call
\r
1320 * the setter once. However, we don't assert if the caller tries to
\r
1321 * overwrite, just ignoring the update instead.
\r
1323 * @param disk_use Pointer to the Disk Use.
\r
1324 * @param val double
\r
1325 *****************************************************************************/
\r
1326 public void evel_measurement_disk_use_octetsreadmax_set(MEASUREMENT_DISK_USE disk_use,
\r
1330 disk_use.octetsreadmax.SetValuePr(val, "Octets readmax set");
\r
1333 /**************************************************************************//**
\r
1334 * Set number of octets per second read from a disk or partition;
\r
1335 * provide the minimum measurement within the measurement interval
\r
1337 * @note The property is treated as immutable: it is only valid to call
\r
1338 * the setter once. However, we don't assert if the caller tries to
\r
1339 * overwrite, just ignoring the update instead.
\r
1341 * @param disk_use Pointer to the Disk Use.
\r
1342 * @param val double
\r
1343 *****************************************************************************/
\r
1344 public void evel_measurement_disk_use_octetsreadmin_set(MEASUREMENT_DISK_USE disk_use,
\r
1348 disk_use.octetsreadmin.SetValuePr(val, "Octets readmin set");
\r
1351 /**************************************************************************//**
\r
1352 * Set number of octets per second written to a disk or partition;
\r
1353 * provide the average measurement within the measurement interval
\r
1355 * @note The property is treated as immutable: it is only valid to call
\r
1356 * the setter once. However, we don't assert if the caller tries to
\r
1357 * overwrite, just ignoring the update instead.
\r
1359 * @param disk_use Pointer to the Disk Use.
\r
1360 * @param val double
\r
1361 *****************************************************************************/
\r
1362 public void evel_measurement_disk_use_octetswriteavg_set(MEASUREMENT_DISK_USE disk_use,
\r
1366 disk_use.octetswriteavg.SetValuePr(val, "Octets writeavg set");
\r
1369 /**************************************************************************//**
\r
1370 * Set number of octets per second written to a disk or partition;
\r
1371 * provide the last measurement within the measurement interval
\r
1373 * @note The property is treated as immutable: it is only valid to call
\r
1374 * the setter once. However, we don't assert if the caller tries to
\r
1375 * overwrite, just ignoring the update instead.
\r
1377 * @param disk_use Pointer to the Disk Use.
\r
1378 * @param val double
\r
1379 *****************************************************************************/
\r
1380 public void evel_measurement_disk_use_octetswritelast_set(MEASUREMENT_DISK_USE disk_use,
\r
1384 disk_use.octetswritelast.SetValuePr(val, "Octets writelast set");
\r
1387 /**************************************************************************//**
\r
1388 * Set number of octets per second written to a disk or partition;
\r
1389 * provide the maximum measurement within the measurement interval
\r
1391 * @note The property is treated as immutable: it is only valid to call
\r
1392 * the setter once. However, we don't assert if the caller tries to
\r
1393 * overwrite, just ignoring the update instead.
\r
1395 * @param disk_use Pointer to the Disk Use.
\r
1396 * @param val double
\r
1397 *****************************************************************************/
\r
1398 public void evel_measurement_disk_use_octetswritemax_set(MEASUREMENT_DISK_USE disk_use,
\r
1402 disk_use.octetswritemax.SetValuePr(val, "Octets writemax set");
\r
1405 /**************************************************************************//**
\r
1406 * Set number of octets per second written to a disk or partition;
\r
1407 * provide the minimum measurement within the measurement interval
\r
1409 * @note The property is treated as immutable: it is only valid to call
\r
1410 * the setter once. However, we don't assert if the caller tries to
\r
1411 * overwrite, just ignoring the update instead.
\r
1413 * @param disk_use Pointer to the Disk Use.
\r
1414 * @param val double
\r
1415 *****************************************************************************/
\r
1416 public void evel_measurement_disk_use_octetswritemin_set(MEASUREMENT_DISK_USE disk_use,
\r
1420 disk_use.octetswritemin.SetValuePr(val, "Octets writemin set");
\r
1424 /**************************************************************************//**
\r
1425 * Set number of read operations per second issued to the disk;
\r
1426 * provide the average measurement within the measurement interval
\r
1428 * @note The property is treated as immutable: it is only valid to call
\r
1429 * the setter once. However, we don't assert if the caller tries to
\r
1430 * overwrite, just ignoring the update instead.
\r
1432 * @param disk_use Pointer to the Disk Use.
\r
1433 * @param val double
\r
1434 *****************************************************************************/
\r
1435 public void evel_measurement_disk_use_opsreadavg_set(MEASUREMENT_DISK_USE disk_use,
\r
1439 disk_use.opsreadavg.SetValuePr(val, "Disk read operation average set");
\r
1442 /**************************************************************************//**
\r
1443 * Set number of read operations per second issued to the disk;
\r
1444 * provide the last measurement within the measurement interval
\r
1446 * @note The property is treated as immutable: it is only valid to call
\r
1447 * the setter once. However, we don't assert if the caller tries to
\r
1448 * overwrite, just ignoring the update instead.
\r
1450 * @param disk_use Pointer to the Disk Use.
\r
1451 * @param val double
\r
1452 *****************************************************************************/
\r
1453 public void evel_measurement_disk_use_opsreadlast_set(MEASUREMENT_DISK_USE disk_use,
\r
1457 disk_use.opsreadlast.SetValuePr(val, "Disk read operation last set");
\r
1460 /**************************************************************************//**
\r
1461 * Set number of read operations per second issued to the disk;
\r
1462 * provide the maximum measurement within the measurement interval
\r
1464 * @note The property is treated as immutable: it is only valid to call
\r
1465 * the setter once. However, we don't assert if the caller tries to
\r
1466 * overwrite, just ignoring the update instead.
\r
1468 * @param disk_use Pointer to the Disk Use.
\r
1469 * @param val double
\r
1470 *****************************************************************************/
\r
1471 public void evel_measurement_disk_use_opsreadmax_set(MEASUREMENT_DISK_USE disk_use,
\r
1475 disk_use.opsreadmax.SetValuePr(val, "Disk read operation maximum set");
\r
1478 /**************************************************************************//**
\r
1479 * Set number of read operations per second issued to the disk;
\r
1480 * provide the minimum measurement within the measurement interval
\r
1482 * @note The property is treated as immutable: it is only valid to call
\r
1483 * the setter once. However, we don't assert if the caller tries to
\r
1484 * overwrite, just ignoring the update instead.
\r
1486 * @param disk_use Pointer to the Disk Use.
\r
1487 * @param val double
\r
1488 *****************************************************************************/
\r
1489 public void evel_measurement_disk_use_opsreadmin_set(MEASUREMENT_DISK_USE disk_use,
\r
1493 disk_use.opsreadmin.SetValuePr(val, "Disk read operation minimum set");
\r
1496 /**************************************************************************//**
\r
1497 * Set number of write operations per second issued to the disk;
\r
1498 * provide the average measurement within the measurement interval
\r
1500 * @note The property is treated as immutable: it is only valid to call
\r
1501 * the setter once. However, we don't assert if the caller tries to
\r
1502 * overwrite, just ignoring the update instead.
\r
1504 * @param disk_use Pointer to the Disk Use.
\r
1505 * @param val double
\r
1506 *****************************************************************************/
\r
1507 public void evel_measurement_disk_use_opswriteavg_set(MEASUREMENT_DISK_USE disk_use,
\r
1511 disk_use.opswriteavg.SetValuePr(val, "Disk write operation average set");
\r
1514 /**************************************************************************//**
\r
1515 * Set number of write operations per second issued to the disk;
\r
1516 * provide the last measurement within the measurement interval
\r
1518 * @note The property is treated as immutable: it is only valid to call
\r
1519 * the setter once. However, we don't assert if the caller tries to
\r
1520 * overwrite, just ignoring the update instead.
\r
1522 * @param disk_use Pointer to the Disk Use.
\r
1523 * @param val double
\r
1524 *****************************************************************************/
\r
1525 public void evel_measurement_disk_use_opswritelast_set(MEASUREMENT_DISK_USE disk_use,
\r
1529 disk_use.opswritelast.SetValuePr(val, "Disk write operation last set");
\r
1533 /**************************************************************************//**
\r
1534 * Set number of write operations per second issued to the disk;
\r
1535 * provide the maximum measurement within the measurement interval
\r
1537 * @note The property is treated as immutable: it is only valid to call
\r
1538 * the setter once. However, we don't assert if the caller tries to
\r
1539 * overwrite, just ignoring the update instead.
\r
1541 * @param disk_use Pointer to the Disk Use.
\r
1542 * @param val double
\r
1543 *****************************************************************************/
\r
1544 public void evel_measurement_disk_use_opswritemax_set(MEASUREMENT_DISK_USE disk_use,
\r
1548 disk_use.opswritemax.SetValuePr(val, "Disk write operation maximum set");
\r
1551 /**************************************************************************//**
\r
1552 * Set number of write operations per second issued to the disk;
\r
1553 * provide the average measurement within the measurement interval
\r
1555 * @note The property is treated as immutable: it is only valid to call
\r
1556 * the setter once. However, we don't assert if the caller tries to
\r
1557 * overwrite, just ignoring the update instead.
\r
1559 * @param disk_use Pointer to the Disk Use.
\r
1560 * @param val double
\r
1561 *****************************************************************************/
\r
1562 public void evel_measurement_disk_use_opswritemin_set(MEASUREMENT_DISK_USE disk_use,
\r
1566 disk_use.opswritemin.SetValuePr(val, "Disk write operation minimum set");
\r
1570 /**************************************************************************//**
\r
1571 * Set queue size of pending I/O operations per second;
\r
1572 * provide the average measurement within the measurement interval
\r
1574 * @note The property is treated as immutable: it is only valid to call
\r
1575 * the setter once. However, we don't assert if the caller tries to
\r
1576 * overwrite, just ignoring the update instead.
\r
1578 * @param disk_use Pointer to the Disk Use.
\r
1579 * @param val double
\r
1580 *****************************************************************************/
\r
1581 public void evel_measurement_disk_use_pendingopsavg_set(MEASUREMENT_DISK_USE disk_use,
\r
1585 disk_use.pendingopsavg.SetValuePr(val, "Disk pending operation average set");
\r
1588 /**************************************************************************//**
\r
1589 * Set queue size of pending I/O operations per second;
\r
1590 * provide the last measurement within the measurement interval
\r
1592 * @note The property is treated as immutable: it is only valid to call
\r
1593 * the setter once. However, we don't assert if the caller tries to
\r
1594 * overwrite, just ignoring the update instead.
\r
1596 * @param disk_use Pointer to the Disk Use.
\r
1597 * @param val double
\r
1598 *****************************************************************************/
\r
1599 public void evel_measurement_disk_use_pendingopslast_set(MEASUREMENT_DISK_USE disk_use,
\r
1603 disk_use.pendingopslast.SetValuePr(val, "Disk pending operation last set");
\r
1606 /**************************************************************************//**
\r
1607 * Set queue size of pending I/O operations per second;
\r
1608 * provide the maximum measurement within the measurement interval
\r
1610 * @note The property is treated as immutable: it is only valid to call
\r
1611 * the setter once. However, we don't assert if the caller tries to
\r
1612 * overwrite, just ignoring the update instead.
\r
1614 * @param disk_use Pointer to the Disk Use.
\r
1615 * @param val double
\r
1616 *****************************************************************************/
\r
1617 public void evel_measurement_disk_use_pendingopsmax_set(MEASUREMENT_DISK_USE disk_use,
\r
1621 disk_use.pendingopsmax.SetValuePr(val, "Disk pending operation maximum set");
\r
1624 /**************************************************************************//**
\r
1625 * Set queue size of pending I/O operations per second;
\r
1626 * provide the minimum measurement within the measurement interval
\r
1628 * @note The property is treated as immutable: it is only valid to call
\r
1629 * the setter once. However, we don't assert if the caller tries to
\r
1630 * overwrite, just ignoring the update instead.
\r
1632 * @param disk_use Pointer to the Disk Use.
\r
1633 * @param val double
\r
1634 *****************************************************************************/
\r
1635 public void evel_measurement_disk_use_pendingopsmin_set(MEASUREMENT_DISK_USE disk_use,
\r
1639 disk_use.pendingopsmin.SetValuePr(val, "Disk pending operation min set");
\r
1643 /**************************************************************************//**
\r
1644 * Set milliseconds a read operation took to complete;
\r
1645 * provide the average measurement within the measurement interval
\r
1647 * @note The property is treated as immutable: it is only valid to call
\r
1648 * the setter once. However, we don't assert if the caller tries to
\r
1649 * overwrite, just ignoring the update instead.
\r
1651 * @param disk_use Pointer to the Disk Use.
\r
1652 * @param val double
\r
1653 *****************************************************************************/
\r
1654 public void evel_measurement_disk_use_timereadavg_set(MEASUREMENT_DISK_USE disk_use,
\r
1658 disk_use.timereadavg.SetValuePr(val, "Disk read time average set");
\r
1661 /**************************************************************************//**
\r
1662 * Set milliseconds a read operation took to complete;
\r
1663 * provide the last measurement within the measurement interval
\r
1665 * @note The property is treated as immutable: it is only valid to call
\r
1666 * the setter once. However, we don't assert if the caller tries to
\r
1667 * overwrite, just ignoring the update instead.
\r
1669 * @param disk_use Pointer to the Disk Use.
\r
1670 * @param val double
\r
1671 *****************************************************************************/
\r
1672 public void evel_measurement_disk_use_timereadlast_set(MEASUREMENT_DISK_USE disk_use,
\r
1676 disk_use.timereadlast.SetValuePr(val, "Disk read time last set");
\r
1679 /**************************************************************************//**
\r
1680 * Set milliseconds a read operation took to complete;
\r
1681 * provide the maximum measurement within the measurement interval
\r
1683 * @note The property is treated as immutable: it is only valid to call
\r
1684 * the setter once. However, we don't assert if the caller tries to
\r
1685 * overwrite, just ignoring the update instead.
\r
1687 * @param disk_use Pointer to the Disk Use.
\r
1688 * @param val double
\r
1689 *****************************************************************************/
\r
1690 public void evel_measurement_disk_use_timereadmax_set(MEASUREMENT_DISK_USE disk_use,
\r
1694 disk_use.timereadmax.SetValuePr(val, "Disk read time maximum set");
\r
1697 /**************************************************************************//**
\r
1698 * Set milliseconds a read operation took to complete;
\r
1699 * provide the minimum measurement within the measurement interval
\r
1701 * @note The property is treated as immutable: it is only valid to call
\r
1702 * the setter once. However, we don't assert if the caller tries to
\r
1703 * overwrite, just ignoring the update instead.
\r
1705 * @param disk_use Pointer to the Disk Use.
\r
1706 * @param val double
\r
1707 *****************************************************************************/
\r
1708 public void evel_measurement_disk_use_timereadmin_set(MEASUREMENT_DISK_USE disk_use,
\r
1712 disk_use.timereadmin.SetValuePr(val, "Disk read time minimum set");
\r
1715 /**************************************************************************//**
\r
1716 * Set milliseconds a write operation took to complete;
\r
1717 * provide the average measurement within the measurement interval
\r
1719 * @note The property is treated as immutable: it is only valid to call
\r
1720 * the setter once. However, we don't assert if the caller tries to
\r
1721 * overwrite, just ignoring the update instead.
\r
1723 * @param disk_use Pointer to the Disk Use.
\r
1724 * @param val double
\r
1725 *****************************************************************************/
\r
1726 public void evel_measurement_disk_use_timewriteavg_set(MEASUREMENT_DISK_USE disk_use,
\r
1730 disk_use.timewriteavg.SetValuePr(val, "Disk write time average set");
\r
1734 /**************************************************************************//**
\r
1735 * Set milliseconds a write operation took to complete;
\r
1736 * provide the last measurement within the measurement interval
\r
1738 * @note The property is treated as immutable: it is only valid to call
\r
1739 * the setter once. However, we don't assert if the caller tries to
\r
1740 * overwrite, just ignoring the update instead.
\r
1742 * @param disk_use Pointer to the Disk Use.
\r
1743 * @param val double
\r
1744 *****************************************************************************/
\r
1745 public void evel_measurement_disk_use_timewritelast_set(MEASUREMENT_DISK_USE disk_use,
\r
1749 disk_use.timewritelast.SetValuePr(val, "Disk write time last set");
\r
1752 /**************************************************************************//**
\r
1753 * Set milliseconds a write operation took to complete;
\r
1754 * provide the maximum measurement within the measurement interval
\r
1756 * @note The property is treated as immutable: it is only valid to call
\r
1757 * the setter once. However, we don't assert if the caller tries to
\r
1758 * overwrite, just ignoring the update instead.
\r
1760 * @param disk_use Pointer to the Disk Use.
\r
1761 * @param val double
\r
1762 *****************************************************************************/
\r
1763 public void evel_measurement_disk_use_timewritemax_set(MEASUREMENT_DISK_USE disk_use,
\r
1767 disk_use.timewritemax.SetValuePr(val, "Disk write time max set");
\r
1770 /**************************************************************************//**
\r
1771 * Set milliseconds a write operation took to complete;
\r
1772 * provide the average measurement within the measurement interval
\r
1774 * @note The property is treated as immutable: it is only valid to call
\r
1775 * the setter once. However, we don't assert if the caller tries to
\r
1776 * overwrite, just ignoring the update instead.
\r
1778 * @param disk_use Pointer to the Disk Use.
\r
1779 * @param val double
\r
1780 *****************************************************************************/
\r
1781 public void evel_measurement_disk_use_timewritemin_set(MEASUREMENT_DISK_USE disk_use,
\r
1785 disk_use.timewritemin.SetValuePr(val, "Disk write time min set");
\r
1789 /**************************************************************************//**
\r
1790 * Add an additional File System usage value name/value pair to the
\r
1793 * The filesystem_name is null delimited ASCII string. The library takes a
\r
1794 * copy so the caller does not have to preserve values after the function
\r
1798 * @param filesystem_name ASCIIZ string with the file-system's UUID.
\r
1799 * @param block_configured Block storage configured.
\r
1800 * @param block_used Block storage in use.
\r
1801 * @param block_iops Block storage IOPS.
\r
1802 * @param ephemeral_configured Ephemeral storage configured.
\r
1803 * @param ephemeral_used Ephemeral storage in use.
\r
1804 * @param ephemeral_iops Ephemeral storage IOPS.
\r
1805 *****************************************************************************/
\r
1806 public void evel_measurement_fsys_use_add(
\r
1807 String filesystem_name,
\r
1808 double block_configured,
\r
1809 double block_used,
\r
1810 double block_iops,
\r
1811 double ephemeral_configured,
\r
1812 double ephemeral_used,
\r
1813 double ephemeral_iops)
\r
1815 MEASUREMENT_FSYS_USE fsys_use = null;
\r
1818 /***************************************************************************/
\r
1819 /* Check assumptions. */
\r
1820 /***************************************************************************/
\r
1821 assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT);
\r
1822 assert(filesystem_name != null);
\r
1823 assert(block_configured >= 0.0);
\r
1824 assert(block_used >= 0.0);
\r
1825 assert(block_iops >= 0.0);
\r
1826 assert(ephemeral_configured >= 0.0);
\r
1827 assert(ephemeral_used >= 0.0);
\r
1828 assert(ephemeral_iops >= 0.0);
\r
1830 /***************************************************************************/
\r
1831 /* Allocate a container for the value and push onto the list. */
\r
1832 /***************************************************************************/
\r
1833 LOGGER.debug("Adding filesystem_name="+filesystem_name);
\r
1834 fsys_use = new MEASUREMENT_FSYS_USE();
\r
1835 assert(fsys_use != null);
\r
1836 fsys_use.filesystem_name = filesystem_name;
\r
1837 fsys_use.block_configured = block_configured;
\r
1838 fsys_use.block_used = block_used;
\r
1839 fsys_use.block_iops = block_iops;
\r
1840 fsys_use.ephemeral_configured = ephemeral_configured;
\r
1841 fsys_use.ephemeral_used = ephemeral_used;
\r
1842 fsys_use.ephemeral_iops = ephemeral_iops;
\r
1844 if( filesystem_usage == null ){
\r
1845 filesystem_usage = new ArrayList<MEASUREMENT_FSYS_USE>();
\r
1846 if( filesystem_usage == null )LOGGER.error("Unable to allocate new file system usage");
\r
1849 filesystem_usage.add(fsys_use);
\r
1854 /**************************************************************************//**
\r
1855 * Add a Feature usage value name/value pair to the Measurement.
\r
1857 * The name is null delimited ASCII string. The library takes
\r
1858 * a copy so the caller does not have to preserve values after the function
\r
1862 * @param feature ASCIIZ string with the feature's name.
\r
1863 * @param utilization Utilization of the feature.
\r
1864 *****************************************************************************/
\r
1865 public void evel_measurement_feature_use_add(
\r
1869 MEASUREMENT_FEATURE_USE feature_use = null;
\r
1872 /***************************************************************************/
\r
1873 /* Check assumptions. */
\r
1874 /***************************************************************************/
\r
1875 assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT);
\r
1876 assert(feature != null);
\r
1877 assert(utilization >= 0);
\r
1879 /***************************************************************************/
\r
1880 /* Allocate a container for the value and push onto the list. */
\r
1881 /***************************************************************************/
\r
1882 LOGGER.debug(MessageFormatter.format("Adding Feature={0} Use={1}", feature, utilization));
\r
1883 feature_use = new MEASUREMENT_FEATURE_USE();
\r
1884 assert(feature_use != null);
\r
1885 feature_use.feature_id = feature;
\r
1886 assert(feature_use.feature_id != null);
\r
1887 feature_use.feature_utilization = utilization;
\r
1889 if( feature_usage == null ){
\r
1890 feature_usage = new ArrayList<MEASUREMENT_FEATURE_USE>();
\r
1891 if( feature_usage == null )LOGGER.error("Unable to allocate new feature usage");
\r
1894 feature_usage.add(feature_use);
\r
1899 /**************************************************************************//**
\r
1900 * Add a Additional Measurement value name/value pair to the Report.
\r
1902 * The name is null delimited ASCII string. The library takes
\r
1903 * a copy so the caller does not have to preserve values after the function
\r
1906 * @param measurement Pointer to the Measaurement.
\r
1907 * @param group ASCIIZ string with the measurement group's name.
\r
1908 * @param name ASCIIZ string containing the measurement's name.
\r
1909 * @param value ASCIIZ string containing the measurement's value.
\r
1910 *****************************************************************************/
\r
1911 public void evel_measurement_custom_measurement_add(
\r
1916 MEASUREMENT_GROUP measurement_group = null;
\r
1917 CUSTOM_MEASUREMENT custom_measurement = null;
\r
1918 MEASUREMENT_GROUP item = null;
\r
1921 /***************************************************************************/
\r
1922 /* Check assumptions. */
\r
1923 /***************************************************************************/
\r
1924 assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT);
\r
1925 assert(group != null);
\r
1926 assert(name != null);
\r
1927 assert(value != null);
\r
1929 /***************************************************************************/
\r
1930 /* Allocate a container for the name/value pair. */
\r
1931 /***************************************************************************/
\r
1932 LOGGER.debug(MessageFormat.format("Adding Measurement Group={0} Name={1} Value={2}",
\r
1933 group, name, value));
\r
1934 custom_measurement = new CUSTOM_MEASUREMENT();
\r
1935 assert(custom_measurement != null);
\r
1936 custom_measurement.name = name;
\r
1937 assert(custom_measurement.name != null);
\r
1938 custom_measurement.value = value;
\r
1939 assert(custom_measurement.value != null);
\r
1941 /***************************************************************************/
\r
1942 /* See if we have that group already. */
\r
1943 /***************************************************************************/
\r
1944 if (additional_measurements != null && additional_measurements.size()>0)
\r
1946 for(int i=0;i<additional_measurements.size();i++)
\r
1948 item = additional_measurements.get(i);
\r
1949 if( item.name.equals(group))
\r
1951 LOGGER.debug("Found existing Measurement Group");
\r
1952 measurement_group = item;
\r
1958 /***************************************************************************/
\r
1959 /* If we didn't have the group already, create it. */
\r
1960 /***************************************************************************/
\r
1961 if (measurement_group == null)
\r
1963 LOGGER.debug("Creating new Measurement Group");
\r
1964 measurement_group = new MEASUREMENT_GROUP();
\r
1965 assert(measurement_group != null);
\r
1966 measurement_group.name = group;
\r
1967 assert(measurement_group.name != null);
\r
1968 measurement_group.measurements = new ArrayList<CUSTOM_MEASUREMENT>();
\r
1969 if( additional_measurements == null){
\r
1970 LOGGER.debug("Creating new Measurement Group list"+group);
\r
1971 additional_measurements = new ArrayList<MEASUREMENT_GROUP>();
\r
1972 if( additional_measurements == null ){
\r
1973 LOGGER.error("Unable to allocate additional measurements ");
\r
1976 additional_measurements.add(measurement_group);
\r
1979 /***************************************************************************/
\r
1980 /* If we didn't have the group already, create it. */
\r
1981 /***************************************************************************/
\r
1982 LOGGER.debug("Adding custom measurement");
\r
1983 measurement_group.measurements.add(custom_measurement);
\r
1988 /**************************************************************************//**
\r
1989 * Add a Codec usage value name/value pair to the Measurement.
\r
1991 * The name is null delimited ASCII string. The library takes
\r
1992 * a copy so the caller does not have to preserve values after the function
\r
1996 * @param codec ASCIIZ string with the codec's name.
\r
1997 * @param utilization Number of codecs in use.
\r
1998 *****************************************************************************/
\r
1999 public void evel_measurement_codec_use_add( String codec,
\r
2002 MEASUREMENT_CODEC_USE codec_use = null;
\r
2005 /***************************************************************************/
\r
2006 /* Check assumptions. */
\r
2007 /***************************************************************************/
\r
2008 assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT);
\r
2009 assert(codec != null);
\r
2010 assert(utilization >= 0.0);
\r
2012 /***************************************************************************/
\r
2013 /* Allocate a container for the value and push onto the list. */
\r
2014 /***************************************************************************/
\r
2015 LOGGER.debug(MessageFormatter.format("Adding Codec={0} Use={1}", codec, utilization));
\r
2016 codec_use = new MEASUREMENT_CODEC_USE();
\r
2017 assert(codec_use != null);
\r
2018 codec_use.codec_id = codec;
\r
2019 codec_use.number_in_use = utilization;
\r
2021 if( codec_usage == null ){
\r
2022 codec_usage = new ArrayList<MEASUREMENT_CODEC_USE>();
\r
2023 if( codec_usage == null )LOGGER.error("Unable to allocate new codec usage");
\r
2026 codec_usage.add(codec_use);
\r
2032 /**************************************************************************//**
\r
2033 * Set the Media Ports in Use property of the Measurement.
\r
2035 * @note The property is treated as immutable: it is only valid to call
\r
2036 * the setter once. However, we don't assert if the caller tries to
\r
2037 * overwrite, just ignoring the update instead.
\r
2040 * @param media_ports_in_use The media port usage to set.
\r
2041 *****************************************************************************/
\r
2042 public void evel_measurement_media_port_use_set(
\r
2043 int media_portsuse)
\r
2047 /***************************************************************************/
\r
2048 /* Check preconditions. */
\r
2049 /***************************************************************************/
\r
2050 assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT);
\r
2051 assert(media_portsuse >= 0);
\r
2053 media_ports_in_use.SetValuePr(
\r
2055 "Media Ports In Use");
\r
2059 /**************************************************************************//**
\r
2060 * Set the VNFC Scaling Metric property of the Measurement.
\r
2062 * @note The property is treated as immutable: it is only valid to call
\r
2063 * the setter once. However, we don't assert if the caller tries to
\r
2064 * overwrite, just ignoring the update instead.
\r
2067 * @param scaling_metric The scaling metric to set.
\r
2068 *****************************************************************************/
\r
2069 public void evel_measurement_vnfc_scaling_metric_set(EvelScalingMeasurement measurement,
\r
2070 int scaling_metric)
\r
2074 /***************************************************************************/
\r
2075 /* Check preconditions. */
\r
2076 /***************************************************************************/
\r
2077 assert(measurement != null);
\r
2078 assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT);
\r
2079 assert(scaling_metric >= 0.0);
\r
2081 vnfc_scaling_metric.SetValuePr(
\r
2083 "VNFC Scaling Metric");
\r
2087 /**************************************************************************//**
\r
2088 * Create a new Latency Bucket to be added to a Measurement event.
\r
2090 * @note The mandatory fields on the ::MEASUREMENT_LATENCY_BUCKET must be
\r
2091 * supplied to this factory function and are immutable once set.
\r
2092 * Optional fields have explicit setter functions, but again values
\r
2093 * may only be set once so that the ::MEASUREMENT_LATENCY_BUCKET has
\r
2094 * immutable properties.
\r
2096 * @param count Count of events in this bucket.
\r
2098 * @returns pointer to the newly manufactured ::MEASUREMENT_LATENCY_BUCKET.
\r
2099 * If the structure is not used it must be released using free.
\r
2100 * @retval null Failed to create the Latency Bucket.
\r
2101 *****************************************************************************/
\r
2102 public MEASUREMENT_LATENCY_BUCKET evel_new_meas_latency_bucket(int count)
\r
2104 MEASUREMENT_LATENCY_BUCKET bucket=null;
\r
2108 /***************************************************************************/
\r
2109 /* Check preconditions. */
\r
2110 /***************************************************************************/
\r
2111 assert(count >= 0);
\r
2113 /***************************************************************************/
\r
2114 /* Allocate, then set Mandatory Parameters. */
\r
2115 /***************************************************************************/
\r
2116 LOGGER.debug("Creating bucket, count = "+count);
\r
2117 bucket = new MEASUREMENT_LATENCY_BUCKET();
\r
2118 assert(bucket != null);
\r
2120 /***************************************************************************/
\r
2121 /* Set Mandatory Parameters. */
\r
2122 /***************************************************************************/
\r
2123 bucket.count = count;
\r
2125 /***************************************************************************/
\r
2126 /* Initialize Optional Parameters. */
\r
2127 /***************************************************************************/
\r
2128 bucket.low_end = new EvelOptionDouble();
\r
2129 bucket.high_end = new EvelOptionDouble();
\r
2136 /**************************************************************************//**
\r
2137 * Set the High End property of the Measurement Latency Bucket.
\r
2139 * @note The property is treated as immutable: it is only valid to call
\r
2140 * the setter once. However, we don't assert if the caller tries to
\r
2141 * overwrite, just ignoring the update instead.
\r
2143 * @param bucket Pointer to the Measurement Latency Bucket.
\r
2144 * @param high_end High end of the bucket's range.
\r
2145 *****************************************************************************/
\r
2146 public void evel_meas_latency_bucket_high_end_set(
\r
2147 MEASUREMENT_LATENCY_BUCKET bucket,
\r
2152 /***************************************************************************/
\r
2153 /* Check preconditions. */
\r
2154 /***************************************************************************/
\r
2155 assert(high_end >= 0.0);
\r
2156 bucket.high_end.SetValuePr(high_end, "High End");
\r
2161 /**************************************************************************//**
\r
2162 * Set the Low End property of the Measurement Latency Bucket.
\r
2164 * @note The property is treated as immutable: it is only valid to call
\r
2165 * the setter once. However, we don't assert if the caller tries to
\r
2166 * overwrite, just ignoring the update instead.
\r
2168 * @param bucket Pointer to the Measurement Latency Bucket.
\r
2169 * @param low_end Low end of the bucket's range.
\r
2170 *****************************************************************************/
\r
2171 public void evel_meas_latency_bucket_low_end_set(
\r
2172 MEASUREMENT_LATENCY_BUCKET bucket,
\r
2177 /***************************************************************************/
\r
2178 /* Check preconditions. */
\r
2179 /***************************************************************************/
\r
2180 assert(low_end >= 0.0);
\r
2181 bucket.low_end.SetValuePr(low_end, "Low End");
\r
2185 /**************************************************************************//**
\r
2186 * Add an additional Measurement Latency Bucket to the specified event.
\r
2188 * @param measurement Pointer to the Measurement event.
\r
2189 * @param bucket Pointer to the Measurement Latency Bucket to add.
\r
2190 *****************************************************************************/
\r
2191 public void evel_meas_latency_bucket_add(MEASUREMENT_LATENCY_BUCKET bucket)
\r
2195 /***************************************************************************/
\r
2196 /* Check preconditions. */
\r
2197 /***************************************************************************/
\r
2198 assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT);
\r
2199 assert(bucket != null);
\r
2201 if( latency_distribution == null ){
\r
2202 latency_distribution = new ArrayList<MEASUREMENT_LATENCY_BUCKET>();
\r
2203 if( latency_distribution == null )LOGGER.error("Unable to allocate new file system usage");
\r
2205 latency_distribution.add(bucket);
\r
2210 /**************************************************************************//**
\r
2211 * Add an additional Latency Distribution bucket to the Measurement.
\r
2213 * This function implements the previous API, purely for convenience.
\r
2216 * @param low_end Low end of the bucket's range.
\r
2217 * @param high_end High end of the bucket's range.
\r
2218 * @param count Count of events in this bucket.
\r
2219 *****************************************************************************/
\r
2220 public void evel_measurement_latency_add(
\r
2225 MEASUREMENT_LATENCY_BUCKET bucket = null;
\r
2229 /***************************************************************************/
\r
2230 /* Trust the assertions in the underlying methods. */
\r
2231 /***************************************************************************/
\r
2232 bucket = evel_new_meas_latency_bucket(count);
\r
2233 bucket.low_end.SetValue(low_end);
\r
2234 bucket.high_end.SetValue(high_end);
\r
2235 evel_meas_latency_bucket_add(bucket);
\r
2240 /**************************************************************************//**
\r
2241 * Create a new vNIC Use to be added to a Measurement event.
\r
2243 * @note The mandatory fields on the ::MEASUREMENT_VNIC_PERFORMANCE must be supplied
\r
2244 * to this factory function and are immutable once set. Optional
\r
2245 * fields have explicit setter functions, but again values may only be
\r
2246 * set once so that the ::MEASUREMENT_VNIC_PERFORMANCE has immutable
\r
2249 * @param vnic_id ASCIIZ string with the vNIC's ID.
\r
2250 * @param val_suspect True or false confidence in data.
\r
2252 * @returns pointer to the newly manufactured ::MEASUREMENT_VNIC_PERFORMANCE.
\r
2253 * If the structure is not used it must be released using
\r
2254 * ::evel_measurement_free_vnic_performance.
\r
2255 * @retval null Failed to create the vNIC Use.
\r
2256 *****************************************************************************/
\r
2257 public MEASUREMENT_VNIC_PERFORMANCE evel_measurement_new_vnic_performance(String vnic_id,
\r
2258 String val_suspect)
\r
2260 MEASUREMENT_VNIC_PERFORMANCE vnic_perf=null;
\r
2264 /***************************************************************************/
\r
2265 /* Check preconditions. */
\r
2266 /***************************************************************************/
\r
2267 assert(vnic_id != null);
\r
2268 assert(val_suspect.equals("true") || val_suspect.equals("false"));
\r
2270 /***************************************************************************/
\r
2271 /* Allocate, then set Mandatory Parameters. */
\r
2272 /***************************************************************************/
\r
2274 vnic_perf = new MEASUREMENT_VNIC_PERFORMANCE();
\r
2275 assert(vnic_perf != null);
\r
2276 vnic_perf.vnic_id = vnic_id;
\r
2277 vnic_perf.valuesaresuspect = val_suspect;
\r
2279 vnic_perf.recvd_bcast_packets_acc= new EvelOptionDouble();
\r
2280 vnic_perf.recvd_bcast_packets_delta= new EvelOptionDouble();
\r
2282 vnic_perf.recvd_discarded_packets_acc= new EvelOptionDouble();
\r
2283 vnic_perf.recvd_discarded_packets_delta= new EvelOptionDouble();
\r
2284 vnic_perf.recvd_error_packets_acc= new EvelOptionDouble();
\r
2285 vnic_perf.recvd_error_packets_delta= new EvelOptionDouble();
\r
2286 vnic_perf.recvd_mcast_packets_acc= new EvelOptionDouble();
\r
2287 vnic_perf.recvd_mcast_packets_delta= new EvelOptionDouble();
\r
2288 vnic_perf.recvd_octets_acc= new EvelOptionDouble();
\r
2289 vnic_perf.recvd_octets_delta= new EvelOptionDouble();
\r
2290 vnic_perf.recvd_total_packets_acc= new EvelOptionDouble();
\r
2291 vnic_perf.recvd_total_packets_delta= new EvelOptionDouble();
\r
2292 vnic_perf.recvd_ucast_packets_acc= new EvelOptionDouble();
\r
2293 vnic_perf.recvd_ucast_packets_delta= new EvelOptionDouble();
\r
2294 vnic_perf.tx_bcast_packets_acc= new EvelOptionDouble();
\r
2295 vnic_perf.tx_bcast_packets_delta= new EvelOptionDouble();
\r
2296 vnic_perf.tx_discarded_packets_acc= new EvelOptionDouble();
\r
2297 vnic_perf.tx_discarded_packets_delta= new EvelOptionDouble();
\r
2298 vnic_perf.tx_error_packets_acc= new EvelOptionDouble();
\r
2299 vnic_perf.tx_error_packets_delta= new EvelOptionDouble();
\r
2300 vnic_perf.tx_mcast_packets_acc= new EvelOptionDouble();
\r
2301 vnic_perf.tx_mcast_packets_delta= new EvelOptionDouble();
\r
2302 vnic_perf.tx_octets_acc= new EvelOptionDouble();
\r
2303 vnic_perf.tx_octets_delta= new EvelOptionDouble();
\r
2304 vnic_perf.tx_total_packets_acc= new EvelOptionDouble();
\r
2305 vnic_perf.tx_total_packets_delta= new EvelOptionDouble();
\r
2306 vnic_perf.tx_ucast_packets_acc= new EvelOptionDouble();
\r
2307 vnic_perf.tx_ucast_packets_delta= new EvelOptionDouble();
\r
2309 LOGGER.debug("Adding "+vnic_perf+"VNIC ID="+ vnic_perf.vnic_id+"Value="+vnic_perf.valuesaresuspect);
\r
2311 /***************************************************************************/
\r
2312 /* Initialize Optional Parameters. */
\r
2313 /***************************************************************************/
\r
2321 /**************************************************************************//**
\r
2322 * Set the Accumulated Broadcast Packets Received in measurement interval
\r
2323 * property of the vNIC performance.
\r
2325 * @note The property is treated as immutable: it is only valid to call
\r
2326 * the setter once. However, we don't assert if the caller tries to
\r
2327 * overwrite, just ignoring the update instead.
\r
2329 * @param vnic_performance Pointer to the vNIC Use.
\r
2330 * @param recvd_bcast_packets_acc
\r
2331 *****************************************************************************/
\r
2332 public void evel_vnic_performance_rx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
2333 double recvd_bcast_packets_acc)
\r
2337 /***************************************************************************/
\r
2338 /* Check preconditions. */
\r
2339 /***************************************************************************/
\r
2340 assert(recvd_bcast_packets_acc >= 0.0);
\r
2342 vnic_performance.recvd_bcast_packets_acc.SetValuePr(
\r
2343 recvd_bcast_packets_acc,
\r
2344 "Broadcast Packets accumulated");
\r
2349 /**************************************************************************//**
\r
2350 * Set the Delta Broadcast Packets Received in measurement interval
\r
2351 * property of the vNIC performance.
\r
2353 * @note The property is treated as immutable: it is only valid to call
\r
2354 * the setter once. However, we don't assert if the caller tries to
\r
2355 * overwrite, just ignoring the update instead.
\r
2357 * @param vnic_performance Pointer to the vNIC Use.
\r
2358 * @param recvd_bcast_packets_delta
\r
2359 *****************************************************************************/
\r
2360 public void evel_vnic_performance_rx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
2361 double recvd_bcast_packets_delta)
\r
2365 /***************************************************************************/
\r
2366 /* Check preconditions. */
\r
2367 /***************************************************************************/
\r
2368 assert(recvd_bcast_packets_delta >= 0.0);
\r
2370 vnic_performance.recvd_bcast_packets_delta.SetValuePr(
\r
2371 recvd_bcast_packets_delta,
\r
2372 "Delta Broadcast Packets recieved");
\r
2378 /**************************************************************************//**
\r
2379 * Set the Discarded Packets Received in measurement interval
\r
2380 * property of the vNIC performance.
\r
2382 * @note The property is treated as immutable: it is only valid to call
\r
2383 * the setter once. However, we don't assert if the caller tries to
\r
2384 * overwrite, just ignoring the update instead.
\r
2386 * @param vnic_performance Pointer to the vNIC Use.
\r
2387 * @param recvd_discard_packets_acc
\r
2388 *****************************************************************************/
\r
2389 public void evel_vnic_performance_rx_discard_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
2390 double recvd_discard_packets_acc)
\r
2394 /***************************************************************************/
\r
2395 /* Check preconditions. */
\r
2396 /***************************************************************************/
\r
2397 assert(recvd_discard_packets_acc >= 0.0);
\r
2399 vnic_performance.recvd_discarded_packets_acc.SetValuePr(
\r
2400 recvd_discard_packets_acc,
\r
2401 "Discarded Packets accumulated");
\r
2406 /**************************************************************************//**
\r
2407 * Set the Delta Discarded Packets Received in measurement interval
\r
2408 * property of the vNIC performance.
\r
2410 * @note The property is treated as immutable: it is only valid to call
\r
2411 * the setter once. However, we don't assert if the caller tries to
\r
2412 * overwrite, just ignoring the update instead.
\r
2414 * @param vnic_performance Pointer to the vNIC Use.
\r
2415 * @param recvd_discard_packets_delta
\r
2416 *****************************************************************************/
\r
2417 public void evel_vnic_performance_rx_discard_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
2418 double recvd_discard_packets_delta)
\r
2422 /***************************************************************************/
\r
2423 /* Check preconditions. */
\r
2424 /***************************************************************************/
\r
2425 assert(recvd_discard_packets_delta >= 0.0);
\r
2427 vnic_performance.recvd_discarded_packets_delta.SetValuePr(
\r
2428 recvd_discard_packets_delta,
\r
2429 "Delta Discarded Packets recieved");
\r
2435 /**************************************************************************//**
\r
2436 * Set the Error Packets Received in measurement interval
\r
2437 * property of the vNIC performance.
\r
2439 * @note The property is treated as immutable: it is only valid to call
\r
2440 * the setter once. However, we don't assert if the caller tries to
\r
2441 * overwrite, just ignoring the update instead.
\r
2443 * @param vnic_performance Pointer to the vNIC Use.
\r
2444 * @param recvd_error_packets_acc
\r
2445 *****************************************************************************/
\r
2446 public void evel_vnic_performance_rx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
2447 double recvd_error_packets_acc)
\r
2451 /***************************************************************************/
\r
2452 /* Check preconditions. */
\r
2453 /***************************************************************************/
\r
2454 assert(recvd_error_packets_acc >= 0.0);
\r
2456 vnic_performance.recvd_error_packets_acc.SetValuePr(
\r
2457 recvd_error_packets_acc,
\r
2458 "Error Packets received accumulated");
\r
2463 /**************************************************************************//**
\r
2464 * Set the Delta Error Packets Received in measurement interval
\r
2465 * property of the vNIC performance.
\r
2467 * @note The property is treated as immutable: it is only valid to call
\r
2468 * the setter once. However, we don't assert if the caller tries to
\r
2469 * overwrite, just ignoring the update instead.
\r
2471 * @param vnic_performance Pointer to the vNIC Use.
\r
2472 * @param recvd_error_packets_delta
\r
2473 *****************************************************************************/
\r
2474 public void evel_vnic_performance_rx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
2475 double recvd_error_packets_delta)
\r
2479 /***************************************************************************/
\r
2480 /* Check preconditions. */
\r
2481 /***************************************************************************/
\r
2482 assert(recvd_error_packets_delta >= 0.0);
\r
2484 vnic_performance.recvd_error_packets_delta.SetValuePr(
\r
2485 recvd_error_packets_delta,
\r
2486 "Delta Error Packets recieved");
\r
2491 /**************************************************************************//**
\r
2492 * Set the Accumulated Multicast Packets Received in measurement interval
\r
2493 * property of the vNIC performance.
\r
2495 * @note The property is treated as immutable: it is only valid to call
\r
2496 * the setter once. However, we don't assert if the caller tries to
\r
2497 * overwrite, just ignoring the update instead.
\r
2499 * @param vnic_performance Pointer to the vNIC Use.
\r
2500 * @param recvd_mcast_packets_acc
\r
2501 *****************************************************************************/
\r
2502 public void evel_vnic_performance_rx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
2503 double recvd_mcast_packets_acc)
\r
2507 /***************************************************************************/
\r
2508 /* Check preconditions. */
\r
2509 /***************************************************************************/
\r
2510 assert(recvd_mcast_packets_acc >= 0.0);
\r
2512 vnic_performance.recvd_mcast_packets_acc.SetValuePr(
\r
2513 recvd_mcast_packets_acc,
\r
2514 "Multicast Packets accumulated");
\r
2519 /**************************************************************************//**
\r
2520 * Set the Delta Multicast Packets Received in measurement interval
\r
2521 * property of the vNIC performance.
\r
2523 * @note The property is treated as immutable: it is only valid to call
\r
2524 * the setter once. However, we don't assert if the caller tries to
\r
2525 * overwrite, just ignoring the update instead.
\r
2527 * @param vnic_performance Pointer to the vNIC Use.
\r
2528 * @param recvd_mcast_packets_delta
\r
2529 *****************************************************************************/
\r
2530 public void evel_vnic_performance_rx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
2531 double recvd_mcast_packets_delta)
\r
2535 /***************************************************************************/
\r
2536 /* Check preconditions. */
\r
2537 /***************************************************************************/
\r
2538 assert(recvd_mcast_packets_delta >= 0.0);
\r
2540 vnic_performance.recvd_mcast_packets_delta.SetValuePr(
\r
2541 recvd_mcast_packets_delta,
\r
2542 "Delta Multicast Packets recieved");
\r
2547 /**************************************************************************//**
\r
2548 * Set the Accumulated Octets Received in measurement interval
\r
2549 * property of the vNIC performance.
\r
2551 * @note The property is treated as immutable: it is only valid to call
\r
2552 * the setter once. However, we don't assert if the caller tries to
\r
2553 * overwrite, just ignoring the update instead.
\r
2555 * @param vnic_performance Pointer to the vNIC Use.
\r
2556 * @param recvd_octets_acc
\r
2557 *****************************************************************************/
\r
2558 public void evel_vnic_performance_rx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
2559 double recvd_octets_acc)
\r
2563 /***************************************************************************/
\r
2564 /* Check preconditions. */
\r
2565 /***************************************************************************/
\r
2566 assert(recvd_octets_acc >= 0.0);
\r
2568 vnic_performance.recvd_octets_acc.SetValuePr(
\r
2570 "Octets received accumulated");
\r
2575 /**************************************************************************//**
\r
2576 * Set the Delta Octets Received in measurement interval
\r
2577 * property of the vNIC performance.
\r
2579 * @note The property is treated as immutable: it is only valid to call
\r
2580 * the setter once. However, we don't assert if the caller tries to
\r
2581 * overwrite, just ignoring the update instead.
\r
2583 * @param vnic_performance Pointer to the vNIC Use.
\r
2584 * @param recvd_octets_delta
\r
2585 *****************************************************************************/
\r
2586 public void evel_vnic_performance_rx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
2587 double recvd_octets_delta)
\r
2591 /***************************************************************************/
\r
2592 /* Check preconditions. */
\r
2593 /***************************************************************************/
\r
2594 assert(recvd_octets_delta >= 0.0);
\r
2596 vnic_performance.recvd_octets_delta.SetValuePr(
\r
2597 recvd_octets_delta,
\r
2598 "Delta Octets recieved");
\r
2603 /**************************************************************************//**
\r
2604 * Set the Accumulated Total Packets Received in measurement interval
\r
2605 * property of the vNIC performance.
\r
2607 * @note The property is treated as immutable: it is only valid to call
\r
2608 * the setter once. However, we don't assert if the caller tries to
\r
2609 * overwrite, just ignoring the update instead.
\r
2611 * @param vnic_performance Pointer to the vNIC Use.
\r
2612 * @param recvd_total_packets_acc
\r
2613 *****************************************************************************/
\r
2614 public void evel_vnic_performance_rx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
2615 double recvd_total_packets_acc)
\r
2619 /***************************************************************************/
\r
2620 /* Check preconditions. */
\r
2621 /***************************************************************************/
\r
2622 assert(recvd_total_packets_acc >= 0.0);
\r
2624 vnic_performance.recvd_total_packets_acc.SetValuePr(
\r
2625 recvd_total_packets_acc,
\r
2626 "Total Packets accumulated");
\r
2631 /**************************************************************************//**
\r
2632 * Set the Delta Total Packets Received in measurement interval
\r
2633 * property of the vNIC performance.
\r
2635 * @note The property is treated as immutable: it is only valid to call
\r
2636 * the setter once. However, we don't assert if the caller tries to
\r
2637 * overwrite, just ignoring the update instead.
\r
2639 * @param vnic_performance Pointer to the vNIC Use.
\r
2640 * @param recvd_total_packets_delta
\r
2641 *****************************************************************************/
\r
2642 public void evel_vnic_performance_rx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
2643 double recvd_total_packets_delta)
\r
2647 /***************************************************************************/
\r
2648 /* Check preconditions. */
\r
2649 /***************************************************************************/
\r
2650 assert(recvd_total_packets_delta >= 0.0);
\r
2652 vnic_performance.recvd_total_packets_delta.SetValuePr(
\r
2653 recvd_total_packets_delta,
\r
2654 "Delta Total Packets recieved");
\r
2659 /**************************************************************************//**
\r
2660 * Set the Accumulated Unicast Packets Received in measurement interval
\r
2661 * property of the vNIC performance.
\r
2663 * @note The property is treated as immutable: it is only valid to call
\r
2664 * the setter once. However, we don't assert if the caller tries to
\r
2665 * overwrite, just ignoring the update instead.
\r
2667 * @param vnic_performance Pointer to the vNIC Use.
\r
2668 * @param recvd_ucast_packets_acc
\r
2669 *****************************************************************************/
\r
2670 public void evel_vnic_performance_rx_ucast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
2671 double recvd_ucast_packets_acc)
\r
2675 /***************************************************************************/
\r
2676 /* Check preconditions. */
\r
2677 /***************************************************************************/
\r
2678 assert(recvd_ucast_packets_acc >= 0.0);
\r
2680 vnic_performance.recvd_ucast_packets_acc.SetValuePr(
\r
2681 recvd_ucast_packets_acc,
\r
2682 "Unicast Packets received accumulated");
\r
2687 /**************************************************************************//**
\r
2688 * Set the Delta Unicast packets Received in measurement interval
\r
2689 * property of the vNIC performance.
\r
2691 * @note The property is treated as immutable: it is only valid to call
\r
2692 * the setter once. However, we don't assert if the caller tries to
\r
2693 * overwrite, just ignoring the update instead.
\r
2695 * @param vnic_performance Pointer to the vNIC Use.
\r
2696 * @param recvd_ucast_packets_delta
\r
2697 *****************************************************************************/
\r
2698 public void evel_vnic_performance_rx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
2699 double recvd_ucast_packets_delta)
\r
2703 /***************************************************************************/
\r
2704 /* Check preconditions. */
\r
2705 /***************************************************************************/
\r
2706 assert(recvd_ucast_packets_delta >= 0.0);
\r
2708 vnic_performance.recvd_ucast_packets_delta.SetValuePr(
\r
2709 recvd_ucast_packets_delta,
\r
2710 "Delta Unicast packets recieved");
\r
2715 /**************************************************************************//**
\r
2716 * Set the Transmitted Broadcast Packets in measurement interval
\r
2717 * property of the vNIC performance.
\r
2719 * @note The property is treated as immutable: it is only valid to call
\r
2720 * the setter once. However, we don't assert if the caller tries to
\r
2721 * overwrite, just ignoring the update instead.
\r
2723 * @param vnic_performance Pointer to the vNIC Use.
\r
2724 * @param tx_bcast_packets_acc
\r
2725 *****************************************************************************/
\r
2726 public void evel_vnic_performance_tx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
2727 double tx_bcast_packets_acc)
\r
2731 /***************************************************************************/
\r
2732 /* Check preconditions. */
\r
2733 /***************************************************************************/
\r
2734 assert(tx_bcast_packets_acc >= 0.0);
\r
2736 vnic_performance.tx_bcast_packets_acc.SetValuePr(
\r
2737 tx_bcast_packets_acc,
\r
2738 "Transmitted Broadcast Packets accumulated");
\r
2743 /**************************************************************************//**
\r
2744 * Set the Delta Broadcast packets Transmitted in measurement interval
\r
2745 * property of the vNIC performance.
\r
2747 * @note The property is treated as immutable: it is only valid to call
\r
2748 * the setter once. However, we don't assert if the caller tries to
\r
2749 * overwrite, just ignoring the update instead.
\r
2751 * @param vnic_performance Pointer to the vNIC Use.
\r
2752 * @param tx_bcast_packets_delta
\r
2753 *****************************************************************************/
\r
2754 public void evel_vnic_performance_tx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
2755 double tx_bcast_packets_delta)
\r
2759 /***************************************************************************/
\r
2760 /* Check preconditions. */
\r
2761 /***************************************************************************/
\r
2762 assert(tx_bcast_packets_delta >= 0.0);
\r
2764 vnic_performance.tx_bcast_packets_delta.SetValuePr(
\r
2765 tx_bcast_packets_delta,
\r
2766 "Delta Transmitted Broadcast packets ");
\r
2771 /**************************************************************************//**
\r
2772 * Set the Transmitted Discarded Packets in measurement interval
\r
2773 * property of the vNIC performance.
\r
2775 * @note The property is treated as immutable: it is only valid to call
\r
2776 * the setter once. However, we don't assert if the caller tries to
\r
2777 * overwrite, just ignoring the update instead.
\r
2779 * @param vnic_performance Pointer to the vNIC Use.
\r
2780 * @param tx_discarded_packets_acc
\r
2781 *****************************************************************************/
\r
2782 public void evel_vnic_performance_tx_discarded_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
2783 double tx_discarded_packets_acc)
\r
2787 /***************************************************************************/
\r
2788 /* Check preconditions. */
\r
2789 /***************************************************************************/
\r
2790 assert(tx_discarded_packets_acc >= 0.0);
\r
2792 vnic_performance.tx_discarded_packets_acc.SetValuePr(
\r
2793 tx_discarded_packets_acc,
\r
2794 "Transmitted Discarded Packets accumulated");
\r
2799 /**************************************************************************//**
\r
2800 * Set the Delta Discarded packets Transmitted in measurement interval
\r
2801 * property of the vNIC performance.
\r
2803 * @note The property is treated as immutable: it is only valid to call
\r
2804 * the setter once. However, we don't assert if the caller tries to
\r
2805 * overwrite, just ignoring the update instead.
\r
2807 * @param vnic_performance Pointer to the vNIC Use.
\r
2808 * @param tx_discarded_packets_delta
\r
2809 *****************************************************************************/
\r
2810 public void evel_vnic_performance_tx_discarded_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
2811 double tx_discarded_packets_delta)
\r
2815 /***************************************************************************/
\r
2816 /* Check preconditions. */
\r
2817 /***************************************************************************/
\r
2818 assert(tx_discarded_packets_delta >= 0.0);
\r
2820 vnic_performance.tx_discarded_packets_delta.SetValuePr(
\r
2821 tx_discarded_packets_delta,
\r
2822 "Delta Transmitted Discarded packets ");
\r
2827 /**************************************************************************//**
\r
2828 * Set the Transmitted Errored Packets in measurement interval
\r
2829 * property of the vNIC performance.
\r
2831 * @note The property is treated as immutable: it is only valid to call
\r
2832 * the setter once. However, we don't assert if the caller tries to
\r
2833 * overwrite, just ignoring the update instead.
\r
2835 * @param vnic_performance Pointer to the vNIC Use.
\r
2836 * @param tx_error_packets_acc
\r
2837 *****************************************************************************/
\r
2838 public void evel_vnic_performance_tx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
2839 double tx_error_packets_acc)
\r
2843 /***************************************************************************/
\r
2844 /* Check preconditions. */
\r
2845 /***************************************************************************/
\r
2846 assert(tx_error_packets_acc >= 0.0);
\r
2848 vnic_performance.tx_error_packets_acc.SetValuePr(
\r
2849 tx_error_packets_acc,
\r
2850 "Transmitted Error Packets accumulated");
\r
2855 /**************************************************************************//**
\r
2856 * Set the Delta Errored packets Transmitted in measurement interval
\r
2857 * property of the vNIC performance.
\r
2859 * @note The property is treated as immutable: it is only valid to call
\r
2860 * the setter once. However, we don't assert if the caller tries to
\r
2861 * overwrite, just ignoring the update instead.
\r
2863 * @param vnic_performance Pointer to the vNIC Use.
\r
2864 * @param tx_error_packets_delta
\r
2865 *****************************************************************************/
\r
2866 public void evel_vnic_performance_tx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
2867 double tx_error_packets_delta)
\r
2871 /***************************************************************************/
\r
2872 /* Check preconditions. */
\r
2873 /***************************************************************************/
\r
2874 assert(tx_error_packets_delta >= 0.0);
\r
2876 vnic_performance.tx_error_packets_delta.SetValuePr(
\r
2877 tx_error_packets_delta,
\r
2878 "Delta Transmitted Error packets ");
\r
2883 /**************************************************************************//**
\r
2884 * Set the Transmitted Multicast Packets in measurement interval
\r
2885 * property of the vNIC performance.
\r
2887 * @note The property is treated as immutable: it is only valid to call
\r
2888 * the setter once. However, we don't assert if the caller tries to
\r
2889 * overwrite, just ignoring the update instead.
\r
2891 * @param vnic_performance Pointer to the vNIC Use.
\r
2892 * @param tx_mcast_packets_acc
\r
2893 *****************************************************************************/
\r
2894 public void evel_vnic_performance_tx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
2895 double tx_mcast_packets_acc)
\r
2899 /***************************************************************************/
\r
2900 /* Check preconditions. */
\r
2901 /***************************************************************************/
\r
2902 assert(tx_mcast_packets_acc >= 0.0);
\r
2904 vnic_performance.tx_mcast_packets_acc.SetValuePr(
\r
2905 tx_mcast_packets_acc,
\r
2906 "Transmitted Multicast Packets accumulated");
\r
2911 /**************************************************************************//**
\r
2912 * Set the Delta Multicast packets Transmitted in measurement interval
\r
2913 * property of the vNIC performance.
\r
2915 * @note The property is treated as immutable: it is only valid to call
\r
2916 * the setter once. However, we don't assert if the caller tries to
\r
2917 * overwrite, just ignoring the update instead.
\r
2919 * @param vnic_performance Pointer to the vNIC Use.
\r
2920 * @param tx_mcast_packets_delta
\r
2921 *****************************************************************************/
\r
2922 public void evel_vnic_performance_tx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
2923 double tx_mcast_packets_delta)
\r
2927 /***************************************************************************/
\r
2928 /* Check preconditions. */
\r
2929 /***************************************************************************/
\r
2930 assert(tx_mcast_packets_delta >= 0.0);
\r
2932 vnic_performance.tx_mcast_packets_delta.SetValuePr(
\r
2933 tx_mcast_packets_delta,
\r
2934 "Delta Transmitted Multicast packets ");
\r
2939 /**************************************************************************//**
\r
2940 * Set the Transmitted Octets in measurement interval
\r
2941 * property of the vNIC performance.
\r
2943 * @note The property is treated as immutable: it is only valid to call
\r
2944 * the setter once. However, we don't assert if the caller tries to
\r
2945 * overwrite, just ignoring the update instead.
\r
2947 * @param vnic_performance Pointer to the vNIC Use.
\r
2948 * @param tx_octets_acc
\r
2949 *****************************************************************************/
\r
2950 public void evel_vnic_performance_tx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
2951 double tx_octets_acc)
\r
2955 /***************************************************************************/
\r
2956 /* Check preconditions. */
\r
2957 /***************************************************************************/
\r
2958 assert(tx_octets_acc >= 0.0);
\r
2960 vnic_performance.tx_octets_acc.SetValuePr(
\r
2962 "Transmitted Octets accumulated");
\r
2967 /**************************************************************************//**
\r
2968 * Set the Delta Octets Transmitted in measurement interval
\r
2969 * property of the vNIC performance.
\r
2971 * @note The property is treated as immutable: it is only valid to call
\r
2972 * the setter once. However, we don't assert if the caller tries to
\r
2973 * overwrite, just ignoring the update instead.
\r
2975 * @param vnic_performance Pointer to the vNIC Use.
\r
2976 * @param tx_octets_delta
\r
2977 *****************************************************************************/
\r
2978 public void evel_vnic_performance_tx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
2979 double tx_octets_delta)
\r
2983 /***************************************************************************/
\r
2984 /* Check preconditions. */
\r
2985 /***************************************************************************/
\r
2986 assert(tx_octets_delta >= 0.0);
\r
2988 vnic_performance.tx_octets_delta.SetValuePr(
\r
2990 "Delta Transmitted Octets ");
\r
2996 /**************************************************************************//**
\r
2997 * Set the Transmitted Total Packets in measurement interval
\r
2998 * property of the vNIC performance.
\r
3000 * @note The property is treated as immutable: it is only valid to call
\r
3001 * the setter once. However, we don't assert if the caller tries to
\r
3002 * overwrite, just ignoring the update instead.
\r
3004 * @param vnic_performance Pointer to the vNIC Use.
\r
3005 * @param tx_total_packets_acc
\r
3006 *****************************************************************************/
\r
3007 public void evel_vnic_performance_tx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
3008 double tx_total_packets_acc)
\r
3012 /***************************************************************************/
\r
3013 /* Check preconditions. */
\r
3014 /***************************************************************************/
\r
3015 assert(tx_total_packets_acc >= 0.0);
\r
3017 vnic_performance.tx_total_packets_acc.SetValuePr(
\r
3018 tx_total_packets_acc,
\r
3019 "Transmitted Total Packets accumulated");
\r
3024 /**************************************************************************//**
\r
3025 * Set the Delta Total Packets Transmitted in measurement interval
\r
3026 * property of the vNIC performance.
\r
3028 * @note The property is treated as immutable: it is only valid to call
\r
3029 * the setter once. However, we don't assert if the caller tries to
\r
3030 * overwrite, just ignoring the update instead.
\r
3032 * @param vnic_performance Pointer to the vNIC Use.
\r
3033 * @param tx_total_packets_delta
\r
3034 *****************************************************************************/
\r
3035 public void evel_vnic_performance_tx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
3036 double tx_total_packets_delta)
\r
3040 /***************************************************************************/
\r
3041 /* Check preconditions. */
\r
3042 /***************************************************************************/
\r
3043 assert(tx_total_packets_delta >= 0.0);
\r
3045 vnic_performance.tx_total_packets_delta.SetValuePr(
\r
3046 tx_total_packets_delta,
\r
3047 "Delta Transmitted Total Packets ");
\r
3053 /**************************************************************************//**
\r
3054 * Set the Transmitted Unicast Packets in measurement interval
\r
3055 * property of the vNIC performance.
\r
3057 * @note The property is treated as immutable: it is only valid to call
\r
3058 * the setter once. However, we don't assert if the caller tries to
\r
3059 * overwrite, just ignoring the update instead.
\r
3061 * @param vnic_performance Pointer to the vNIC Use.
\r
3062 * @param tx_ucast_packets_acc
\r
3063 *****************************************************************************/
\r
3064 public void evel_vnic_performance_tx_ucast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
3065 double tx_ucast_packets_acc)
\r
3069 /***************************************************************************/
\r
3070 /* Check preconditions. */
\r
3071 /***************************************************************************/
\r
3072 assert(tx_ucast_packets_acc >= 0.0);
\r
3074 vnic_performance.tx_ucast_packets_acc.SetValuePr(
\r
3075 tx_ucast_packets_acc,
\r
3076 "Transmitted Unicast Packets accumulated");
\r
3081 /**************************************************************************//**
\r
3082 * Set the Delta Octets Transmitted in measurement interval
\r
3083 * property of the vNIC performance.
\r
3085 * @note The property is treated as immutable: it is only valid to call
\r
3086 * the setter once. However, we don't assert if the caller tries to
\r
3087 * overwrite, just ignoring the update instead.
\r
3089 * @param vnic_performance Pointer to the vNIC Use.
\r
3090 * @param tx_ucast_packets_delta
\r
3091 *****************************************************************************/
\r
3092 public void evel_vnic_performance_tx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance,
\r
3093 double tx_ucast_packets_delta)
\r
3097 /***************************************************************************/
\r
3098 /* Check preconditions. */
\r
3099 /***************************************************************************/
\r
3100 assert(tx_ucast_packets_delta >= 0.0);
\r
3102 vnic_performance.tx_ucast_packets_delta.SetValuePr(
\r
3103 tx_ucast_packets_delta,
\r
3104 "Delta Transmitted Unicast Packets ");
\r
3110 /**************************************************************************//**
\r
3111 * Add an additional vNIC Use to the specified Measurement event.
\r
3114 * @param vnic_performance Pointer to the vNIC Use to add.
\r
3115 *****************************************************************************/
\r
3116 public void evel_meas_vnic_performance_add(
\r
3117 MEASUREMENT_VNIC_PERFORMANCE vnic_performance)
\r
3121 /***************************************************************************/
\r
3122 /* Check preconditions. */
\r
3123 /***************************************************************************/
\r
3125 assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT);
\r
3126 assert(vnic_performance != null);
\r
3128 if( vnic_usage == null ){
\r
3129 vnic_usage = new ArrayList<MEASUREMENT_VNIC_PERFORMANCE>();
\r
3130 if( vnic_usage == null )LOGGER.error("Unable to allocate new file system usage");
\r
3133 vnic_usage.add(vnic_performance);
\r
3138 /**************************************************************************//**
\r
3139 * Add an additional vNIC usage record Measurement.
\r
3141 * This function implements the previous API, purely for convenience.
\r
3143 * The ID is null delimited ASCII string. The library takes a copy so the
\r
3144 * caller does not have to preserve values after the function returns.
\r
3146 * @param measurement Pointer to the measurement.
\r
3147 * @param vnic_id ASCIIZ string with the vNIC's ID.
\r
3148 * @param valset true or false confidence level
\r
3149 * @param recvd_bcast_packets_acc Recieved broadcast packets
\r
3150 * @param recvd_bcast_packets_delta Received delta broadcast packets
\r
3151 * @param recvd_discarded_packets_acc Recieved discarded packets
\r
3152 * @param recvd_discarded_packets_delta Received discarded delta packets
\r
3153 * @param recvd_error_packets_acc Received error packets
\r
3154 * @param recvd_error_packets_delta, Received delta error packets
\r
3155 * @param recvd_mcast_packets_acc Received multicast packets
\r
3156 * @param recvd_mcast_packets_delta Received delta multicast packets
\r
3157 * @param recvd_octets_acc Received octets
\r
3158 * @param recvd_octets_delta Received delta octets
\r
3159 * @param recvd_total_packets_acc Received total packets
\r
3160 * @param recvd_total_packets_delta Received delta total packets
\r
3161 * @param recvd_ucast_packets_acc Received Unicast packets
\r
3162 * @param recvd_ucast_packets_delta Received delta unicast packets
\r
3163 * @param tx_bcast_packets_acc Transmitted broadcast packets
\r
3164 * @param tx_bcast_packets_delta Transmitted delta broadcast packets
\r
3165 * @param tx_discarded_packets_acc Transmitted packets discarded
\r
3166 * @param tx_discarded_packets_delta Transmitted delta discarded packets
\r
3167 * @param tx_error_packets_acc Transmitted error packets
\r
3168 * @param tx_error_packets_delta Transmitted delta error packets
\r
3169 * @param tx_mcast_packets_acc Transmitted multicast packets accumulated
\r
3170 * @param tx_mcast_packets_delta Transmitted delta multicast packets
\r
3171 * @param tx_octets_acc Transmitted octets
\r
3172 * @param tx_octets_delta Transmitted delta octets
\r
3173 * @param tx_total_packets_acc Transmitted total packets
\r
3174 * @param tx_total_packets_delta Transmitted delta total packets
\r
3175 * @param tx_ucast_packets_acc Transmitted Unicast packets
\r
3176 * @param tx_ucast_packets_delta Transmitted delta Unicast packets
\r
3177 *****************************************************************************/
\r
3178 public void evel_measurement_vnic_performance_add(
\r
3181 double recvd_bcast_packets_acc,
\r
3182 double recvd_bcast_packets_delta,
\r
3183 double recvd_discarded_packets_acc,
\r
3184 double recvd_discarded_packets_delta,
\r
3185 double recvd_error_packets_acc,
\r
3186 double recvd_error_packets_delta,
\r
3187 double recvd_mcast_packets_acc,
\r
3188 double recvd_mcast_packets_delta,
\r
3189 double recvd_octets_acc,
\r
3190 double recvd_octets_delta,
\r
3191 double recvd_total_packets_acc,
\r
3192 double recvd_total_packets_delta,
\r
3193 double recvd_ucast_packets_acc,
\r
3194 double recvd_ucast_packets_delta,
\r
3195 double tx_bcast_packets_acc,
\r
3196 double tx_bcast_packets_delta,
\r
3197 double tx_discarded_packets_acc,
\r
3198 double tx_discarded_packets_delta,
\r
3199 double tx_error_packets_acc,
\r
3200 double tx_error_packets_delta,
\r
3201 double tx_mcast_packets_acc,
\r
3202 double tx_mcast_packets_delta,
\r
3203 double tx_octets_acc,
\r
3204 double tx_octets_delta,
\r
3205 double tx_total_packets_acc,
\r
3206 double tx_total_packets_delta,
\r
3207 double tx_ucast_packets_acc,
\r
3208 double tx_ucast_packets_delta)
\r
3210 MEASUREMENT_VNIC_PERFORMANCE vnic_performance = null;
\r
3213 /***************************************************************************/
\r
3214 /* Trust the assertions in the underlying methods. */
\r
3215 /***************************************************************************/
\r
3216 vnic_performance = evel_measurement_new_vnic_performance(vnic_id, valset);
\r
3218 evel_vnic_performance_rx_bcast_pkt_acc_set(vnic_performance, recvd_bcast_packets_acc);
\r
3219 evel_vnic_performance_rx_bcast_pkt_delta_set(vnic_performance, recvd_bcast_packets_delta);
\r
3220 evel_vnic_performance_rx_discard_pkt_acc_set(vnic_performance, recvd_discarded_packets_acc);
\r
3221 evel_vnic_performance_rx_discard_pkt_delta_set(vnic_performance, recvd_discarded_packets_delta);
\r
3222 evel_vnic_performance_rx_error_pkt_acc_set(vnic_performance, recvd_error_packets_acc);
\r
3223 evel_vnic_performance_rx_error_pkt_delta_set(vnic_performance, recvd_error_packets_delta);
\r
3224 evel_vnic_performance_rx_mcast_pkt_acc_set(vnic_performance, recvd_mcast_packets_acc);
\r
3225 evel_vnic_performance_rx_mcast_pkt_delta_set(vnic_performance, recvd_mcast_packets_delta);
\r
3226 evel_vnic_performance_rx_octets_acc_set(vnic_performance, recvd_octets_acc);
\r
3227 evel_vnic_performance_rx_octets_delta_set(vnic_performance, recvd_octets_delta);
\r
3228 evel_vnic_performance_rx_total_pkt_acc_set(vnic_performance, recvd_total_packets_acc);
\r
3229 evel_vnic_performance_rx_total_pkt_delta_set(vnic_performance, recvd_total_packets_delta);
\r
3230 evel_vnic_performance_rx_ucast_pkt_acc_set(vnic_performance, recvd_ucast_packets_acc);
\r
3231 evel_vnic_performance_rx_ucast_pkt_delta_set(vnic_performance, recvd_ucast_packets_delta);
\r
3232 evel_vnic_performance_tx_bcast_pkt_acc_set(vnic_performance, tx_bcast_packets_acc);
\r
3233 evel_vnic_performance_tx_bcast_pkt_delta_set(vnic_performance, tx_bcast_packets_delta);
\r
3234 evel_vnic_performance_tx_discarded_pkt_acc_set(vnic_performance, tx_discarded_packets_acc);
\r
3235 evel_vnic_performance_tx_discarded_pkt_delta_set(vnic_performance, tx_discarded_packets_delta);
\r
3236 evel_vnic_performance_tx_error_pkt_acc_set(vnic_performance, tx_error_packets_acc);
\r
3237 evel_vnic_performance_tx_error_pkt_delta_set(vnic_performance, tx_error_packets_delta);
\r
3238 evel_vnic_performance_tx_mcast_pkt_acc_set(vnic_performance, tx_mcast_packets_acc);
\r
3239 evel_vnic_performance_tx_mcast_pkt_delta_set(vnic_performance, tx_mcast_packets_delta);
\r
3240 evel_vnic_performance_tx_octets_acc_set(vnic_performance, tx_octets_acc);
\r
3241 evel_vnic_performance_tx_octets_delta_set(vnic_performance, tx_octets_delta);
\r
3242 evel_vnic_performance_tx_total_pkt_acc_set(vnic_performance, tx_total_packets_acc);
\r
3243 evel_vnic_performance_tx_total_pkt_delta_set(vnic_performance, tx_total_packets_delta);
\r
3244 evel_vnic_performance_tx_ucast_pkt_acc_set(vnic_performance, tx_ucast_packets_acc);
\r
3245 evel_vnic_performance_tx_ucast_pkt_delta_set(vnic_performance, tx_ucast_packets_delta);
\r
3247 if( vnic_usage == null ){
\r
3248 vnic_usage = new ArrayList<MEASUREMENT_VNIC_PERFORMANCE>();
\r
3249 if( vnic_usage == null )LOGGER.error("Unable to allocate new file system usage");
\r
3252 vnic_usage.add(vnic_performance);
\r
3255 /**************************************************************************//**
\r
3256 * Add a json object to jsonObject list.
\r
3258 * The name and value are null delimited ASCII strings. The library takes
\r
3259 * a copy so the caller does not have to preserve values after the function
\r
3262 * @param jsonobj Pointer to json object
\r
3263 *****************************************************************************/
\r
3264 public void evel_measurement_add_jsonobj(javax.json.JsonObject jsonobj)
\r
3269 /***************************************************************************/
\r
3270 /* Check preconditions. */
\r
3271 /***************************************************************************/
\r
3272 assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT);
\r
3273 assert(jsonobj != null);
\r
3275 LOGGER.debug("Adding jsonObject");
\r
3277 if( additional_objects == null )
\r
3278 additional_objects = new ArrayList<javax.json.JsonObject>();
\r
3280 additional_objects.add(jsonobj);
\r
3285 /**************************************************************************//**
\r
3286 * Encode Scaling Measurement Object according to VES schema
\r
3288 * @retval JSON Object of Scaling Measurement event
\r
3289 *****************************************************************************/
\r
3290 JsonObjectBuilder evelScalingMeasurementObject()
\r
3292 MEASUREMENT_CPU_USE cpu_use = null;
\r
3293 MEASUREMENT_MEM_USE mem_use = null;
\r
3294 MEASUREMENT_DISK_USE disk_use = null;
\r
3295 MEASUREMENT_FSYS_USE fsys_use = null;
\r
3296 MEASUREMENT_LATENCY_BUCKET bucket = null;
\r
3297 MEASUREMENT_VNIC_PERFORMANCE vnic_use = null;
\r
3298 MEASUREMENT_FEATURE_USE feature_use = null;
\r
3299 MEASUREMENT_CODEC_USE codec_use = null;
\r
3300 MEASUREMENT_GROUP meas_group = null;
\r
3301 CUSTOM_MEASUREMENT custom_meas = null;
\r
3302 //DLIST_ITEM item = null;
\r
3303 //DLIST_ITEM nested_item = null;
\r
3304 //DLIST_ITEM addl_info_item = null;
\r
3305 //OTHER_FIELD addl_info = null;
\r
3306 double version = major_version+(double)minor_version/10;
\r
3310 /***************************************************************************/
\r
3311 /* Check preconditions. */
\r
3312 /***************************************************************************/
\r
3313 assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT);
\r
3315 /***************************************************************************/
\r
3316 /* Mandatory fields. */
\r
3317 /***************************************************************************/
\r
3318 JsonObjectBuilder evelmeasmt = Json.createObjectBuilder()
\r
3319 .add("measurementInterval", measurement_interval);
\r
3321 /***************************************************************************/
\r
3322 /* Optional fields. */
\r
3323 /***************************************************************************/
\r
3324 // additional fields
\r
3325 if( additional_info != null )
\r
3327 JsonArrayBuilder builder = Json.createArrayBuilder();
\r
3328 for(int i=0;i<additional_info.size();i++) {
\r
3329 String[] addl_info = additional_info.get(i);
\r
3330 JsonObject obj = Json.createObjectBuilder()
\r
3331 .add("name", addl_info[0])
\r
3332 .add("value", addl_info[1]).build();
\r
3335 evelmeasmt.add("additionalFields", builder);
\r
3339 // TBD additional json objects
\r
3340 if( concurrent_sessions.is_set )
\r
3341 evelmeasmt.add("concurrentSessions", concurrent_sessions.GetValue());
\r
3342 if( configured_entities.is_set )
\r
3343 evelmeasmt.add("configuredEntities", configured_entities.GetValue());
\r
3345 /***************************************************************************/
\r
3346 /* CPU Use list. */
\r
3347 /***************************************************************************/
\r
3348 if( cpu_usage != null && cpu_usage.size() > 0 )
\r
3350 JsonArrayBuilder builder = Json.createArrayBuilder();
\r
3351 for(int i=0;i<cpu_usage.size();i++) {
\r
3352 cpu_use = cpu_usage.get(i);
\r
3353 JsonObjectBuilder obj = Json.createObjectBuilder()
\r
3354 .add( "cpuIdentifier", cpu_use.id)
\r
3355 .add( "percentUsage",cpu_use.usage);
\r
3357 cpu_use.idle.encJsonValue(obj,"cpuIdle");
\r
3358 cpu_use.intrpt.encJsonValue(obj,"cpuUsageInterrupt");
\r
3359 cpu_use.nice.encJsonValue(obj,"cpuUsageNice");
\r
3360 cpu_use.softirq.encJsonValue(obj,"cpuUsageSoftIrq");
\r
3361 cpu_use.steal.encJsonValue(obj,"cpuUsageSteal");
\r
3362 cpu_use.sys.encJsonValue(obj,"cpuUsageSystem");
\r
3363 cpu_use.user.encJsonValue(obj,"cpuUsageUser");
\r
3364 cpu_use.wait.encJsonValue(obj,"cpuWait");
\r
3366 builder.add(obj.build());
\r
3368 evelmeasmt.add("cpuUsageArray", builder);
\r
3373 /***************************************************************************/
\r
3374 /* Disk Use list. */
\r
3375 /***************************************************************************/
\r
3376 if( disk_usage != null && disk_usage.size() > 0 )
\r
3378 JsonArrayBuilder builder = Json.createArrayBuilder();
\r
3379 for(int i=0;i<disk_usage.size();i++) {
\r
3380 disk_use = disk_usage.get(i);
\r
3381 JsonObjectBuilder obj = Json.createObjectBuilder()
\r
3382 .add( "diskIdentifier", disk_use.id);
\r
3384 disk_use.iotimeavg.encJsonValue(obj,"diskIoTimeAvg");
\r
3385 disk_use.iotimelast.encJsonValue(obj,"diskIoTimeLast");
\r
3386 disk_use.iotimemax.encJsonValue(obj,"diskIoTimeMax");
\r
3387 disk_use.iotimemin.encJsonValue(obj,"diskIoTimeMin");
\r
3388 disk_use.mergereadavg.encJsonValue(obj,"diskMergedReadAvg");
\r
3389 disk_use.mergereadlast.encJsonValue(obj,"diskMergedReadLast");
\r
3390 disk_use.mergereadmax.encJsonValue(obj,"diskMergedReadMax");
\r
3391 disk_use.mergereadmin.encJsonValue(obj,"diskMergedReadMin");
\r
3392 disk_use.mergewriteavg.encJsonValue(obj,"diskMergedWriteAvg");
\r
3393 disk_use.mergewritelast.encJsonValue(obj,"diskMergedWriteLast");
\r
3394 disk_use.mergewritemax.encJsonValue(obj,"diskMergedWriteMax");
\r
3395 disk_use.mergewritemin.encJsonValue(obj,"diskMergedWriteMin");
\r
3396 disk_use.octetsreadavg.encJsonValue(obj,"diskOctetsReadAvg");
\r
3397 disk_use.octetsreadlast.encJsonValue(obj,"diskOctetsReadLast");
\r
3398 disk_use.octetsreadmax.encJsonValue(obj,"diskOctetsReadMax");
\r
3399 disk_use.octetsreadmin.encJsonValue(obj,"diskOctetsReadMin");
\r
3400 disk_use.octetswriteavg.encJsonValue(obj,"diskOctetsWriteAvg");
\r
3401 disk_use.octetswritelast.encJsonValue(obj,"diskOctetsWriteLast");
\r
3402 disk_use.octetswritemax.encJsonValue(obj,"diskOctetsWriteMax");
\r
3403 disk_use.octetswritemin.encJsonValue(obj,"diskOctetsWriteMin");
\r
3404 disk_use.opsreadavg.encJsonValue(obj,"diskOpsReadAvg");
\r
3405 disk_use.opsreadlast.encJsonValue(obj,"diskOpsReadLast");
\r
3406 disk_use.opsreadmax.encJsonValue(obj,"diskOpsReadMax");
\r
3407 disk_use.opsreadmin.encJsonValue(obj,"diskOpsReadMin");
\r
3408 disk_use.opswriteavg.encJsonValue(obj,"diskOpsWriteAvg");
\r
3409 disk_use.opswritelast.encJsonValue(obj,"diskOpsWriteLast");
\r
3410 disk_use.opswritemax.encJsonValue(obj,"diskOpsWriteMax");
\r
3411 disk_use.opswritemin.encJsonValue(obj,"diskOpsWriteMin");
\r
3412 disk_use.pendingopsavg.encJsonValue(obj,"diskPendingOperationsAvg");
\r
3413 disk_use.pendingopslast.encJsonValue(obj,"diskPendingOperationsLast");
\r
3414 disk_use.pendingopsmax.encJsonValue(obj,"diskPendingOperationsMax");
\r
3415 disk_use.pendingopsmin.encJsonValue(obj,"diskPendingOperationsMin");
\r
3416 disk_use.timereadavg.encJsonValue(obj,"diskTimeReadAvg");
\r
3417 disk_use.timereadlast.encJsonValue(obj,"diskTimeReadLast");
\r
3418 disk_use.timereadmax.encJsonValue(obj,"diskTimeReadMax");
\r
3419 disk_use.timereadmin.encJsonValue(obj,"diskTimeReadMin");
\r
3420 disk_use.timewriteavg.encJsonValue(obj,"diskTimeWriteAvg");
\r
3421 disk_use.timewritelast.encJsonValue(obj,"diskTimeWriteLast");
\r
3422 disk_use.timewritemax.encJsonValue(obj,"diskTimeWriteMax");
\r
3423 disk_use.timewritemin.encJsonValue(obj,"diskTimeWriteMin");
\r
3425 builder.add(obj.build());
\r
3427 evelmeasmt.add("diskUsageArray", builder);
\r
3431 /***************************************************************************/
\r
3432 /* Filesystem Usage list. */
\r
3433 /***************************************************************************/
\r
3434 if( filesystem_usage != null && filesystem_usage.size() > 0 )
\r
3436 JsonArrayBuilder builder = Json.createArrayBuilder();
\r
3437 for(int i=0;i<filesystem_usage.size();i++) {
\r
3438 fsys_use = filesystem_usage.get(i);
\r
3439 JsonObject obj = Json.createObjectBuilder()
\r
3440 .add("blockConfigured", fsys_use.block_configured)
\r
3441 .add("blockIops", fsys_use.block_iops)
\r
3442 .add("blockUsed", fsys_use.block_used)
\r
3443 .add("ephemeralConfigured", fsys_use.ephemeral_configured)
\r
3444 .add("ephemeralIops", fsys_use.ephemeral_iops)
\r
3445 .add("ephemeralUsed", fsys_use.ephemeral_used)
\r
3446 .add("filesystemName", fsys_use.filesystem_name)
\r
3450 evelmeasmt.add("filesystemUsageArray", builder);
\r
3453 /***************************************************************************/
\r
3454 /* Latency distribution. */
\r
3455 /***************************************************************************/
\r
3456 if( latency_distribution != null && latency_distribution.size() > 0 )
\r
3458 JsonArrayBuilder builder = Json.createArrayBuilder();
\r
3459 for(int i=0;i<latency_distribution.size();i++) {
\r
3460 bucket = latency_distribution.get(i);
\r
3461 JsonObjectBuilder obj = Json.createObjectBuilder()
\r
3462 .add( "countsInTheBucket", bucket.count);
\r
3464 bucket.low_end.encJsonValue(obj,"lowEndOfLatencyBucket");
\r
3465 bucket.high_end.encJsonValue(obj,"highEndOfLatencyBucket");
\r
3467 builder.add(obj.build());
\r
3469 evelmeasmt.add("latencyDistribution", builder);
\r
3472 mean_request_latency.encJsonValue(evelmeasmt, "meanRequestLatency");
\r
3473 request_rate.encJsonValue(evelmeasmt, "requestRate");
\r
3475 /***************************************************************************/
\r
3476 /* vNIC Usage TBD Performance array */
\r
3477 /***************************************************************************/
\r
3478 if( vnic_usage!= null && vnic_usage.size() > 0 )
\r
3480 JsonArrayBuilder builder = Json.createArrayBuilder();
\r
3481 for(int i=0;i<vnic_usage.size();i++) {
\r
3482 vnic_use = vnic_usage.get(i);
\r
3483 JsonObjectBuilder obj = Json.createObjectBuilder()
\r
3484 .add( "vNicIdentifier", vnic_use.vnic_id)
\r
3485 .add( "valuesAreSuspect",vnic_use.valuesaresuspect);
\r
3488 /*********************************************************************/
\r
3489 /* Optional fields. */
\r
3490 /*********************************************************************/
\r
3491 vnic_use.recvd_bcast_packets_acc.encJsonValue(obj,"receivedBroadcastPacketsAccumulated");
\r
3492 vnic_use.recvd_bcast_packets_delta.encJsonValue(obj,"receivedBroadcastPacketsDelta");
\r
3493 vnic_use.recvd_discarded_packets_acc.encJsonValue(obj,"receivedDiscardedPacketsAccumulated");
\r
3494 vnic_use.recvd_discarded_packets_delta.encJsonValue(obj,"receivedDiscardedPacketsDelta");
\r
3495 vnic_use.recvd_error_packets_acc.encJsonValue(obj,"receivedErrorPacketsAccumulated");
\r
3496 vnic_use.recvd_error_packets_delta.encJsonValue(obj,"receivedErrorPacketsDelta");
\r
3498 vnic_use.recvd_mcast_packets_acc.encJsonValue(obj,"receivedMulticastPacketsAccumulated");
\r
3499 vnic_use.recvd_mcast_packets_delta.encJsonValue(obj,"receivedMulticastPacketsDelta");
\r
3500 vnic_use.recvd_octets_acc.encJsonValue(obj,"receivedOctetsAccumulated");
\r
3501 vnic_use.recvd_octets_delta.encJsonValue(obj,"receivedOctetsDelta");
\r
3503 vnic_use.recvd_total_packets_acc.encJsonValue(obj,"receivedTotalPacketsAccumulated");
\r
3504 vnic_use.recvd_total_packets_delta.encJsonValue(obj,"receivedTotalPacketsDelta");
\r
3505 vnic_use.recvd_ucast_packets_acc.encJsonValue(obj,"receivedUnicastPacketsAccumulated");
\r
3506 vnic_use.recvd_ucast_packets_delta.encJsonValue(obj,"receivedUnicastPacketsDelta");
\r
3508 vnic_use.tx_bcast_packets_acc.encJsonValue(obj,"transmittedBroadcastPacketsAccumulated");
\r
3509 vnic_use.tx_bcast_packets_delta.encJsonValue(obj,"transmittedBroadcastPacketsDelta");
\r
3510 vnic_use.tx_discarded_packets_acc.encJsonValue(obj,"transmittedDiscardedPacketsAccumulated");
\r
3511 vnic_use.tx_discarded_packets_delta.encJsonValue(obj,"transmittedDiscardedPacketsDelta");
\r
3513 vnic_use.tx_error_packets_acc.encJsonValue(obj,"transmittedErrorPacketsAccumulated");
\r
3514 vnic_use.tx_error_packets_delta.encJsonValue(obj,"transmittedErrorPacketsDelta");
\r
3515 vnic_use.tx_mcast_packets_acc.encJsonValue(obj,"transmittedMulticastPacketsAccumulated");
\r
3516 vnic_use.tx_mcast_packets_delta.encJsonValue(obj,"transmittedMulticastPacketsDelta");
\r
3518 vnic_use.tx_octets_acc.encJsonValue(obj,"transmittedOctetsAccumulated");
\r
3519 vnic_use.tx_octets_delta.encJsonValue(obj,"transmittedOctetsDelta");
\r
3520 vnic_use.tx_total_packets_acc.encJsonValue(obj,"transmittedTotalPacketsAccumulated");
\r
3521 vnic_use.tx_total_packets_delta.encJsonValue(obj,"transmittedTotalPacketsDelta");
\r
3522 vnic_use.tx_ucast_packets_acc.encJsonValue(obj,"transmittedUnicastPacketsAccumulated");
\r
3523 vnic_use.tx_ucast_packets_delta.encJsonValue(obj,"transmittedUnicastPacketsDelta");
\r
3525 builder.add(obj.build());
\r
3527 evelmeasmt.add("vNicUsageArray", builder);
\r
3532 /***************************************************************************/
\r
3533 /* Memory Use list. */
\r
3534 /***************************************************************************/
\r
3535 if( mem_usage != null && mem_usage.size() > 0 )
\r
3537 JsonArrayBuilder builder = Json.createArrayBuilder();
\r
3538 for(int i=0;i<mem_usage.size();i++) {
\r
3539 mem_use = mem_usage.get(i);
\r
3540 JsonObjectBuilder obj = Json.createObjectBuilder()
\r
3541 .add( "memIdentifier", mem_use.id)
\r
3542 .add( "vmIdentifier", mem_use.vmid)
\r
3543 .add( "percentUsage",mem_use.membuffsz);
\r
3545 mem_use.memcache.encJsonValue(obj,"memoryCached");
\r
3546 mem_use.memconfig.encJsonValue(obj,"memoryConfigured");
\r
3547 mem_use.memfree.encJsonValue(obj,"memoryFree");
\r
3548 mem_use.slabrecl.encJsonValue(obj,"memorySlabRecl");
\r
3549 mem_use.slabunrecl.encJsonValue(obj,"memorySlabUnrecl");
\r
3550 mem_use.memused.encJsonValue(obj,"memoryUsed");
\r
3552 builder.add(obj.build());
\r
3554 evelmeasmt.add("memUsageArray", builder);
\r
3557 media_ports_in_use.encJsonValue(evelmeasmt, "numberOfMediaPortsInUse");
\r
3558 vnfc_scaling_metric.encJsonValue(evelmeasmt, "vnfcScalingMetric");
\r
3561 /***************************************************************************/
\r
3562 /* myerrors list. */
\r
3563 /***************************************************************************/
\r
3564 if (errstat == true && myerrors != null)
\r
3566 evelmeasmt.add("receiveDiscards", myerrors.receive_discards);
\r
3567 evelmeasmt.add("receivemyerrors", myerrors.receive_myerrors);
\r
3568 evelmeasmt.add("transmitDiscards", myerrors.transmit_discards);
\r
3569 evelmeasmt.add("transmitmyerrors", myerrors.transmit_myerrors);
\r
3572 /***************************************************************************/
\r
3573 /* Feature Utilization list. */
\r
3574 /***************************************************************************/
\r
3575 if( feature_usage != null && feature_usage.size() > 0 )
\r
3577 JsonArrayBuilder builder = Json.createArrayBuilder();
\r
3578 for(int i=0;i<feature_usage.size();i++) {
\r
3579 feature_use = feature_usage.get(i);
\r
3580 JsonObjectBuilder obj = Json.createObjectBuilder()
\r
3581 .add( "featureIdentifier", feature_use.feature_id)
\r
3582 .add( "featureUtilization", feature_use.feature_utilization);
\r
3584 builder.add(obj.build());
\r
3586 evelmeasmt.add("featureUsageArray", builder);
\r
3590 /***************************************************************************/
\r
3591 /* Codec Utilization list. */
\r
3592 /***************************************************************************/
\r
3593 if( codec_usage != null && codec_usage.size() > 0 )
\r
3595 JsonArrayBuilder builder = Json.createArrayBuilder();
\r
3596 for(int i=0;i<codec_usage.size();i++) {
\r
3597 codec_use = codec_usage.get(i);
\r
3598 JsonObjectBuilder obj = Json.createObjectBuilder()
\r
3599 .add( "codecIdentifier", codec_use.codec_id)
\r
3600 .add( "numberInUse", codec_use.number_in_use);
\r
3602 builder.add(obj.build());
\r
3604 evelmeasmt.add("codecUsageArray", builder);
\r
3608 /***************************************************************************/
\r
3609 /* Additional Measurement Groups list. */
\r
3610 /***************************************************************************/
\r
3611 if( additional_measurements != null && additional_measurements.size() > 0 )
\r
3613 JsonArrayBuilder builder = Json.createArrayBuilder();
\r
3614 for(int i=0;i<additional_measurements.size();i++) {
\r
3615 meas_group = additional_measurements.get(i);
\r
3616 JsonObjectBuilder obj = Json.createObjectBuilder()
\r
3617 .add( "name", meas_group.name);
\r
3618 JsonArrayBuilder builder2 = Json.createArrayBuilder();
\r
3619 for(int j=0;j<meas_group.measurements.size();j++) {
\r
3620 custom_meas = meas_group.measurements.get(j);
\r
3621 JsonObjectBuilder obj2 = Json.createObjectBuilder()
\r
3622 .add("name", custom_meas.name)
\r
3623 .add("value",custom_meas.value);
\r
3624 builder2.add(obj2.build());
\r
3626 obj.add("arrayOfFields", builder2);
\r
3627 builder.add(obj.build());
\r
3629 evelmeasmt.add("additionalMeasurements", builder);
\r
3632 /***************************************************************************/
\r
3633 /* Additional Objects. */
\r
3634 /***************************************************************************/
\r
3635 if( additional_objects != null && additional_objects.size() > 0 )
\r
3637 JsonArrayBuilder builder = Json.createArrayBuilder();
\r
3638 for(int i=0;i<additional_objects.size();i++) {
\r
3639 JsonObject jobj = additional_objects.get(i);
\r
3640 builder.add(jobj);
\r
3642 evelmeasmt.add("additionalObjects",builder);
\r
3645 /***************************************************************************/
\r
3646 /* Although optional, we always generate the version. Note that this */
\r
3647 /* closes the object, too. */
\r
3648 /***************************************************************************/
\r
3649 evelmeasmt.add("measurementsForVfScalingVersion", version);
\r
3653 return evelmeasmt;
\r
3656 /**************************************************************************//**
\r
3657 * Encode the event as a JSON event object according to AT&T's schema.
\r
3659 * retval : String of JSON event message
\r
3660 *****************************************************************************/
\r
3661 String evel_json_encode_event()
\r
3665 assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_STATE_CHANGE);
\r
3666 //encode common event header and measurement body
\r
3667 JsonObject obj = Json.createObjectBuilder()
\r
3668 .add("event", Json.createObjectBuilder()
\r
3669 .add( "commonEventHeader",eventHeaderObject() )
\r
3670 .add( "measurementsForVfScalingFields",evelScalingMeasurementObject() )
\r
3675 return obj.toString();
\r