From 16f861742ff1a59f049170773c8edc974cfeb927 Mon Sep 17 00:00:00 2001 From: "PATRACHARI, GAYATHRI (gp2421)" Date: Thu, 20 Sep 2018 08:10:49 -0400 Subject: VesAgent VES7.0 updates Issue-ID: VNFSDK-328 Change-Id: I7e06286e0f058be9b851225055f7b74dbd71ceee Signed-off-by: PATRACHARI, GAYATHRI (gp2421) --- .../java/evel_javalibrary/att/com/EvelFault.java | 87 +- .../java/evel_javalibrary/att/com/EvelHeader.java | 150 +- .../att/com/EvelHeartbeatField.java | 70 +- .../evel_javalibrary/att/com/EvelMobileFlow.java | 186 +- .../evel_javalibrary/att/com/EvelNotification.java | 511 +++ .../java/evel_javalibrary/att/com/EvelOther.java | 38 +- .../att/com/EvelPnfRegistration.java | 393 +++ .../att/com/EvelScalingMeasurement.java | 3499 ++++++++++++++++++-- .../evel_javalibrary/att/com/EvelSipSignaling.java | 29 +- .../evel_javalibrary/att/com/EvelStateChange.java | 49 +- .../java/evel_javalibrary/att/com/EvelSyslog.java | 137 +- .../att/com/EvelThresholdCross.java | 330 +- .../evel_javalibrary/att/com/EvelVoiceQuality.java | 127 +- .../evel_javalibrary/att/com/loadbalance/Main.java | 64 + .../att/com/loadbalance/MeasureData.java | 375 +++ .../att/com/loadbalance/faultData.java | 286 ++ .../att/com/loadbalance/fw_common_config.txt | 9 + .../att/com/loadbalance/fw_config.txt | 10 + .../att/com/loadbalance/fw_flt_config.txt | 3 + .../att/com/loadbalance/fw_hb_config.txt | 2 + .../att/com/loadbalance/fw_interface_config.txt | 13 + .../att/com/loadbalance/fw_meas_config.txt | 2 + .../att/com/loadbalance/heartBeatData.java | 153 + .../evel_javalibrary/att/com/maindir/Main.java | 659 ++++ .../evel_javalib2/src/test/java/TestJunit.java | 75 +- 25 files changed, 6614 insertions(+), 643 deletions(-) create mode 100644 veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelNotification.java create mode 100644 veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelPnfRegistration.java create mode 100644 veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/Main.java create mode 100644 veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/MeasureData.java create mode 100644 veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/faultData.java create mode 100644 veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/fw_common_config.txt create mode 100644 veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/fw_config.txt create mode 100644 veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/fw_flt_config.txt create mode 100644 veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/fw_hb_config.txt create mode 100644 veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/fw_interface_config.txt create mode 100644 veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/fw_meas_config.txt create mode 100644 veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/heartBeatData.java create mode 100644 veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/maindir/Main.java (limited to 'veslibrary/ves_javalibrary') diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelFault.java b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelFault.java index 9f7e3d3..d7c91b3 100644 --- a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelFault.java +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelFault.java @@ -25,6 +25,10 @@ package evel_javalibrary.att.com; import java.text.MessageFormat; import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; import javax.json.Json; import javax.json.JsonArrayBuilder; @@ -74,9 +78,7 @@ public class EvelFault extends EvelHeader { /* Vendor-specific values should be added here, and handled appropriately */ /* in evel_event.c. */ /***************************************************************************/ - EVEL_SOURCE_OLT, - EVEL_SOURCE_ONT, - EVEL_SOURCE_ONU, + /***************************************************************************/ /* END OF VENDOR-SPECIFIC VALUES */ /***************************************************************************/ @@ -111,8 +113,10 @@ public class EvelFault extends EvelHeader { /***************************************************************************/ EvelOptionString category; EvelOptionString alarm_interface_a; - ArrayList additional_info; + // ArrayList additional_info; + HashMap additional_inf; + private static final Logger LOGGER = Logger.getLogger( EvelFault.class.getName() ); /**************************************************************************//** @@ -155,7 +159,11 @@ public class EvelFault extends EvelHeader { //Init optional fields category = new EvelOptionString(false, null); alarm_interface_a = new EvelOptionString(false, null); - additional_info = null; + + + additional_inf = null; + + if( severity.equals(EVEL_SEVERITIES.EVEL_SEVERITY_NORMAL)) sequence = 0; else @@ -179,7 +187,7 @@ public class EvelFault extends EvelHeader { *****************************************************************************/ public void evel_fault_addl_info_add(String name, String value) { - String[] addl_info = null; + // String[] addl_info = null; EVEL_ENTER(); /***************************************************************************/ @@ -189,18 +197,19 @@ public class EvelFault extends EvelHeader { assert(name != null); assert(value != null); - if( additional_info == null ) + if( additional_inf == null ) { - additional_info = new ArrayList(); + // additional_info = new ArrayList(); + additional_inf = new HashMap<>(); } LOGGER.debug(MessageFormat.format("Adding name={0} value={1}", name, value)); - addl_info = new String[2]; - assert(addl_info != null); - addl_info[0] = name; - addl_info[1] = value; - - additional_info.add(addl_info); + // addl_info = new String[2]; + // assert(addl_info != null); + // addl_info[0] = name; + // addl_info[1] = value; + additional_inf.put(name, value); + // additional_info.add(addl_info); EVEL_EXIT(); } @@ -294,7 +303,7 @@ public class EvelFault extends EvelHeader { * @param source_type The source type to convert. * @returns The equivalent string. *****************************************************************************/ - static String evel_source_type(EVEL_SOURCE_TYPES source_type) + String evel_source_type(EVEL_SOURCE_TYPES source_type) { String result; @@ -342,18 +351,6 @@ public class EvelFault extends EvelHeader { result = "virtualNetworkFunction"; break; - case EVEL_SOURCE_OLT: - result = "OLT"; - break; - - case EVEL_SOURCE_ONT: - result = "ONT"; - break; - - case EVEL_SOURCE_ONU: - result = "ONU"; - break; - default: result = null; LOGGER.error(MessageFormatter.format("Unexpected Event Source Type {0}", source_type)); @@ -465,8 +462,8 @@ public class EvelFault extends EvelHeader { String fault_severity; String fault_source_type; String fault_vf_status; - double version = major_version+(double)minor_version/10; - + // double version = major_version+(double)minor_version/10; + String version = "4.0"; EVEL_ENTER(); assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_FAULT); @@ -486,15 +483,18 @@ public class EvelFault extends EvelHeader { /* Optional fields. */ /***************************************************************************/ - if( category.is_set ) - evelfault.add("eventCategory", category.GetValue()); - if( alarm_interface_a.is_set ) - evelfault.add("eventCategory", alarm_interface_a.GetValue()); + // if( category.is_set ) + // evelfault.add("eventCategory", category.GetValue()); + // if( alarm_interface_a.is_set ) + // evelfault.add("eventCategory", alarm_interface_a.GetValue()); /***************************************************************************/ /* Mandatory fields. */ /***************************************************************************/ + evelfault.add("eventCategory", category.GetValue()); + evelfault.add("alarmInterfaceA", alarm_interface_a.GetValue()); + evelfault.add( "eventSeverity", fault_severity); evelfault.add( "eventSourceType", fault_source_type); evelfault.add( "specificProblem", specific_problem); @@ -504,7 +504,7 @@ public class EvelFault extends EvelHeader { /***************************************************************************/ /* Encode additional Name value pairs if any. */ /***************************************************************************/ - if( additional_info != null ) + /*if( additional_info != null ) { JsonArrayBuilder builder = Json.createArrayBuilder(); for(int i=0;i> it = additional_inf.entrySet().iterator(); + while(it.hasNext()) { + Map.Entry add_inf = (Map.Entry)it.next(); + String addl_info_key = add_inf.getKey(); + String addl_info_value = add_inf.getValue(); + JsonObject obj1 = Json.createObjectBuilder() + .add("name", addl_info_key) + .add("value", addl_info_value).build(); + builder.add(addl_info_key, addl_info_value); + } + evelfault.add("alarmAdditionalInformation", builder); + } + + EVEL_EXIT(); return evelfault; diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelHeader.java b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelHeader.java index 918b5d4..2686824 100644 --- a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelHeader.java +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelHeader.java @@ -44,6 +44,7 @@ import org.slf4j.helpers.MessageFormatter; public class EvelHeader { + /**************************************************************************//** * Event domains for the various events we support. * JSON equivalent field: domain @@ -62,7 +63,10 @@ public class EvelHeader { EVEL_DOMAIN_THRESHOLD_CROSSING, /** A Threshold crossing alert Event */ EVEL_DOMAIN_VOICE_QUALITY, /** A Voice Quality Event */ EVEL_DOMAIN_HEARTBEAT_FIELD,/** A Heartbeat field event. */ - EVEL_MAX_DOMAINS /** Maximum number of recognized Event types. */ + EVEL_DOMAIN_NOTIFICATION, + EVEL_DOMAIN_PNFREGISTRATION, + EVEL_MAX_DOMAINS /** Maximum number of recognized Event types. */ + } /**************************************************************************//** @@ -77,7 +81,7 @@ public class EvelHeader { EVEL_MAX_PRIORITIES } - final int EVEL_HEADER_MAJOR_VERSION = 3; + final int EVEL_HEADER_MAJOR_VERSION = 4; final int EVEL_HEADER_MINOR_VERSION = 0; /***************************************************************************/ /* Version */ @@ -97,6 +101,9 @@ public class EvelHeader { Long start_epoch_microsec = 0L; Long last_epoch_microsec = 0L; int sequence = 0; + + //VES 7.0 added 4Sept2108 + String ves_eventListener_version =null; /***************************************************************************/ /* Optional fields */ @@ -108,6 +115,12 @@ public class EvelHeader { EvelOptionString nfcnaming_code; EvelOptionString nfnaming_code; + + //VES 7.0 added 4Sept2108 + EvelOptionString nfVendor_name; + EvelOptionString timeZoneOffset; + + /**************************************************************************//** * Unique sequence number for events from this VNF. *****************************************************************************/ @@ -173,13 +186,15 @@ public class EvelHeader { LOGGER.warning("WARNING:not confirming to Common Event Format 28.3 standard"); } else { event_id = ev_id; - sequence = 0; + sequence = 1000; } event_name = eventname; start_epoch_microsec = last_epoch_microsec; last_epoch_microsec = System.nanoTime()/1000; priority = PRIORITIES.EVEL_PRIORITY_NORMAL; + + String hostname = "Unknown"; String uuid = "Unknown"; @@ -238,6 +253,9 @@ public class EvelHeader { major_version = EVEL_HEADER_MAJOR_VERSION; minor_version = EVEL_HEADER_MINOR_VERSION; + + //VES 7.0 added 4Sept 2018 + ves_eventListener_version = "7.0.2"; /***************************************************************************/ /* Optional parameters. */ @@ -248,7 +266,10 @@ public class EvelHeader { reporting_entity_id = new EvelOptionString(true, uuid); source_id = new EvelOptionString(true, uuid); internal_field = new EvelOptionIntHeader(false, null); - + + //VES 7.0 added 4Sept2018 + nfVendor_name = new EvelOptionString(false, null); + timeZoneOffset = new EvelOptionString(false, null); EVEL_EXIT(); } @@ -397,8 +418,8 @@ public class EvelHeader { nfcnaming_code.SetValue(nfcnam); EVEL_EXIT(); - } - + } + /**************************************************************************//** * Set the NF Naming code property of the event header. * @@ -418,8 +439,79 @@ public class EvelHeader { EVEL_EXIT(); } + + //VES 7.0 added 4Sept2018 + /**************************************************************************//** + * Set the NF Vendor name property of the event header. + * + * @param header Pointer to the ::EVENT_HEADER. + * @param nfVendorName String + *****************************************************************************/ + public void evel_nfVendorName_set(String nfvendor) + { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions and assign the new value. */ + /***************************************************************************/ + assert(nfvendor != null); + nfVendor_name.set_option(true); + nfVendor_name.SetValue(nfvendor); + + EVEL_EXIT(); + } + + + /**************************************************************************//** + * Set the NF Vendor name property of the event header. + * + * @param header Pointer to the ::EVENT_HEADER. + * @param nfVendorName String + *****************************************************************************/ + public void evel_timeZoneOffset_set(String timezoneset) + { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions and assign the new value. */ + /***************************************************************************/ + assert(timezoneset != null); + timeZoneOffset.set_option(true); + timeZoneOffset.SetValue(timezoneset); + + EVEL_EXIT(); + } + + + + /**************************************************************************//** + * Set the Ves Event Listener Version property of the event header. + * + * @note The Ves Event Listener Version defaults to the OpenStack VM Name. + * + * @param header Pointer to the ::EVENT_HEADER. + * @param vesEventListenerVersion The vesEventListenerVersion to set. + *****************************************************************************/ + public void evel_vesEventListenerVersion_set(String vesEventListVersion) + { + EVEL_ENTER(); + /***************************************************************************/ + /* Check preconditions and assign the new value. */ + /***************************************************************************/ + assert(vesEventListVersion != null); + /***************************************************************************/ + /* Free the previously allocated memory and replace it with a copy of the */ + /* provided one. */ + /***************************************************************************/ + ves_eventListener_version = vesEventListVersion; + + EVEL_EXIT(); + } + + + /**************************************************************************//** * Set the Reporting Entity Name property of the event header. * @@ -555,7 +647,7 @@ public class EvelHeader { break; case EVEL_DOMAIN_MEASUREMENT: - result = "measurementsForVfScaling"; + result = "measurement"; break; case EVEL_DOMAIN_REPORT: @@ -593,7 +685,14 @@ public class EvelHeader { case EVEL_DOMAIN_THRESHOLD_CROSSING: result = "thresholdCrossingAlert"; break; - + case EVEL_DOMAIN_NOTIFICATION: + result="notification"; + break; + + case EVEL_DOMAIN_PNFREGISTRATION: + result="pnfRegistration"; + break; + default: result = null; LOGGER.severe(MessageFormat.format("Unexpected domain {0}", domain)); @@ -654,8 +753,8 @@ public class EvelHeader { { String domain = evel_event_domain(event_domain); String prity = evel_event_priority(priority); - double version = major_version+(double)minor_version/10; - + // double version = major_version+(double)minor_version/10; + String version = "4.0.2"; EVEL_ENTER(); /***************************************************************************/ @@ -663,6 +762,7 @@ public class EvelHeader { /***************************************************************************/ JsonObjectBuilder commheader = Json.createObjectBuilder() + .add("vesEventListenerVersion", ves_eventListener_version) .add("domain", domain) .add("eventId", event_id) .add("eventName", event_name) @@ -695,6 +795,13 @@ public class EvelHeader { if( nfnaming_code.is_set ) commheader.add("nfNamingCode", nfnaming_code.GetValue()); + //VES 7.0 added 4Sept2018 + if( nfVendor_name.is_set ) + commheader.add("nfNamingCode", nfVendor_name.GetValue()); + if( timeZoneOffset.is_set ) + commheader.add("timeZoneOffset", timeZoneOffset.GetValue()); + + EVEL_EXIT(); return commheader; @@ -706,19 +813,32 @@ public class EvelHeader { * Encode the event as a JSON event object according to AT&T's schema. * retval : String of JSON event header only message *****************************************************************************/ - JsonObject evel_json_encode_event() + JsonObject evel_json_encode_event() { JsonObject obj = Json.createObjectBuilder() - .add("event", Json.createObjectBuilder() - .add( "commonEventHeader",eventHeaderObject() ) - ).build(); + + .add("event", Json.createObjectBuilder()) + .add( "commonEventHeader",eventHeaderObject() ).build(); EVEL_EXIT(); return obj; - } + } + + JsonObject evel_json_encode_eventNew() + { + + JsonObject obj = Json.createObjectBuilder() + + .add( "commonEventHeader",eventHeaderObject() ).build(); + + EVEL_EXIT(); + + return obj; + + } diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelHeartbeatField.java b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelHeartbeatField.java index f07557d..0a6203f 100644 --- a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelHeartbeatField.java +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelHeartbeatField.java @@ -24,6 +24,10 @@ package evel_javalibrary.att.com; import java.text.MessageFormat; import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; import javax.json.Json; import javax.json.JsonArrayBuilder; @@ -53,7 +57,9 @@ public class EvelHeartbeatField extends EvelHeader { /***************************************************************************/ /* Optional fields */ /***************************************************************************/ - ArrayList additional_info; + // ArrayList additional_info; + + HashMap additional_inf; private static final Logger LOGGER = Logger.getLogger( EvelHeartbeatField.class.getName() ); @@ -70,8 +76,9 @@ public class EvelHeartbeatField extends EvelHeader { assert( interval > 0 ); heartbeat_interval = interval; + - additional_info = null; + additional_inf = null; } /**************************************************************************//** @@ -90,7 +97,7 @@ public class EvelHeartbeatField extends EvelHeader { *****************************************************************************/ public void evel_hrtbt_field_addl_info_add(String name, String value) { - String[] addl_info = null; + // String[] addl_info = null; EVEL_ENTER(); /***************************************************************************/ @@ -100,18 +107,22 @@ public class EvelHeartbeatField extends EvelHeader { assert(name != null); assert(value != null); - if( additional_info == null ) + if( additional_inf == null ) { - additional_info = new ArrayList(); + // additional_info = new ArrayList(); + + additional_inf = new HashMap<>(); } LOGGER.debug(MessageFormat.format("Adding name={0} value={1}", name, value)); - addl_info = new String[2]; - assert(addl_info != null); - addl_info[0] = name; - addl_info[1] = value; + // addl_info = new String[2]; + // assert(addl_info != null); + // addl_info[0] = name; + // addl_info[1] = value; + + additional_inf.put(name, value); - additional_info.add(addl_info); + // additional_info.add(addl_info); EVEL_EXIT(); } @@ -147,8 +158,8 @@ public class EvelHeartbeatField extends EvelHeader { *****************************************************************************/ JsonObjectBuilder evelHeartbeatFieldObject() { - double version = major_version+(double)minor_version/10; - + // double version = major_version+(double)minor_version/10; + String version = "3.0"; EVEL_ENTER(); @@ -161,15 +172,15 @@ public class EvelHeartbeatField extends EvelHeader { /* Mandatory fields. */ /***************************************************************************/ - JsonObjectBuilder evelstate = Json.createObjectBuilder() + JsonObjectBuilder evelHeatbeat = Json.createObjectBuilder() .add("heartbeatInterval", heartbeat_interval); - evelstate.add( "heartbeatFieldsVersion", version); + evelHeatbeat.add( "heartbeatFieldsVersion", version); /***************************************************************************/ /* Checkpoint, so that we can wind back if all fields are suppressed. */ /***************************************************************************/ - if( additional_info != null ) + /* if( additional_info != null ) { JsonArrayBuilder builder = Json.createArrayBuilder(); for(int i=0;i> it = additional_inf.entrySet().iterator(); + while(it.hasNext()) { + Map.Entry add_inf = (Map.Entry)it.next(); + String addl_info_key = add_inf.getKey(); + String addl_info_value = add_inf.getValue(); + JsonObject obj1 = Json.createObjectBuilder() + .add("name", addl_info_key) + .add("value", addl_info_value).build(); + builder.add(obj1); + } + evelHeatbeat.add("alarmAdditionalInformation", builder); + } + EVEL_EXIT(); - return evelstate; + return evelHeatbeat; } @@ -199,9 +226,10 @@ public class EvelHeartbeatField extends EvelHeader { assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_HEARTBEAT_FIELD); //encode common event header and body JsonObject obj = Json.createObjectBuilder() - .add("event", Json.createObjectBuilder() - .add( "commonEventHeader",eventHeaderObject() ) - .add( "heartbeatFields",evelHeartbeatFieldObject() ) + + .add("event", Json.createObjectBuilder() + .add( "commonEventHeader",eventHeaderObject()) + .add( "heartbeatFields",evelHeartbeatFieldObject()) ).build(); EVEL_EXIT(); diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelMobileFlow.java b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelMobileFlow.java index 7a01dae..e6b7fd2 100644 --- a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelMobileFlow.java +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelMobileFlow.java @@ -26,6 +26,7 @@ import java.text.MessageFormat; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; +import java.util.Map; import javax.json.Json; import javax.json.JsonArrayBuilder; @@ -148,11 +149,9 @@ public class EvelMobileFlow extends EvelHeader { double avg_packet_delay_variation; int avg_packet_latency; int avg_receive_throughput; - int avg_transmit_throughput; - + int avg_transmit_throughput; int flow_activation_epoch; - int flow_activation_microsec; - + int flow_activation_microsec; int flow_deactivation_epoch; int flow_deactivation_microsec; Date flow_deactivation_time; @@ -200,6 +199,9 @@ public class EvelMobileFlow extends EvelHeader { EvelOptionInt num_gtp_echo_failures; EvelOptionInt num_gtp_tunnel_errors; EvelOptionInt num_http_errors; + + Map iptos_count_list; + /**************************************************************************//** * Create a new Mobile GTP Per Flow Metrics. @@ -394,6 +396,10 @@ public class EvelMobileFlow extends EvelHeader { num_gtp_echo_failures = new EvelOptionInt(); num_gtp_tunnel_errors = new EvelOptionInt(); num_http_errors = new EvelOptionInt(); + + + + iptos_count_list = null; EVEL_EXIT(); } @@ -414,7 +420,11 @@ public class EvelMobileFlow extends EvelHeader { /***************************************************************************/ /* Optional fields */ /***************************************************************************/ - ArrayList additional_info; + //ArrayList ipTosList; + Map additional_inf; + + Map hashMap; + EvelOptionString application_type; EvelOptionString app_protocol_type; EvelOptionString app_protocol_version; @@ -538,8 +548,9 @@ public class EvelMobileFlow extends EvelHeader { tac = new EvelOptionString(); tunnel_id = new EvelOptionString(); vlan_id = new EvelOptionString(); - additional_info = null; - + additional_inf = null; + hashMap = null; + EVEL_EXIT(); } @@ -562,7 +573,7 @@ public class EvelMobileFlow extends EvelHeader { *****************************************************************************/ public void evel_mobile_flow_addl_field_add(String name, String value) { - String[] addl_info = null; + // String[] addl_info = null; EVEL_ENTER(); /***************************************************************************/ @@ -572,18 +583,18 @@ public class EvelMobileFlow extends EvelHeader { assert(name != null); assert(value != null); - if( additional_info == null ) + if( additional_inf == null ) { - additional_info = new ArrayList(); + additional_inf = new HashMap(); } LOGGER.debug(MessageFormat.format("Adding name={0} value={1}", name, value)); - addl_info = new String[2]; - assert(addl_info != null); - addl_info[0] = name; - addl_info[1] = value; + // addl_info = new String[2]; + // assert(addl_info != null); + // addl_info[0] = name; + // addl_info[1] = value; - additional_info.add(addl_info); + additional_inf.put(name, value); EVEL_EXIT(); } @@ -1750,7 +1761,34 @@ public class EvelMobileFlow extends EvelHeader { "QCI COS"); EVEL_EXIT(); } + + + public void evel_mobileFlow_hashMap_add(String name, String value) + { + + EVEL_ENTER(); + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_THRESHOLD_CROSSING); + assert(name != null); + assert(value != null); + + if( hashMap == null ) + { + + hashMap = new HashMap(); + } + + LOGGER.debug(MessageFormat.format("Adding name={0} value={1}", name, value)); + hashMap.put(name, value); + + + EVEL_EXIT(); + } + + /**************************************************************************//** * Encode the GTP Per Flow Object in JSON according to AT&T's schema. @@ -1825,20 +1863,28 @@ public class EvelMobileFlow extends EvelHeader { if (found_ip_tos) { - JsonArrayBuilder builder = Json.createArrayBuilder(); + JsonObjectBuilder builder = Json.createObjectBuilder(); + // JsonArrayBuilder builder = Json.createArrayBuilder(); + JsonArrayBuilder builderIpTosList = Json.createArrayBuilder(); for (index = 0; index < EVEL_TOS_SUPPORTED; index++) { if (metrics.ip_tos_counts[index].is_set) { - JsonObjectBuilder obj2 = Json.createObjectBuilder() - .add(Integer.toString(index), metrics.ip_tos_counts[index].value); - builder.add(obj2); +// JsonObjectBuilder obj2 = Json.createObjectBuilder() +// .add(Integer.toString(index), metrics.ip_tos_counts[index].value); + builder.add(Integer.toString(index)+"", metrics.ip_tos_counts[index].value+""); + //srikant add String to IpTosList + builderIpTosList.add( index+"" ); } } obj.add("ipTosCountList", builder); + obj.add("ipTosList", builderIpTosList); + + } - + + /***************************************************************************/ /* Make some compile-time assertions about EVEL_TCP_FLAGS. If you update */ /* these, make sure you update evel_tcp_flag_strings to match the enum. */ @@ -1853,7 +1899,9 @@ public class EvelMobileFlow extends EvelHeader { break; } } - + + + JsonArrayBuilder builderTcpFlagList = Json.createArrayBuilder(); if (found_tcp_flag) { JsonArrayBuilder builder = Json.createArrayBuilder(); @@ -1862,26 +1910,29 @@ public class EvelMobileFlow extends EvelHeader { if (metrics.tcp_flag_counts[index].is_set) { JsonObjectBuilder obj2 = Json.createObjectBuilder() - .add(Integer.toString(index), evel_tcp_flag_strings[index]); + .add(Integer.toString(index)+"", evel_tcp_flag_strings[index]+""); builder.add(obj2); } } - obj.add("tcpFlagList", builder); + // obj.add("tcpFlagList", builder); } if (found_tcp_flag) { - JsonArrayBuilder builder = Json.createArrayBuilder(); + JsonObjectBuilder builder = Json.createObjectBuilder(); + // JsonArrayBuilder builder = Json.createArrayBuilder(); for (index = 0; index < EVEL_MAX_TCP_FLAGS; index++) { if (metrics.tcp_flag_counts[index].is_set) { - JsonObjectBuilder obj2 = Json.createObjectBuilder() - .add(evel_tcp_flag_strings[index], metrics.tcp_flag_counts[index].value); - builder.add(obj2); +// JsonObjectBuilder obj2 = Json.createObjectBuilder() +// .add(evel_tcp_flag_strings[index], metrics.tcp_flag_counts[index].value); + builder.add(evel_tcp_flag_strings[index]+"", metrics.tcp_flag_counts[index].value+""); + builderTcpFlagList.add(evel_tcp_flag_strings[index]+""); } } obj.add("tcpFlagCountList", builder); + obj.add("tcpFlagList", builderTcpFlagList); } /***************************************************************************/ @@ -1900,35 +1951,48 @@ public class EvelMobileFlow extends EvelHeader { } } + JsonArrayBuilder builderQciCosList = Json.createArrayBuilder(); if (found_qci_cos) { - JsonArrayBuilder builder = Json.createArrayBuilder(); + // JsonArrayBuilder builder = Json.createArrayBuilder(); + JsonObjectBuilder builder = Json.createObjectBuilder(); for (index = 0; index < EVEL_MAX_QCI_COS_TYPES; index++) { if (metrics.qci_cos_counts[index].is_set) { - JsonObjectBuilder obj2 = Json.createObjectBuilder() - .add(Integer.toString(index), evel_qci_cos_strings[index]); - builder.add(obj2); +// JsonObjectBuilder obj2 = Json.createObjectBuilder() +// .add(Integer.toString(index), evel_qci_cos_strings[index]); + builder.add(Integer.toString(index)+"", evel_qci_cos_strings[index]+""); + } } - obj.add("mobileQciCosList", builder); + // obj.add("mobileQciCosList", builder); } + + + if (found_qci_cos) { - JsonArrayBuilder builder = Json.createArrayBuilder(); + //JsonArrayBuilder builder = Json.createArrayBuilder(); + JsonObjectBuilder builder = Json.createObjectBuilder(); for (index = 0; index < EVEL_MAX_QCI_COS_TYPES; index++) { if (metrics.qci_cos_counts[index].is_set) { - JsonObjectBuilder obj2 = Json.createObjectBuilder() - .add(evel_qci_cos_strings[index], metrics.qci_cos_counts[index].value); - builder.add(obj2); +// JsonObjectBuilder obj2 = Json.createObjectBuilder() +// .add(evel_qci_cos_strings[index], metrics.qci_cos_counts[index].value); + builder.add(evel_qci_cos_strings[index]+"", metrics.qci_cos_counts[index].value+""); + builderQciCosList.add(evel_qci_cos_strings[index]+""); } } obj.add("mobileQciCosCountList", builder); + obj.add("mobileQciCosList", builderQciCosList); } + + + + metrics.dur_connection_failed_status.encJsonValue(obj, "durConnectionFailedStatus"); metrics.dur_tunnel_failed_status.encJsonValue(obj, "durTunnelFailedStatus"); @@ -1945,7 +2009,13 @@ public class EvelMobileFlow extends EvelHeader { metrics.num_gtp_tunnel_errors.encJsonValue(obj, "numGtpTunnelErrors"); metrics.num_http_errors.encJsonValue(obj, "numHttpErrors"); - return obj; + + + + + return obj; + + } @@ -1958,8 +2028,8 @@ public class EvelMobileFlow extends EvelHeader { JsonObjectBuilder evelMobileFlowObject() { - double version = major_version+(double)minor_version/10; - + // double version = major_version+(double)minor_version/10; + String version = "4.0"; EVEL_ENTER(); /***************************************************************************/ @@ -1982,25 +2052,29 @@ public class EvelMobileFlow extends EvelHeader { //call gtp per flow object encoding function if(gtp_per_flow_metrics != null) evelmf.add("gtpPerFlowMetrics", evelGtpPerFlowObject()); - + - /***************************************************************************/ - /* Optional fields. */ - /***************************************************************************/ - // additional fields - if( additional_info != null ) - { - JsonArrayBuilder builder = Json.createArrayBuilder(); - for(int i=0;i entry : additional_inf.entrySet()){ + LOGGER.debug(MessageFormat.format("Key : {0} and Value: {1}", entry.getKey(), entry.getValue())); +// JsonObject obj = Json.createObjectBuilder() +// .add("name", entry.getKey()) +// .add("value",entry.getValue()).build(); + builder.add(entry.getKey(), entry.getValue()); + } + //eveloth.add("nameValuePairs", builder); + evelmf.add("additionalFields", builder); + } /***************************************************************************/ diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelNotification.java b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelNotification.java new file mode 100644 index 0000000..3c2150c --- /dev/null +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelNotification.java @@ -0,0 +1,511 @@ +package evel_javalibrary.att.com; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.charset.Charset; +import java.nio.file.Files; + +/**************************************************************************//** + * @file + * Evel Fault Event class extends EvelHeader class + * + * This file implements the Evel Fault Event class which is intended to provide a + * simple wrapper around the complexity of AT&T's Vendor Event Listener API so + * that VNFs can use it to send Fault events. + * + * License + * ------- + * Unless otherwise specified, all software contained herein is + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *****************************************************************************/ + + + +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import javax.json.Json; +import javax.json.JsonArrayBuilder; +import javax.json.JsonObject; +import javax.json.JsonObjectBuilder; + +import org.apache.log4j.Logger; + +public class EvelNotification extends EvelHeader { + int major_version = 1; + int minor_version = 0; + + /***************************************************************************/ + /* Mandatory fields */ + /***************************************************************************/ + String changeType = null; + String changeIdentifier; + //ArrayList additional_info; + HashMap additional_inf; + + + /***************************************************************************/ + /* Optional fields */ + /***************************************************************************/ + + EvelOptionString newState; + EvelOptionString oldState; + EvelOptionString changeContact; + EvelOptionString stateInterface; + + + ArrayList additional_objects; + Map> evelmap; + + private static final Logger LOGGER = Logger.getLogger( EvelNotification.class.getName() ); + + public EvelNotification(String eventname, String ev_id, String change_identifier, String change_type) { + super(eventname, ev_id); + // TODO Auto-generated constructor stub + event_domain = EvelHeader.DOMAINS.EVEL_DOMAIN_NOTIFICATION; + changeType = change_type; + newState = new EvelOptionString(); + oldState = new EvelOptionString(); + changeContact = new EvelOptionString(); + stateInterface = new EvelOptionString(); + changeIdentifier = change_identifier; + + + //additional_info=null; + additional_inf =null; + + additional_objects = null; + evelmap = null; + } + + /**************************************************************************//** + * Set the Event Type property of the Notification. + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + + * @param type The Event Type to be set. ASCIIZ string. The caller + * does not need to preserve the value once the function + * returns. + *****************************************************************************/ + public void evel_notification_type_set(String typ) + { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions and call evel_header_type_set. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_NOTIFICATION); + evel_header_type_set(typ); + + EVEL_EXIT(); + } + + +// public void evel_notification_addl_info_add(String name, String value) +// { +// String[] addl_info = null; +// EVEL_ENTER(); +// +// /***************************************************************************/ +// /* Check preconditions. */ +// /***************************************************************************/ +// assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_NOTIFICATION); +// assert(name != null); +// assert(value != null); +// +// if( additional_info == null ) +// { +// additional_info = new ArrayList(); +// additional_inf = new HashMap<>(); +// } +// +// LOGGER.debug(MessageFormat.format("Adding name={0} value={1}", name, value)); +// addl_info = new String[2]; +// assert(addl_info != null); +// addl_info[0] = name; +// addl_info[1] = value; +// additional_inf.put(name, value); +// +// additional_info.add(addl_info); +// +// EVEL_EXIT(); +// } + + + /**************************************************************************//** + * Adds name value pair under hash key + * + * + * @param hashname String Hash name. + * @param name String Name. + * @param value String Value. + *****************************************************************************/ + public void evel_notification_add_namedarray(String hashname,String name, String value) + { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_OTHER); + assert(hashname != null); + assert(name != null); + assert(value != null); + + Map mymap = null; + + try{ + + if( evelmap == null) + evelmap = new HashMap>(); + + if( evelmap.containsKey(hashname) ) + { + mymap = evelmap.get(hashname); + } + else + { + mymap = new HashMap(); + evelmap.put(hashname, mymap); + LOGGER.debug("Inserted map hash : "+hashname+" name="+name); + } + + if( mymap.containsKey(name) ) + { + String val = mymap.get(name); + LOGGER.error("Error already contains key " + name + "val "+val ); + } + else + { + mymap.put(name, value); + LOGGER.debug("Adding hash : "+hashname+" name="+name+"value= "+value); + } + + } catch( Exception e) + { + e.printStackTrace(); + } + + EVEL_EXIT(); + } + + + + /**************************************************************************//** + * Add a json object to optional jsonObject list. + * + * @param jsonobj Pointer to json object + *****************************************************************************/ + public void evel_other_field_add_jsonobj(javax.json.JsonObject jsonobj) + { + + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_OTHER); + assert(jsonobj != null); + + LOGGER.debug("Adding jsonObject"); + + if( additional_objects == null ) + additional_objects = new ArrayList(); + + additional_objects.add(jsonobj); + + EVEL_EXIT(); + } + + + + + + public void evel_notification_addl_info_add(String name, String value) + { + //String[] addl_info = null; + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_NOTIFICATION); + assert(name != null); + assert(value != null); + + if( additional_inf == null ) + { + // additional_info = new ArrayList(); + additional_inf = new HashMap<>(); + } + + LOGGER.debug(MessageFormat.format("Adding name={0} value={1}", name, value)); + //addl_info = new String[2]; + //assert(addl_inf != null); + //addl_info[0] = name; + //addl_info[1] = value; + additional_inf.put(name, value); + + // additional_info.add(addl_info); + + EVEL_EXIT(); + } + + + +// public void evel_notification_add_changeType_set(String changeTyp) { +// EVEL_ENTER(); +// +// /***************************************************************************/ +// /* Check preconditions. */ +// /***************************************************************************/ +// assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_NOTIFICATION); +// assert(changeTyp != null); +// +// changeType.SetValuePr( +// changeTyp, +// "notification ChangeType String"); +// +// EVEL_EXIT(); +// } + public void evel_notification_add_newState_set(String newStat ){ + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_NOTIFICATION); + assert(newStat != null); + + newState.SetValuePr( + newStat, + "notification newState String"); + + EVEL_EXIT(); + } + public void evel_notification_add_oldState_set(String oldStat) { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_NOTIFICATION); + assert(oldStat != null); + + oldState.SetValuePr( + oldStat, + "notification OldState String"); + + EVEL_EXIT(); + } + public void evel_notification_add_changeContact_set(String changeCont) { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_NOTIFICATION); + assert(changeCont != null); + + changeContact.SetValuePr( + changeCont, + "notification ChangeContact String"); + + EVEL_EXIT(); + } + public void evel_notification_add_stateInterface_set(String statInter) { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_NOTIFICATION); + assert(statInter != null); + + stateInterface.SetValuePr( + statInter, + "notification StateInterface String"); + + EVEL_EXIT(); + } +// public void evel_notification_add_changeIdentifier_set(double changeId) { +// EVEL_ENTER(); +// +// /***************************************************************************/ +// /* Check preconditions. */ +// /***************************************************************************/ +// assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_NOTIFICATION); +// assert(changeId > 0.0); +// +// changeIdentifier.SetValuePr( +// changeId, +// "notification ChangeIdentifier Integer"); +// +// EVEL_EXIT(); +// } +// public void evel_notification_add_notificationsFieldVersion_set(int stateChangeFieldsVer) { +// EVEL_ENTER(); +// +// /***************************************************************************/ +// /* Check preconditions. */ +// /***************************************************************************/ +// assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_NOTIFICATION); +// assert(stateChangeFieldsVer > 0); +// +// notificationsFieldVersion.SetValuePr( +// stateChangeFieldsVer, +// "notification notificationsFieldVersion Int"); +// +// EVEL_EXIT(); +// } +// + /**************************************************************************//** + * Encode the Syslog in JSON according to AT&T's schema. + * + *****************************************************************************/ + JsonObjectBuilder evelNotificationObject() + { + //String evt_source_type; + //double version = major_version+(double)minor_version/10; + String version = "2.0"; + EVEL_ENTER(); + + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_NOTIFICATION); + + /***************************************************************************/ + /* Mandatory fields */ + /***************************************************************************/ + JsonObjectBuilder obj = Json.createObjectBuilder() + .add("changeIdentifier", changeIdentifier) + .add("changeType", changeType) + .add("notificationFieldsVersion",version); + + + + /***************************************************************************/ + /* Optional fields */ + /***************************************************************************/ + newState.encJsonValue(obj, "newState"); + oldState.encJsonValue(obj,"oldState"); + changeContact.encJsonValue(obj,"changeContact"); + stateInterface.encJsonValue(obj, "syslogProc"); + // additional fields +// if( additional_info != null ) +// { +// JsonArrayBuilder builder = Json.createArrayBuilder(); +// for(int i=0;i> it = additional_inf.entrySet().iterator(); + while(it.hasNext()) { + Map.Entry add_inf = (Map.Entry)it.next(); + String addl_info_key = add_inf.getKey(); + String addl_info_value = add_inf.getValue(); +// JsonObject obj1 = Json.createObjectBuilder() +// .add("name", addl_info_key) +// .add("value", addl_info_value).build(); + builder.add(addl_info_key, addl_info_value); + } + obj.add("additionalFields", builder); + } + + if( additional_objects != null && additional_objects.size() > 0 ) + { + JsonArrayBuilder builder = Json.createArrayBuilder(); + for(int i=0;i 0) + { + JsonArrayBuilder builder = Json.createArrayBuilder(); + for(Map.Entry> entry : evelmap.entrySet()){ + LOGGER.debug(MessageFormat.format("Key : {0} and Value: {1}", entry.getKey(), entry.getValue())); + Map item = entry.getValue(); + + JsonObjectBuilder obj1 = Json.createObjectBuilder() + .add( "name", entry.getKey()); + // JsonArrayBuilder builder2 = Json.createArrayBuilder(); + JsonObjectBuilder builder2 = Json.createObjectBuilder(); + for(Map.Entry entry2 : item.entrySet()){ + LOGGER.debug(MessageFormat.format("Key : {0} and Value: {1}", entry2.getKey(), entry2.getValue())); +// JsonObjectBuilder obj2 = Json.createObjectBuilder() +// .add("name", entry2.getKey()) +// .add("value",entry2.getValue()); + builder2.add(entry2.getKey(), entry2.getValue()); + } + + obj1.add("hashMap", builder2); + builder.add(obj1.build()); + } + obj.add("arrayOfNamedHashMap", builder); + } + + + + + + + + + EVEL_EXIT(); + + return obj; + } + + + JsonObject evel_json_encode_event() + { + EVEL_ENTER(); + + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_NOTIFICATION); + + JsonObject obj = Json.createObjectBuilder() + .add("event", Json.createObjectBuilder() + .add( "commonEventHeader",eventHeaderObject() ) + .add( "notificationFields", evelNotificationObject() ) + ).build(); + + EVEL_EXIT(); + + return obj; + + } + +} diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelOther.java b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelOther.java index 31385ed..1f97625 100644 --- a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelOther.java +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelOther.java @@ -51,6 +51,9 @@ public class EvelOther extends EvelHeader { /* Optional fields */ /***************************************************************************/ Map additional_info; + + + Map> evelmap; @@ -228,7 +231,7 @@ public class EvelOther extends EvelHeader { LOGGER.debug("Adding name="+name+" value="+value); if(additional_info == null) - additional_info = new HashMap(); + additional_info = new HashMap(); if(additional_info.containsKey(name)) LOGGER.error("Already exists Unable to add map : name="+name+"value= "+value); @@ -247,8 +250,8 @@ public class EvelOther extends EvelHeader { JsonObjectBuilder evelOtherObject() { - double version = major_version+(double)minor_version/10; - + //double version = major_version+(double)minor_version/10; + String version = "3.0"; EVEL_ENTER(); /***************************************************************************/ @@ -272,15 +275,17 @@ public class EvelOther extends EvelHeader { // additional fields if( additional_info != null ) { - JsonArrayBuilder builder = Json.createArrayBuilder(); + // JsonArrayBuilder builder = Json.createArrayBuilder(); + JsonObjectBuilder builder = Json.createObjectBuilder(); for(Map.Entry entry : additional_info.entrySet()){ LOGGER.debug(MessageFormat.format("Key : {0} and Value: {1}", entry.getKey(), entry.getValue())); - JsonObject obj = Json.createObjectBuilder() - .add("name", entry.getKey()) - .add("value",entry.getValue()).build(); - builder.add(obj); +// JsonObject obj = Json.createObjectBuilder() +// .add("name", entry.getKey()) +// .add("value",entry.getValue()).build(); + builder.add(entry.getKey(), entry.getValue()); } - eveloth.add("nameValuePairs", builder); + //eveloth.add("nameValuePairs", builder); + eveloth.add("hashMap", builder); } if( additional_objects != null && additional_objects.size() > 0 ) @@ -302,19 +307,20 @@ public class EvelOther extends EvelHeader { JsonObjectBuilder obj = Json.createObjectBuilder() .add( "name", entry.getKey()); - JsonArrayBuilder builder2 = Json.createArrayBuilder(); + // JsonArrayBuilder builder2 = Json.createArrayBuilder(); + JsonObjectBuilder builder2 = Json.createObjectBuilder(); for(Map.Entry entry2 : item.entrySet()){ LOGGER.debug(MessageFormat.format("Key : {0} and Value: {1}", entry2.getKey(), entry2.getValue())); - JsonObjectBuilder obj2 = Json.createObjectBuilder() - .add("name", entry2.getKey()) - .add("value",entry2.getValue()); - builder2.add(obj2.build()); +// JsonObjectBuilder obj2 = Json.createObjectBuilder() +// .add("name", entry2.getKey()) +// .add("value",entry2.getValue()); + builder2.add(entry2.getKey(), entry2.getValue()); } - obj.add("arrayOfFields", builder2); + obj.add("hashMap", builder2); builder.add(obj.build()); } - eveloth.add("hashOfNameValuePairArrays", builder); + eveloth.add("arrayOfNamedHashMap", builder); } diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelPnfRegistration.java b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelPnfRegistration.java new file mode 100644 index 0000000..ee0ab6b --- /dev/null +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelPnfRegistration.java @@ -0,0 +1,393 @@ +package evel_javalibrary.att.com; + +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; + +import javax.json.Json; +import javax.json.JsonArrayBuilder; +import javax.json.JsonObject; +import javax.json.JsonObjectBuilder; + +import org.apache.log4j.Logger; + +/**************************************************************************//** + * @file + * Evel Fault Event class extends EvelHeader class + * + * This file implements the Evel Fault Event class which is intended to provide a + * simple wrapper around the complexity of AT&T's Vendor Event Listener API so + * that VNFs can use it to send Fault events. + * + * License + * ------- + * Unless otherwise specified, all software contained herein is + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *****************************************************************************/ + +public class EvelPnfRegistration extends EvelHeader{ + + int major_version = 1; + int minor_version = 0; + + /***************************************************************************/ + /* Mandatory fields */ + /***************************************************************************/ + EvelOptionString pnfRegistrationFieldsVersion; + + + /***************************************************************************/ + /* Optional fields */ + /***************************************************************************/ + + EvelOptionString lastServiceDate; + EvelOptionString macAddress; + EvelOptionString manufactureDate; + EvelOptionString modelNumber; + EvelOptionString oamV4IpAddress; + EvelOptionString oamV6IpAddress; +// EvelOptionDouble pnfRegistrationFieldsVersion; + EvelOptionString serialNumber; + EvelOptionString softwareVersion; + EvelOptionString unitFamily; + EvelOptionString unitType; + EvelOptionString vendorName; + + //ArrayList additional_info; + HashMap additional_inf; + + private static final Logger LOGGER = Logger.getLogger( EvelNotification.class.getName() ); + + public EvelPnfRegistration(String eventname, String ev_id) { + super(eventname, ev_id); + // TODO Auto-generated constructor stub + + event_domain = EvelHeader.DOMAINS.EVEL_DOMAIN_PNFREGISTRATION; + lastServiceDate = new EvelOptionString(); + macAddress = new EvelOptionString(); + manufactureDate = new EvelOptionString(); + modelNumber = new EvelOptionString(); + oamV4IpAddress = new EvelOptionString(); + oamV6IpAddress =new EvelOptionString(); + pnfRegistrationFieldsVersion = new EvelOptionString(); + + serialNumber = new EvelOptionString(); + softwareVersion = new EvelOptionString(); + unitFamily = new EvelOptionString(); + unitType =new EvelOptionString(); + vendorName =new EvelOptionString(); + + + additional_inf=null; + + + } + + public void evel_pnrregistration_addl_info_add(String name, String value) + { + // String[] addl_info = null; + + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_PNFREGISTRATION); + assert(name != null); + assert(value != null); + + if( additional_inf == null ) + { + additional_inf = new HashMap<>(); + } + + LOGGER.debug(MessageFormat.format("Adding name={0} value={1}", name, value)); + + additional_inf.put(name, value); + + + + EVEL_EXIT(); + } + + public void evel_pnrregistration_add_lastServiceDate_set(String lastSerDate) { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_PNFREGISTRATION); + assert(lastSerDate != null); + + lastServiceDate.SetValuePr( + lastSerDate, + "pnr registration last service date String"); + + EVEL_EXIT(); + } + + public void evel_pnrregistration_add_macaddress_set(String macAdddr) { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_PNFREGISTRATION); + assert(macAdddr != null); + + macAddress.SetValuePr( + macAdddr, + "MAC address of OAM interface of the unit"); + + EVEL_EXIT(); + } + + public void evel_pnrregistration_add_manufactureDate_set(String manufacDate) { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_PNFREGISTRATION); + assert(manufacDate != null); + + manufactureDate.SetValuePr( + manufacDate, + "pnr registration manufacture date String"); + + EVEL_EXIT(); + } + + public void evel_pnrregistration_add_modelNumber_set(String modelNum) { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_PNFREGISTRATION); + assert(modelNum != null); + + modelNumber.SetValuePr( + modelNum, + "pnr registration model number String"); + + EVEL_EXIT(); + } + + public void evel_pnrregistration_add_oamV4IpAddress_set(String oamv4ipAddr) { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_PNFREGISTRATION); + assert(oamv4ipAddr != null); + + oamV4IpAddress.SetValuePr( + oamv4ipAddr, + "pnr registration oamv4ipaddress String"); + + EVEL_EXIT(); + } + + public void evel_pnrregistration_add_oamV6IpAddress_set(String oamv6ipAddr) { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_PNFREGISTRATION); + assert(oamv6ipAddr != null); + + oamV6IpAddress.SetValuePr( + oamv6ipAddr, + "pnr registration oamv6ipaddress String"); + + EVEL_EXIT(); + } + + public void evel_pnfRegistrationFieldsVersion_set(String feildVersion) { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_PNFREGISTRATION); + assert(feildVersion != null); + + pnfRegistrationFieldsVersion.SetValuePr( + feildVersion, + "Version of the registrationFields block"); + + EVEL_EXIT(); + } + + + public void evel_pnfRegistration_serialNumber_set(String srNo) { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_PNFREGISTRATION); + assert(srNo != null); + + serialNumber.SetValuePr( + srNo, + "serial number of the unit"); + + EVEL_EXIT(); + } + public void evel_pnfRegistration_softwareVersion_set(String softwareVers) { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_PNFREGISTRATION); + assert(softwareVers != null); + + softwareVersion.SetValuePr( + softwareVers, + "active SW running on the unit"); + + EVEL_EXIT(); + } + public void evel_pnfRegistration_unitFamily_set(String unitFamily) { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_PNFREGISTRATION); + assert(unitFamily != null); + + this.unitFamily.SetValuePr( + unitFamily, + "vendor Unit Family Type "); + + EVEL_EXIT(); + } + public void evel_pnfRegistration_unitType_set(String unitType) { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_PNFREGISTRATION); + assert(unitType != null); + + this.unitType.SetValuePr( + unitType, + "vendor Unit Family Type "); + + EVEL_EXIT(); + } + public void evel_pnfRegistration_vendorName_set(String vendorName) { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_PNFREGISTRATION); + assert(vendorName != null); + + this.vendorName.SetValuePr( + vendorName, + "name of manufacturer"); + + EVEL_EXIT(); + } + + JsonObjectBuilder evelPnfRegistrationObject() + { + //String evt_source_type; + //double version = major_version+(double)minor_version/10; + String version = "2.0"; + EVEL_ENTER(); + + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_PNFREGISTRATION); + + /***************************************************************************/ + /* Mandatory fields */ + /***************************************************************************/ + JsonObjectBuilder obj = Json.createObjectBuilder(); + // .add("pnfRegistrationFieldsVersion", version); + //pnfRegistrationFieldsVersion.encJsonValue(obj, version); + /***************************************************************************/ + /* Optional fields */ + /***************************************************************************/ + serialNumber.encJsonValue(obj, "serialNumber"); + modelNumber.encJsonValue(obj, "modelNumber"); + lastServiceDate.encJsonValue(obj,"lastServiceDate"); + macAddress.encJsonValue(obj,"macAddress"); + manufactureDate.encJsonValue(obj, "manufactureDate"); + oamV4IpAddress.encJsonValue(obj, "oamV4IpAddress"); + oamV6IpAddress.encJsonValue(obj, "oamV6IpAddress"); + // pnfRegistrationFieldsVersion.encJsonValue(obj, "pnfRegistrationFieldsVersion"); + // serialNumber.encJsonValue(obj, "serialNumber"); + softwareVersion.encJsonValue(obj, "softwareVersion"); + unitFamily.encJsonValue(obj, "unitFamily"); + unitType.encJsonValue(obj, "unitType"); + vendorName.encJsonValue(obj, "vendorName"); + obj.add("pnfRegistrationFieldsVersion", version); + + + if(additional_inf != null) { + // JsonArrayBuilder builder = Json.createArrayBuilder(); + JsonObjectBuilder builder = Json.createObjectBuilder(); + Iterator> it = additional_inf.entrySet().iterator(); + while(it.hasNext()) { + Map.Entry add_inf = (Map.Entry)it.next(); + String addl_info_key = add_inf.getKey(); + String addl_info_value = add_inf.getValue(); +// JsonObject obj1 = Json.createObjectBuilder() +// .add("name", addl_info_key) +// .add("value", addl_info_value).build(); + builder.add(addl_info_key, addl_info_value); + } + obj.add("additionalFields", builder); + } + + + + EVEL_EXIT(); + + return obj; + } + + /**************************************************************************//** + * Encode the event as a JSON event object according to AT&T's schema. + * retval : String of JSON event message + *****************************************************************************/ + JsonObject evel_json_encode_event() + { + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_PNFREGISTRATION); + //encode common event header and body + JsonObject obj = Json.createObjectBuilder() + .add("event", Json.createObjectBuilder() + .add( "commonEventHeader",eventHeaderObject() ) + .add( "pnfRegistrationFields",evelPnfRegistrationObject() ) + ).build(); + + EVEL_EXIT(); + + return obj; + + } + + + +} diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelScalingMeasurement.java b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelScalingMeasurement.java index 669a6ca..52bed2e 100644 --- a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelScalingMeasurement.java +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelScalingMeasurement.java @@ -22,8 +22,13 @@ package evel_javalibrary.att.com; * limitations under the License. *****************************************************************************/ +import java.awt.im.spi.InputMethod; import java.text.MessageFormat; import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; import javax.json.Json; import javax.json.JsonArrayBuilder; @@ -33,12 +38,90 @@ import javax.json.JsonObjectBuilder; import org.apache.log4j.Logger; import org.slf4j.helpers.MessageFormatter; +import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_IPMI.IPMIHSBP; +import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_IPMI.IPMINIC; +import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_IPMI.IPMIbaseboardTemperature; +import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_IPMI.IPMIbaseboardvoltageResulator; +import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_IPMI.IPMIbattery; +import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_IPMI.IPMIfan; +import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_IPMI.IPMIglobalAggregateTemperatureMargin; +import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_IPMI.IPMIpowerSupply; +import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_IPMI.MEASUREMENT_IPMI_PROCESSOR; +import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_IPMI.MEASUREMENT_IPMI_PROCESSOR.Processor_DIMMaggregate_Thermal_Margin; + public class EvelScalingMeasurement extends EvelHeader { - int major_version = 2; + int major_version = 4; int minor_version = 0; + /* + * VES6.0 Added Fields 14/07/2018 + */ + + + + /***************************************************************************** + * MachineCheck Exception + * JSON equivalent field: machineCheckException + ******************************************************************************/ + public class MACHINE_CHECK_EXCEPTION{ + /** + * + */ + // private static final long serialVersionUID = 1L; + String processIdentifier; + EvelOptionDouble correctedMemoryErrors; + EvelOptionDouble correctedMemoryErrors_In1Hr; + EvelOptionDouble uncorrectedMemoryErrors; + EvelOptionDouble uncorrectedMemoryErrors_In1Hr; + + + } + + /**************************************************************************//** + * Huge Pages. + * JSON equivalent field: hugePages + *****************************************************************************/ + public class MEASUREMENT_HUGE_PAGE { + String hugePagesIdentifier; + double bytesUsed; + public EvelOptionDouble bytesFree; + public EvelOptionDouble vmPageNumberUsed; + public EvelOptionDouble vmPageNumberFree; + public EvelOptionDouble percentUsed; + public EvelOptionDouble percentFree; + + } + + /**************************************************************************//** + * Process Stats. + * JSON equivalent field: processStats + *****************************************************************************/ + public class MEASUREMENT_PROCESS_STATS { + String processIdentifier; + public EvelOptionDouble forkRate; + public EvelOptionDouble psStateBlocked; + public EvelOptionDouble psStatePaging; + public EvelOptionDouble psStateRunning; + public EvelOptionDouble psStateSleeping; + public EvelOptionDouble psStateStopped; + public EvelOptionDouble psStateZombie; + + } + + /**************************************************************************//** + * Load. + * JSON equivalent field: load + *****************************************************************************/ + public class MEASUREMENT_LOAD { +// String loadIdentifier; + public EvelOptionDouble shortTerm; + public EvelOptionDouble midTerm; + public EvelOptionDouble longTerm; + + } + /**************************************************************************//** * CPU Usage. * JSON equivalent field: cpuUsage @@ -54,6 +137,16 @@ public class EvelScalingMeasurement extends EvelHeader { public EvelOptionDouble sys; public EvelOptionDouble user; public EvelOptionDouble wait; + /* + * Ves6.0 added fields 14/07/2018 + */ + private EvelOptionDouble cpuCapacityContention; + public EvelOptionDouble cpuDemandAvg; + public EvelOptionDouble cpuDemandMhz; + public EvelOptionDouble cpuDemandPct; + public EvelOptionDouble cpuLatencyAvg; + public EvelOptionDouble cpuOverheadAvg; + public EvelOptionDouble cpuSwapWaitTime; } @@ -103,7 +196,26 @@ public class EvelScalingMeasurement extends EvelHeader { public EvelOptionDouble timewritelast; public EvelOptionDouble timewritemax; public EvelOptionDouble timewritemin; - + /* + * VES6.0 Added fields 14/07/2018 + */ + public EvelOptionDouble diskBusResets; + public EvelOptionDouble diskCommandsAborted; + public EvelOptionDouble diskTime; + public EvelOptionDouble diskFlushRequests; + public EvelOptionDouble diskFlushTime; + public EvelOptionDouble diskCommandsAvg; + public EvelOptionDouble diskReadCommandsAvg; + public EvelOptionDouble diskWriteCommandsAvg; + public EvelOptionDouble diskTotalReadLatencyAvg; + public EvelOptionDouble diskTotalWriteLatencyAvg; + + public EvelOptionDouble diskWeightedIoTimeAvg; + public EvelOptionDouble diskWeightedIoTimeLast; + public EvelOptionDouble diskWeightedIoTimeMax; + public EvelOptionDouble diskWeightedIoTimeMin; + + } /**************************************************************************//** @@ -134,6 +246,19 @@ public class EvelScalingMeasurement extends EvelHeader { public EvelOptionDouble slabrecl; public EvelOptionDouble slabunrecl; public EvelOptionDouble memused; + + + /* + * VES6.0 Added fields 14/07/2018 + */ + public EvelOptionDouble memoryDemand; + public EvelOptionDouble memoryLatencyAvg; + public EvelOptionDouble memorySwapUsedAvg; + public EvelOptionDouble memorySwapOutAvg; + public EvelOptionDouble memorySwapInAvg; + public EvelOptionDouble memorySwapInRateAvg; + public EvelOptionDouble memorySwapOutRateAvg; + public EvelOptionDouble memorySharedAvg; } /**************************************************************************//** @@ -166,7 +291,7 @@ public class EvelScalingMeasurement extends EvelHeader { * Virtual NIC usage. * JSON equivalent field: vNicUsage *****************************************************************************/ - public class MEASUREMENT_VNIC_PERFORMANCE { + public class MEASUREMENT_NIC_PERFORMANCE { String vnic_id; String valuesaresuspect; /***************************************************************************/ @@ -242,6 +367,23 @@ public class EvelScalingMeasurement extends EvelHeader { public EvelOptionDouble tx_ucast_packets_acc; /*Count of transmit unicast packets within the measurement interval*/ public EvelOptionDouble tx_ucast_packets_delta; + + /*VES6.0 added field 14July*/ + String nicIdentifier; + + /* + * VES6.0 added field 19July + */ + public EvelOptionDouble administrativeState; + public EvelOptionDouble operationalState; + public EvelOptionDouble receivedPercentDiscard; + public EvelOptionDouble receivedPercentError; + public EvelOptionDouble receivedUtilization; + public EvelOptionString speed; + public EvelOptionDouble transmittedPercentDiscard; + public EvelOptionDouble transmittedPercentError; + public EvelOptionDouble transmittedUtilization; + } /**************************************************************************//** @@ -280,6 +422,877 @@ public class EvelScalingMeasurement extends EvelHeader { String name; ArrayList measurements; } + + + + + + + + /* + * VES6.0 added fields 14July + */ + + /**************************************************************************//** + * IPMI. + * JSON equivalent field: Ipmi + *****************************************************************************/ + public class MEASUREMENT_IPMI { + + /***************************************************************************/ + /* Optional fields */ + /***************************************************************************/ + public EvelOptionDouble exitAirTemperature; + public EvelOptionDouble ioModuleTemperature; + public EvelOptionDouble frontPanelTemperature; + public EvelOptionDouble systemAirflow; + + ArrayList ipmiprocessor; + + public class MEASUREMENT_IPMI_PROCESSOR { + public String processorIdentifier; + public EvelOptionDouble processorThermalControlPercent; + public EvelOptionDouble processorDTSthermalMargin; + + ArrayList processorDIMMaggregateThermalMargin; + + public class Processor_DIMMaggregate_Thermal_Margin { + public String processorDIMMaggregateThermalMarginIdentifier; + public double processorDIMMaggregateThermalMargin; + + + } + + public void evel_measurement_IPMI_ProcessorDIMMaggregateThermalMargin_add( + String thermalMarginIdentifier, + double thermalMargin) + { + Processor_DIMMaggregate_Thermal_Margin pp = null; + EVEL_ENTER(); + + /***************************************************************************/ + /* Check assumptions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); + assert(thermalMarginIdentifier != null); + assert(thermalMargin > 0.0); + + /***************************************************************************/ + /* Allocate a container for the value and push onto the list. */ + /***************************************************************************/ + LOGGER.debug(MessageFormatter.format("Adding ThermalMarginIdentifier={0} Use={1}", thermalMarginIdentifier, thermalMargin)); + pp = new Processor_DIMMaggregate_Thermal_Margin(); + assert(pp != null); + pp.processorDIMMaggregateThermalMarginIdentifier = thermalMarginIdentifier; + assert(pp.processorDIMMaggregateThermalMargin >= 0.0); + pp.processorDIMMaggregateThermalMargin = thermalMargin; + + if( processorDIMMaggregateThermalMargin == null ){ + processorDIMMaggregateThermalMargin = new ArrayList(); + LOGGER.debug("Allocate new ProcessorDIMMaggregateThermalMargin"); + } + + processorDIMMaggregateThermalMargin.add(pp); + + EVEL_EXIT(); + } + + + } + public void evel_measurement_IPMI_MEASUREMENT_IPMI_PROCESSOR_add( + String processorIdentifier + ) + { + MEASUREMENT_IPMI_PROCESSOR mIP = null; + EVEL_ENTER(); + + /***************************************************************************/ + /* Check assumptions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); + assert(processorIdentifier != null); + + + /***************************************************************************/ + /* Allocate a container for the value and push onto the list. */ + /***************************************************************************/ + LOGGER.debug(MessageFormatter.format("Adding Identifier={0}", processorIdentifier)); + mIP = new MEASUREMENT_IPMI_PROCESSOR(); + assert(mIP != null); + mIP.processorIdentifier = processorIdentifier; + mIP.processorThermalControlPercent = new EvelOptionDouble(); + mIP.processorDTSthermalMargin = new EvelOptionDouble(); + + + + if( ipmiprocessor == null ){ + ipmiprocessor = new ArrayList(); + LOGGER.debug("Allocate new IPMI_PROCESSOR"); + } + + ipmiprocessor.add(mIP); + + EVEL_EXIT(); + } + + + + + + + ArrayList ipmiglobalAggregateTemperatureMarginArray; + + public class IPMIglobalAggregateTemperatureMargin { + public String globalAggregateTemperatureMarginIdentifier; + public EvelOptionDouble globalAggregateTemeratureMargin; + } + + public void evel_measurement_IPMI_MEASUREMENT_IPMIglobalAggregateTemperatureMargin_add( + String globalAggregateTemperatureMarginIdentifier + ) + { + IPMIglobalAggregateTemperatureMargin ipmiGlobalAgg = null; + EVEL_ENTER(); + + /***************************************************************************/ + /* Check assumptions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); + assert(globalAggregateTemperatureMarginIdentifier != null); + + + /***************************************************************************/ + /* Allocate a container for the value and push onto the list. */ + /***************************************************************************/ + LOGGER.debug(MessageFormatter.format("Adding Identifier={0}", globalAggregateTemperatureMarginIdentifier)); + ipmiGlobalAgg = new IPMIglobalAggregateTemperatureMargin(); + assert(ipmiGlobalAgg != null); + ipmiGlobalAgg.globalAggregateTemperatureMarginIdentifier = globalAggregateTemperatureMarginIdentifier; + ipmiGlobalAgg.globalAggregateTemeratureMargin = new EvelOptionDouble(); + + + if( ipmiglobalAggregateTemperatureMarginArray == null ){ + ipmiglobalAggregateTemperatureMarginArray = new ArrayList(); + LOGGER.debug("Allocate new IPMIglobalAggregateTemperatureMargin"); + } + + ipmiglobalAggregateTemperatureMarginArray.add(ipmiGlobalAgg); + + EVEL_EXIT(); + } + + + + ArrayList ipmipowerSupply; + + public class IPMIpowerSupply { + public String powerSupplyIdentifier; + public EvelOptionDouble powerSupplyInputPower; + public EvelOptionDouble powerSupplycurrentOutputPercent; + public EvelOptionDouble powerSupplyTemperature; + } + + public void evel_measurement_IPMI_MEASUREMENT_IPMIpowerSupply_add( + String powerSupplyIdentifier + ) + { + IPMIpowerSupply ipmipower = null; + EVEL_ENTER(); + + /***************************************************************************/ + /* Check assumptions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); + assert(ipmipower != null); + + + /***************************************************************************/ + /* Allocate a container for the value and push onto the list. */ + /***************************************************************************/ + LOGGER.debug(MessageFormatter.format("Adding Identifier={0}", powerSupplyIdentifier)); + ipmipower = new IPMIpowerSupply(); + assert(ipmipower != null); + ipmipower.powerSupplyIdentifier = powerSupplyIdentifier; + ipmipower.powerSupplycurrentOutputPercent = new EvelOptionDouble(); + ipmipower.powerSupplyInputPower = new EvelOptionDouble(); + ipmipower.powerSupplyTemperature = new EvelOptionDouble(); + + + if( ipmipowerSupply == null ){ + ipmipowerSupply = new ArrayList(); + LOGGER.debug("Allocate new IPMIpowerSupply"); + } + + ipmipowerSupply.add(ipmipower); + + EVEL_EXIT(); + } + + + + + + ArrayList ipmibattery; + + public class IPMIbattery { + public String batteryIdentifier; + public EvelOptionString batteryType; + public EvelOptionDouble batteryVoltageLevel; + + } + + public void evel_measurement_IPMI_MEASUREMENT_IPMIbattery_add( + String batteryIdentifier + ) + { + IPMIbattery imibatt = null; + EVEL_ENTER(); + + /***************************************************************************/ + /* Check assumptions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); + assert(imibatt != null); + + + /***************************************************************************/ + /* Allocate a container for the value and push onto the list. */ + /***************************************************************************/ + LOGGER.debug(MessageFormatter.format("Adding Identifier={0}", batteryIdentifier)); + imibatt = new IPMIbattery(); + assert(imibatt != null); + imibatt.batteryIdentifier = batteryIdentifier; + imibatt.batteryType = new EvelOptionString(); + imibatt.batteryVoltageLevel = new EvelOptionDouble(); + + if( ipmibattery == null ){ + ipmibattery = new ArrayList(); + LOGGER.debug("Allocate new IPMIbattery"); + } + + ipmibattery.add(imibatt); + + EVEL_EXIT(); + } + + + + ArrayList ipmiNIC; + + public class IPMINIC { + public String nic_Identifier; + public EvelOptionDouble nic_Temperature; + + + } + + public void evel_measurement_IPMINIC_add( + String nic_Identifier + ) + { + IPMINIC ipmiNic = null; + EVEL_ENTER(); + + /***************************************************************************/ + /* Check assumptions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); + assert(ipmiNic != null); + + + /***************************************************************************/ + /* Allocate a container for the value and push onto the list. */ + /***************************************************************************/ + LOGGER.debug(MessageFormatter.format("Adding Identifier={0}", nic_Identifier)); + ipmiNic = new IPMINIC(); + assert(ipmiNic != null); + ipmiNic.nic_Identifier = nic_Identifier; + ipmiNic.nic_Temperature = new EvelOptionDouble(); + + + + if( ipmiNIC == null ){ + ipmiNIC = new ArrayList(); + LOGGER.debug("Allocate new IPMINIC"); + } + + ipmiNIC.add(ipmiNic); + + EVEL_EXIT(); + } + + + + ArrayList ipmiHSBP; + + public class IPMIHSBP { + public String hsbpIdentifier; + public EvelOptionDouble hsbpTemperature; + + + } + + + public void evel_measurement_IPMIHSBP_add( + String hsbpIdentifier + ) + { + IPMIHSBP ipmiHsbp = null; + EVEL_ENTER(); + + /***************************************************************************/ + /* Check assumptions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); + assert(ipmiHsbp != null); + + + /***************************************************************************/ + /* Allocate a container for the value and push onto the list. */ + /***************************************************************************/ + LOGGER.debug(MessageFormatter.format("Adding Identifier={0}", hsbpIdentifier)); + ipmiHsbp = new IPMIHSBP(); + assert(ipmiHsbp != null); + ipmiHsbp.hsbpIdentifier = hsbpIdentifier; + ipmiHsbp.hsbpTemperature = new EvelOptionDouble(); + + + if( ipmiHSBP == null ){ + ipmiHSBP = new ArrayList(); + LOGGER.debug("Allocate new IPMIHSBP"); + } + + ipmiHSBP.add(ipmiHsbp); + + EVEL_EXIT(); + } + + + + + ArrayList ipmibaseboardTemperature; + + public class IPMIbaseboardTemperature { + public String baseboardTemperatureIdentifier; + public EvelOptionDouble baseboardTemperature; + + + } + + + + public void evel_measurement_IPMIbaseboardTemperature_add( + String baseboardTemperatureIdentifier + ) + { + IPMIbaseboardTemperature ipmibaseboardTemp = null; + EVEL_ENTER(); + + /***************************************************************************/ + /* Check assumptions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); + assert(ipmibaseboardTemperature != null); + + + /***************************************************************************/ + /* Allocate a container for the value and push onto the list. */ + /***************************************************************************/ + LOGGER.debug(MessageFormatter.format("Adding Identifier={0}", baseboardTemperatureIdentifier)); + ipmibaseboardTemp = new IPMIbaseboardTemperature(); + assert(ipmibaseboardTemp != null); + ipmibaseboardTemp.baseboardTemperatureIdentifier = baseboardTemperatureIdentifier; + ipmibaseboardTemp.baseboardTemperature = new EvelOptionDouble(); + + if( ipmibaseboardTemperature == null ){ + ipmibaseboardTemperature = new ArrayList(); + LOGGER.debug("Allocate new IPMIbaseboardTemperature"); + } + + ipmibaseboardTemperature.add(ipmibaseboardTemp); + + EVEL_EXIT(); + } + + + + + ArrayList ipmiBaseboardvoltageResulator; + + public class IPMIbaseboardvoltageResulator { + public String baseboardVoltageRegulatorIdentifier; + public EvelOptionDouble voltageRegulatorTemperature; + + + } + + + public void evel_measurement_IPMIbaseboardvoltageResulator_add( + String baseboardVoltageRegulatorIdentifier + ) + { + IPMIbaseboardvoltageResulator ipmiBaseboardvoltageRes = null; + EVEL_ENTER(); + + /***************************************************************************/ + /* Check assumptions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); + assert(ipmiBaseboardvoltageRes != null); + + + /***************************************************************************/ + /* Allocate a container for the value and push onto the list. */ + /***************************************************************************/ + LOGGER.debug(MessageFormatter.format("Adding Identifier={0}", baseboardVoltageRegulatorIdentifier)); + ipmiBaseboardvoltageRes = new IPMIbaseboardvoltageResulator(); + assert(ipmiBaseboardvoltageRes != null); + ipmiBaseboardvoltageRes.baseboardVoltageRegulatorIdentifier = baseboardVoltageRegulatorIdentifier; + ipmiBaseboardvoltageRes.voltageRegulatorTemperature = new EvelOptionDouble(); + + if( ipmiBaseboardvoltageResulator == null ){ + ipmiBaseboardvoltageResulator = new ArrayList(); + LOGGER.debug("Allocate new IPMIbaseboardvoltageResulator"); + } + + ipmiBaseboardvoltageResulator.add(ipmiBaseboardvoltageRes); + + EVEL_EXIT(); + } + + + + + ArrayList ipmiFan; + + public class IPMIfan { + public String fanIdentifier; + public EvelOptionDouble fanSpeed; + + + } + + public void evel_measurement_IPMIfan_add( + String fanIdentifier + ) + { + IPMIfan ipmiF = null; + EVEL_ENTER(); + + /***************************************************************************/ + /* Check assumptions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); + assert(ipmiF != null); + + + /***************************************************************************/ + /* Allocate a container for the value and push onto the list. */ + /***************************************************************************/ + LOGGER.debug(MessageFormatter.format("Adding Identifier={0}", fanIdentifier)); + ipmiF = new IPMIfan(); + assert(ipmiF != null); + ipmiF.fanIdentifier = fanIdentifier; + ipmiF.fanSpeed = new EvelOptionDouble(); + + if( ipmiFan == null ){ + ipmiFan = new ArrayList(); + LOGGER.debug("Allocate new IPMIfan"); + } + + ipmiFan.add(ipmiF); + + EVEL_EXIT(); + } + + + + + + + + + + + + + + + + + + + + + + + +// ArrayList ipmi_percentage; +// ArrayList ipmi_voltage; +// +// ArrayList ipmi_temparature; +// ArrayList ipmi_fan; +// ArrayList ipmi_cfm; +// ArrayList ipmi_watts; +// /**************************************************************************//** +// * IPMI Percent Usage. +// * JSON equivalent field: PercentUsage +// *****************************************************************************/ +// public class MEASUREMENT_IPMI_PERCENT_USAGE { +// public EvelOptionDouble P2ThermCtrl; +// public EvelOptionDouble P1ThermCtrl; +// public EvelOptionDouble PS1CurrOut; +// +// } +// +// public class MEASUREMENT_IPMI_VOLTAGE { +// public EvelOptionDouble BB3_3vVbat; +// public EvelOptionDouble BB12_0v; +// +// } +// +// public class MEASUREMENT_IPMI_TEMPARATURE { +// public EvelOptionDouble AggThermMgn1; +// public EvelOptionDouble DIMMThrmMrgn4; +// public EvelOptionDouble DIMMThrmMrgn3; +// public EvelOptionDouble DIMMThrmMrgn2; +// public EvelOptionDouble DIMMThrmMrgn1; +// public EvelOptionDouble P2DTSThermMgn; +// public EvelOptionDouble P1DTSThermMgn; +// public EvelOptionDouble P2ThermCtrl; +// public EvelOptionDouble P1ThermCtrl; +// public EvelOptionDouble P2ThermMargin; +// public EvelOptionDouble P1ThermMargin; +// public EvelOptionDouble PS1Temperature; +// public EvelOptionDouble LANNICTemp; +// public EvelOptionDouble ExitAirTemp; +// public EvelOptionDouble HSBP1Temp; +// public EvelOptionDouble IOModTemp; +// public EvelOptionDouble BBLftRearTemp; +// public EvelOptionDouble BBRtRearTemp; +// public EvelOptionDouble BBBMCTemp; +// public EvelOptionDouble SSBTemp; +// public EvelOptionDouble FrontPanelTemp; +// public EvelOptionDouble BBP2VRTemp; +// public EvelOptionDouble BBP1VRTemp; +// +// } +// +// public class MEASUREMENT_IPMI_FAN { +// public EvelOptionDouble SystemFan6B; +// public EvelOptionDouble SystemFan6A; +// public EvelOptionDouble SystemFan5B; +// public EvelOptionDouble SystemFan5A; +// public EvelOptionDouble SystemFan4B; +// public EvelOptionDouble SystemFan4A; +// public EvelOptionDouble SystemFan3B; +// public EvelOptionDouble SystemFan3A; +// public EvelOptionDouble SystemFan2B; +// public EvelOptionDouble SystemFa_2A; +// public EvelOptionDouble SystemFan1B; +// public EvelOptionDouble SystemFan1A; +// +// } +// public class MEASUREMENT_IPMI_CFM { +// public EvelOptionDouble System_Airflow; +// +// } +// public class MEASUREMENT_IPMI_WATTS { +// public EvelOptionDouble PS1InputPower; +// +// } +// +// +// public MEASUREMENT_IPMI_TEMPARATURE evel_measurement_new_temparature_add(double usage) +// { +// EVEL_ENTER(); +// +// /***************************************************************************/ +// /* Check assumptions. */ +// /***************************************************************************/ +// assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); +// assert(usage >= 0.0); +// +// /***************************************************************************/ +// /* Allocate a container for the value and push onto the list. */ +// /***************************************************************************/ +// LOGGER.debug(MessageFormatter.format("Adding id={0} usage={1}", usage)); +// MEASUREMENT_IPMI_TEMPARATURE temparature = new MEASUREMENT_IPMI_TEMPARATURE(); +// assert(temparature != null); +// temparature.AggThermMgn1 = new EvelOptionDouble(); +// temparature.DIMMThrmMrgn4 = new EvelOptionDouble(); +// +// temparature.DIMMThrmMrgn3 = new EvelOptionDouble(); +// temparature.DIMMThrmMrgn2 = new EvelOptionDouble(); +// temparature.DIMMThrmMrgn1 = new EvelOptionDouble(); +// temparature.P2DTSThermMgn = new EvelOptionDouble(); +// temparature.P1DTSThermMgn = new EvelOptionDouble(); +// temparature.P2ThermCtrl = new EvelOptionDouble(); +// temparature.P1ThermCtrl = new EvelOptionDouble(); +// temparature.P2ThermMargin = new EvelOptionDouble(); +// temparature.P1ThermMargin = new EvelOptionDouble(); +// temparature.PS1Temperature = new EvelOptionDouble(); +// temparature.LANNICTemp = new EvelOptionDouble(); +// temparature.ExitAirTemp = new EvelOptionDouble(); +// temparature.HSBP1Temp = new EvelOptionDouble(); +// temparature.IOModTemp = new EvelOptionDouble(); +// temparature.BBLftRearTemp = new EvelOptionDouble(); +// temparature.BBRtRearTemp = new EvelOptionDouble(); +// temparature.BBBMCTemp = new EvelOptionDouble(); +// temparature.SSBTemp = new EvelOptionDouble(); +// temparature.FrontPanelTemp = new EvelOptionDouble(); +// temparature.BBP2VRTemp = new EvelOptionDouble(); +// temparature.BBP1VRTemp = new EvelOptionDouble(); +// +// +// +// if( ipmi_temparature == null ){ +// ipmi_temparature = new ArrayList(); +// LOGGER.debug("Allocate percent_usage"); +// } +// +// ipmi_temparature.add(temparature); +// +// EVEL_EXIT(); +// return temparature; +// } +// +// +// +// public MEASUREMENT_IPMI_FAN evel_measurement_new_fan_add(double usage) +// { +// EVEL_ENTER(); +// +// /***************************************************************************/ +// /* Check assumptions. */ +// /***************************************************************************/ +// assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); +// assert(usage >= 0.0); +// +// /***************************************************************************/ +// /* Allocate a container for the value and push onto the list. */ +// /***************************************************************************/ +// LOGGER.debug(MessageFormatter.format("Adding id={0} usage={1}", usage)); +// MEASUREMENT_IPMI_FAN fan = new MEASUREMENT_IPMI_FAN(); +// assert(fan != null); +// fan.SystemFan6B = new EvelOptionDouble(); +// fan.SystemFan6A = new EvelOptionDouble(); +// fan.SystemFan5B = new EvelOptionDouble(); +// fan.SystemFan5A = new EvelOptionDouble(); +// fan.SystemFan4B = new EvelOptionDouble(); +// fan.SystemFan4A = new EvelOptionDouble(); +// fan.SystemFan3B = new EvelOptionDouble(); +// fan.SystemFan3A = new EvelOptionDouble(); +// fan.SystemFan2B = new EvelOptionDouble(); +// fan.SystemFa_2A = new EvelOptionDouble(); +// fan.SystemFan1B = new EvelOptionDouble(); +// fan.SystemFan1A = new EvelOptionDouble(); +// +// if( ipmi_fan == null ){ +// ipmi_fan = new ArrayList(); +// LOGGER.debug("Allocate percent_usage"); +// } +// +// ipmi_fan.add(fan); +// +// EVEL_EXIT(); +// return fan; +// } +// +// +// public MEASUREMENT_IPMI_CFM evel_measurement_new_cfm_add(double usage) +// { +// EVEL_ENTER(); +// +// /***************************************************************************/ +// /* Check assumptions. */ +// /***************************************************************************/ +// assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); +// assert(usage >= 0.0); +// +// /***************************************************************************/ +// /* Allocate a container for the value and push onto the list. */ +// /***************************************************************************/ +// LOGGER.debug(MessageFormatter.format("Adding id={0} usage={1}", usage)); +// MEASUREMENT_IPMI_CFM cfm = new MEASUREMENT_IPMI_CFM(); +// assert(cfm != null); +// cfm.System_Airflow = new EvelOptionDouble(); +// +// +// +// +// +// if( ipmi_cfm == null ){ +// ipmi_cfm = new ArrayList(); +// LOGGER.debug("Allocate percent_usage"); +// } +// +// ipmi_cfm.add(cfm); +// +// EVEL_EXIT(); +// return cfm; +// } +// +// +// public MEASUREMENT_IPMI_WATTS evel_measurement_new_watts_add(double usage) +// { +// EVEL_ENTER(); +// +// /***************************************************************************/ +// /* Check assumptions. */ +// /***************************************************************************/ +// assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); +// assert(usage >= 0.0); +// +// /***************************************************************************/ +// /* Allocate a container for the value and push onto the list. */ +// /***************************************************************************/ +// LOGGER.debug(MessageFormatter.format("Adding id={0} usage={1}", usage)); +// MEASUREMENT_IPMI_WATTS watts = new MEASUREMENT_IPMI_WATTS(); +// assert(watts != null); +// watts.PS1InputPower = new EvelOptionDouble(); +// +// +// +// +// +// if( ipmi_watts == null ){ +// ipmi_watts = new ArrayList(); +// LOGGER.debug("Allocate percent_usage"); +// } +// +// ipmi_watts.add(watts); +// +// EVEL_EXIT(); +// return watts; +// } + + +// public MEASUREMENT_IPMI_VOLTAGE evel_measurement_new_voltage_add(double usage) +// { +// EVEL_ENTER(); +// +// /***************************************************************************/ +// /* Check assumptions. */ +// /***************************************************************************/ +// assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); +// assert(usage >= 0.0); +// +// /***************************************************************************/ +// /* Allocate a container for the value and push onto the list. */ +// /***************************************************************************/ +// LOGGER.debug(MessageFormatter.format("Adding id={0} usage={1}", usage)); +// MEASUREMENT_IPMI_VOLTAGE voltage = new MEASUREMENT_IPMI_VOLTAGE(); +// assert(voltage != null); +// voltage.BB12_0v = new EvelOptionDouble(); +// voltage.BB3_3vVbat = new EvelOptionDouble(); +// +// +// +// +// if( ipmi_voltage == null ){ +// ipmi_voltage = new ArrayList(); +// LOGGER.debug("Allocate percent_usage"); +// } +// +// ipmi_voltage.add(voltage); +// +// EVEL_EXIT(); +// return voltage; +// } + +// public MEASUREMENT_IPMI_PERCENT_USAGE evel_measurement_new_percent_usage_add(double usage) +// { +// EVEL_ENTER(); +// +// /***************************************************************************/ +// /* Check assumptions. */ +// /***************************************************************************/ +// assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); +// assert(usage >= 0.0); +// +// /***************************************************************************/ +// /* Allocate a container for the value and push onto the list. */ +// /***************************************************************************/ +// LOGGER.debug(MessageFormatter.format("Adding id={0} usage={1}", usage)); +// MEASUREMENT_IPMI_PERCENT_USAGE percent_usage = new MEASUREMENT_IPMI_PERCENT_USAGE(); +// assert(percent_usage != null); +// percent_usage.P1ThermCtrl = new EvelOptionDouble(); +// percent_usage.P2ThermCtrl = new EvelOptionDouble(); +// percent_usage.PS1CurrOut = new EvelOptionDouble(); +// +// +// +// if( ipmi_percentage == null ){ +// ipmi_percentage = new ArrayList(); +// LOGGER.debug("Allocate percent_usage"); +// } +// +// ipmi_percentage.add(percent_usage); +// +// EVEL_EXIT(); +// return percent_usage; +// } +// +} + + public MEASUREMENT_IPMI evel_meas_ipmi_add(MEASUREMENT_IPMI ipmi) + { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); + assert(ipmi != null); + + if( ipmis == null ){ + ipmis = new ArrayList(); + LOGGER.debug("Allocate new file system usage"); + } + + + ipmis.add(ipmi); + + EVEL_EXIT(); + + return ipmi; + } + + public void evel_measurement_ipmi_exitAirTemperature_set(MEASUREMENT_IPMI ipmi, + double val) + { + EVEL_ENTER(); + ipmi.exitAirTemperature.SetValuePr(val,"System fan exit air flow temperature in Celsius "); + EVEL_EXIT(); + } + public void evel_measurement_ipmi_frontPanelTemperature_set(MEASUREMENT_IPMI ipmi, + double val) + { + EVEL_ENTER(); + ipmi.frontPanelTemperature.SetValuePr(val,"Front panel temp in Celsius"); + EVEL_EXIT(); + } + public void evel_measurement_ipmi_ioModuleTemperature_set(MEASUREMENT_IPMI ipmi, + double val) + { + EVEL_ENTER(); + ipmi.ioModuleTemperature.SetValuePr(val,"Io module temp in Celsius "); + EVEL_EXIT(); + } + public void evel_measurement_ipmi_systemAirflow_set(MEASUREMENT_IPMI ipmi, + double val) + { + EVEL_ENTER(); + ipmi.systemAirflow.SetValuePr(val,"Airflow in cubic feet per minute (cfm)"); + EVEL_EXIT(); + } + + + + + /***************************************************************************/ @@ -290,13 +1303,26 @@ public class EvelScalingMeasurement extends EvelHeader { /***************************************************************************/ /* Optional fields */ /***************************************************************************/ - ArrayList additional_info; + // ArrayList additional_info; + + HashMap additional_inf; + ArrayList additional_measurements; ArrayList additional_objects; ArrayList codec_usage; EvelOptionInt concurrent_sessions; EvelOptionInt configured_entities; ArrayList cpu_usage; + //VES6.0 Added field 14/07/2018 + ArrayList huge_pages; + ArrayList loads; + ArrayList process_stats; + ArrayList ipmis; + ArrayList machineCheckException; + + + + ArrayList disk_usage; boolean errstat; MEASUREMENT_ERRORS myerrors; @@ -308,7 +1334,7 @@ public class EvelScalingMeasurement extends EvelHeader { EvelOptionInt media_ports_in_use; EvelOptionInt request_rate; EvelOptionInt vnfc_scaling_metric; - ArrayList vnic_usage; + ArrayList vnic_usage; /***************************************************************************/ @@ -348,7 +1374,7 @@ public class EvelScalingMeasurement extends EvelHeader { event_domain = EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT; //initialize optional fields measurement_interval = meas_interval; - additional_info = null; + additional_inf = null; additional_measurements = null; additional_objects = null; cpu_usage = null; @@ -361,6 +1387,14 @@ public class EvelScalingMeasurement extends EvelHeader { feature_usage = null; errstat = false; + + huge_pages=null; + loads = null; + process_stats=null; + ipmis=null; + machineCheckException = null; + + mean_request_latency = new EvelOptionDouble(false, 0.0); vnfc_scaling_metric = new EvelOptionInt(false, 0); concurrent_sessions = new EvelOptionInt(false, 0); @@ -413,7 +1447,7 @@ public class EvelScalingMeasurement extends EvelHeader { *****************************************************************************/ public void evel_measurement_addl_info_add(String name, String value) { - String[] addl_info = null; + // String[] addl_info = null; EVEL_ENTER(); /***************************************************************************/ @@ -423,22 +1457,76 @@ public class EvelScalingMeasurement extends EvelHeader { assert(name != null); assert(value != null); - if( additional_info == null ) + if( additional_inf == null ) { - additional_info = new ArrayList(); + additional_inf = new HashMap(); } LOGGER.debug(MessageFormat.format("Adding name={0} value={1}", name, value)); - addl_info = new String[2]; - assert(addl_info != null); - addl_info[0] = name; - addl_info[1] = value; - - additional_info.add(addl_info); + // addl_info = new String[2]; + // assert(addl_info != null); + // addl_info[0] = name; + // addl_info[1] = value; + additional_inf.put(name, value); + // additional_info.add(addl_info); EVEL_EXIT(); } + /**************************************************************************/ + /* IPMI. */ + /* JSON equivalent field: Ipmi */ + /*****************************************************************************/ + + public MEASUREMENT_IPMI evel_measurement_new_ipmis_add() + { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check assumptions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); + + /***************************************************************************/ + /* Allocate a container for the value and push onto the list. */ + /***************************************************************************/ + //LOGGER.debug(MessageFormatter.format("Adding id={0} usage={1}", id, usage)); + MEASUREMENT_IPMI ipmi = new MEASUREMENT_IPMI(); + assert(ipmi != null); + //cpu_use.id = id; + //cpu_use.usage = usage; + ipmi.exitAirTemperature = new EvelOptionDouble(); + ipmi.frontPanelTemperature = new EvelOptionDouble(); + ipmi.ioModuleTemperature = new EvelOptionDouble(); + ipmi.systemAirflow = new EvelOptionDouble(); + + + if( ipmis == null ){ + ipmis= new ArrayList(); + LOGGER.debug("Allocate new ipmis"); + } + + ipmis.add(ipmi); + + EVEL_EXIT(); + return ipmi; + } + + + + /* + * + */ + + + + + + + + + + /**************************************************************************//** * Set the Concurrent Sessions property of the Measurement. * @@ -601,10 +1689,16 @@ public class EvelScalingMeasurement extends EvelHeader { EVEL_EXIT(); } - + + + + /* + * VES6.0 Added fields 14July2018 + */ + /**************************************************************************//** - * Add an additional CPU usage value name/value pair to the Measurement. - * + load average figures giving the number of jobs in the run queue (state R) or waiting for disk I/O (state D) averaged over 1 Minute + measured CPU and IO utilization for 1 min using /proc/loadavg * The name and value are null delimited ASCII strings. The library takes * a copy so the caller does not have to preserve values after the function * returns. @@ -613,7 +1707,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param id ASCIIZ string with the CPU's identifier. * @param usage CPU utilization. *****************************************************************************/ - public MEASUREMENT_CPU_USE evel_measurement_new_cpu_use_add(String id, double usage) + public MEASUREMENT_PROCESS_STATS evel_measurement_new_process_stats_add(String id, double usage) { EVEL_ENTER(); @@ -628,34 +1722,36 @@ public class EvelScalingMeasurement extends EvelHeader { /* Allocate a container for the value and push onto the list. */ /***************************************************************************/ LOGGER.debug(MessageFormatter.format("Adding id={0} usage={1}", id, usage)); - MEASUREMENT_CPU_USE cpu_use = new MEASUREMENT_CPU_USE(); - assert(cpu_use != null); - cpu_use.id = id; - cpu_use.usage = usage; - cpu_use.idle = new EvelOptionDouble(); - cpu_use.intrpt = new EvelOptionDouble(); - cpu_use.nice = new EvelOptionDouble(); - cpu_use.softirq = new EvelOptionDouble(); - cpu_use.steal = new EvelOptionDouble(); - cpu_use.sys = new EvelOptionDouble(); - cpu_use.user = new EvelOptionDouble(); - cpu_use.wait = new EvelOptionDouble(); + MEASUREMENT_PROCESS_STATS process_stat = new MEASUREMENT_PROCESS_STATS(); + assert(process_stat != null); + process_stat.processIdentifier = id; + process_stat.forkRate = new EvelOptionDouble(); + process_stat.psStateBlocked = new EvelOptionDouble(); + process_stat.psStatePaging = new EvelOptionDouble(); + process_stat.psStateRunning = new EvelOptionDouble(); + process_stat.psStateSleeping = new EvelOptionDouble(); + process_stat.psStateStopped = new EvelOptionDouble(); + process_stat.psStateZombie = new EvelOptionDouble(); - if( cpu_usage == null ){ - cpu_usage = new ArrayList(); - LOGGER.debug("Allocate new cpu usage"); + + if( process_stats == null ){ + process_stats = new ArrayList(); + LOGGER.debug("Allocate Process_Stats"); } - cpu_usage.add(cpu_use); + process_stats.add(process_stat); EVEL_EXIT(); - return cpu_use; + return process_stat; } - + + + + + + /**************************************************************************//** - * Set the CPU Idle value in measurement interval - * percentage of CPU time spent in the idle task - * + * the number of threads created since the last reboo * @note The property is treated as immutable: it is only valid to call * the setter once. However, we don't assert if the caller tries to * overwrite, just ignoring the update instead. @@ -663,16 +1759,768 @@ public class EvelScalingMeasurement extends EvelHeader { * @param cpu_use Pointer to the CPU Use. * @param val double *****************************************************************************/ - public void evel_measurement_cpu_use_idle_set(MEASUREMENT_CPU_USE cpu_use, - double val) + + + public void evel_measurement_process_stats_forkRate_set(MEASUREMENT_PROCESS_STATS process_stat, + double val) + { + EVEL_ENTER(); + process_stat.forkRate.SetValuePr(val,"the number of threads created since the last reboot"); + EVEL_EXIT(); + } + + /**************************************************************************//** + * the number of processes in a blocked state + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + + + public void evel_measurement_process_stats_psStateBlocked_set(MEASUREMENT_PROCESS_STATS process_stat, + double val) + { + EVEL_ENTER(); + process_stat.psStateBlocked.SetValuePr(val,"the number of processes in a blocked state"); + EVEL_EXIT(); + } + + + /**************************************************************************//** + * the number of processes in a paging state + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + + + public void evel_measurement_process_stats_psStatePaging_set(MEASUREMENT_PROCESS_STATS process_stat, + double val) + { + EVEL_ENTER(); + process_stat.psStatePaging.SetValuePr(val,"the number of processes in a paging state"); + EVEL_EXIT(); + } + + + + /**************************************************************************//** + * the number of processes in a running state + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + + + public void evel_measurement_process_stats_psStateRunning_set(MEASUREMENT_PROCESS_STATS process_stat, + double val) + { + EVEL_ENTER(); + process_stat.psStateRunning.SetValuePr(val,"the number of processes in a running state"); + EVEL_EXIT(); + } + + /**************************************************************************//** + * the number of processes in a sleeping state + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + + + public void evel_measurement_process_stats_psStateSleeping_set(MEASUREMENT_PROCESS_STATS process_stat, + double val) + { + EVEL_ENTER(); + process_stat.psStateSleeping.SetValuePr(val,"the number of processes in a sleeping state"); + EVEL_EXIT(); + } + + + /**************************************************************************//** + * the number of processes in a stopped state + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + + + public void evel_measurement_process_stats_psStateStopped_set(MEASUREMENT_PROCESS_STATS process_stat, + double val) + { + EVEL_ENTER(); + process_stat.psStateStopped.SetValuePr(val,"the number of processes in a stopped state"); + EVEL_EXIT(); + } + + /**************************************************************************//** + * the number of processes in a Zombie state + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + + + public void evel_measurement_process_stats_psStateZombie_set(MEASUREMENT_PROCESS_STATS process_stat, + double val) + { + EVEL_ENTER(); + process_stat.psStateZombie.SetValuePr(val,"the number of processes in a Zombie state"); + EVEL_EXIT(); + } + + /* + * VES6.0 Added fields 14July2018 + */ + + /**************************************************************************//** + load average figures giving the number of jobs in the run queue (state R) or waiting for disk I/O (state D) averaged over 1 Minute + measured CPU and IO utilization for 1 min using /proc/loadavg + * The name and value are null delimited ASCII strings. The library takes + * a copy so the caller does not have to preserve values after the function + * returns. + * + * + * @param usage CPU utilization. + *****************************************************************************/ + public MEASUREMENT_LOAD evel_measurement_new_load_add(double usage) + { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check assumptions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); +// assert(id != null); + assert(usage >= 0.0); + + /***************************************************************************/ + /* Allocate a container for the value and push onto the list. */ + /***************************************************************************/ +// LOGGER.debug(MessageFormatter.format("Adding id={0} usage={1}", id, usage)); + MEASUREMENT_LOAD load = new MEASUREMENT_LOAD(); + assert(load != null); +// load.loadIdentifier = id; + load.shortTerm = new EvelOptionDouble(); + load.midTerm = new EvelOptionDouble(); + load.longTerm = new EvelOptionDouble(); + + if( loads == null ){ + loads = new ArrayList(); + LOGGER.debug("Allocate Load"); + } + + loads.add(load); + + EVEL_EXIT(); + return load; + } + + /**************************************************************************//** + * load average figures giving the number of jobs in the run queue (state R) or waiting for disk I/O (state D) averaged over 1 Minute + measured CPU and IO utilization for 1 min using /proc/loadavg" + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + + + public void evel_measurement_load_shortTerm_set(MEASUREMENT_LOAD load, + double val) + { + EVEL_ENTER(); + load.shortTerm.SetValuePr(val,"load short term"); + EVEL_EXIT(); + } + + /**************************************************************************//** + * "load average figures giving the number of jobs in the run queue (state R) or waiting for disk I/O (state D) averaged over 5 Minutes + measured CPU and IO utilization for 5 mins using /proc/loadavg" + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + + + public void evel_measurement_load_midTerm_set(MEASUREMENT_LOAD load, + double val) + { + EVEL_ENTER(); + load.midTerm.SetValuePr(val,"load midterm"); + EVEL_EXIT(); + } + + /**************************************************************************//** + * load average figures giving the number of jobs in the run queue (state R) or waiting for disk I/O (state D) averaged over 15 Minutes + measured CPU and IO utilization for 15 mins using /proc/loadavg + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + + + public void evel_measurement_load_longTerm_set(MEASUREMENT_LOAD load, + double val) + { + EVEL_ENTER(); + load.longTerm.SetValuePr(val,"load longterm"); + EVEL_EXIT(); + } + + /****************************************************************************** + * + *****************************************************************************/ + + public MACHINE_CHECK_EXCEPTION evel_measurement_new_machine_check_exception_add(String id) + { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check assumptions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); + assert(id != null); + + /***************************************************************************/ + /* Allocate a container for the value and push onto the list. */ + /***************************************************************************/ + LOGGER.debug(MessageFormatter.format("Adding id={0}", id)); + MACHINE_CHECK_EXCEPTION machine_check_exception = new MACHINE_CHECK_EXCEPTION(); + assert(machine_check_exception != null); + machine_check_exception.processIdentifier = id; + machine_check_exception.correctedMemoryErrors = new EvelOptionDouble(); + machine_check_exception.correctedMemoryErrors_In1Hr = new EvelOptionDouble(); + machine_check_exception.uncorrectedMemoryErrors = new EvelOptionDouble(); + machine_check_exception.uncorrectedMemoryErrors_In1Hr = new EvelOptionDouble(); + + + if( machineCheckException == null ){ + machineCheckException = new ArrayList(); + LOGGER.debug("Allocate new machineCheckException"); + } + + machineCheckException.add(machine_check_exception); + + EVEL_EXIT(); + return machine_check_exception; + } + + + public MACHINE_CHECK_EXCEPTION evel_measurement_Exception_correctedMemoryErrors_set(MACHINE_CHECK_EXCEPTION exception, + double val) + { + EVEL_ENTER(); + exception.correctedMemoryErrors.SetValuePr(val, "Exception_correctedMemoryErrors"); + EVEL_EXIT(); + + return exception; + } + + public MACHINE_CHECK_EXCEPTION evel_measurement_Exception_correctedMemoryErrors_In1Hr_set(MACHINE_CHECK_EXCEPTION exception, + double val) + { + EVEL_ENTER(); + exception.correctedMemoryErrors_In1Hr.SetValuePr(val, "Exception_correctedMemoryErrors_In1Hr"); + EVEL_EXIT(); + return exception; + + } + + public MACHINE_CHECK_EXCEPTION evel_measurement_Exception_uncorrectedMemoryErrors_set(MACHINE_CHECK_EXCEPTION exception, + double val) + { + EVEL_ENTER(); + exception.uncorrectedMemoryErrors.SetValuePr(val, "Exception_uncorrectedMemoryErrors"); + EVEL_EXIT(); + return exception; + } + + public MACHINE_CHECK_EXCEPTION evel_measurement_Exception_uncorrectedMemoryErrors_In1Hr_set(MACHINE_CHECK_EXCEPTION exception, + double val) + { + EVEL_ENTER(); + exception.uncorrectedMemoryErrors_In1Hr.SetValuePr(val, "Exception_uncorrectedMemoryErrors_In1Hr"); + EVEL_EXIT(); + return exception; + } + + + /* + * VES6.0 Added fields 14July2018 + */ + /**************************************************************************//** + * Add an additional HUGE PAGE value name/value pair to the Measurement. + * + * The name and value are null delimited ASCII strings. The library takes + * a copy so the caller does not have to preserve values after the function + * returns. + * + * + * @param id ASCIIZ string with the CPU's identifier. + * @param usage CPU utilization. + *****************************************************************************/ + public MEASUREMENT_HUGE_PAGE evel_measurement_new_huge_page_add(String id, double usage) + { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check assumptions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); + assert(id != null); + assert(usage >= 0.0); + + /***************************************************************************/ + /* Allocate a container for the value and push onto the list. */ + /***************************************************************************/ + LOGGER.debug(MessageFormatter.format("Adding id={0} usage={1}", id, usage)); + MEASUREMENT_HUGE_PAGE huge_page = new MEASUREMENT_HUGE_PAGE(); + assert(huge_page != null); + huge_page.hugePagesIdentifier = id; + huge_page.bytesUsed = usage; + huge_page.bytesFree = new EvelOptionDouble(); + huge_page.percentFree = new EvelOptionDouble(); + huge_page.percentUsed = new EvelOptionDouble(); + huge_page.vmPageNumberFree = new EvelOptionDouble(); + huge_page.vmPageNumberUsed = new EvelOptionDouble(); + + + if( huge_pages == null ){ + huge_pages = new ArrayList(); + LOGGER.debug("Allocate new cpu usage"); + } + + huge_pages.add(huge_page); + + EVEL_EXIT(); + return huge_page; + } + + + /**************************************************************************//** + * Set Number of free hugepages in bytes + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param string double + *****************************************************************************/ + + +// public void evel_measurement_huge_page_hugePagesIdentifier_set(MEASUREMENT_HUGE_PAGE huge_page, +// String string) +// { +// EVEL_ENTER(); +// huge_page.SetValuePr(string,"CPU hugePagesIdentifier"); +// EVEL_EXIT(); +// +// +// } + /**************************************************************************//** + * Set Number of free hugepages in percent + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + + + public void evel_measurement_huge_page_percentFree_set(MEASUREMENT_HUGE_PAGE huge_page, + double val) + { + EVEL_ENTER(); + huge_page.percentFree.SetValuePr(val,"Number of free hugepages in percent"); + EVEL_EXIT(); + + + } + + /**************************************************************************//** + * Set Number of used hugepages in percent + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + + + public void evel_measurement_huge_page_percentUsed_set(MEASUREMENT_HUGE_PAGE huge_page, + double val) + { + EVEL_ENTER(); + huge_page.percentUsed.SetValuePr(val,"Number of used hugepages in percent"); + EVEL_EXIT(); + } + /**************************************************************************//** + * Set Number of used hugepages in numbers + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + + + public void evel_measurement_huge_page_vmPageNumberFree_set(MEASUREMENT_HUGE_PAGE huge_page, + double val) + { + EVEL_ENTER(); + huge_page.vmPageNumberFree.SetValuePr(val,"Number of used hugepages in numbers"); + EVEL_EXIT(); + } + /**************************************************************************//** + * Set Number of used hugepages in numbers + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + + + public void evel_measurement_huge_page_vmPageNumberUsed_set(MEASUREMENT_HUGE_PAGE huge_page, + double val) + { + EVEL_ENTER(); + huge_page.vmPageNumberUsed.SetValuePr(val,"Number of used hugepages in numbers"); + EVEL_EXIT(); + } + + /**************************************************************************//** + * Set Number of used hugepages in numbers + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + + + public void evel_measurement_huge_page_bytesFree_set(MEASUREMENT_HUGE_PAGE huge_page, + double val) + { + EVEL_ENTER(); + huge_page.bytesFree.SetValuePr(val,"Number of used hugepages in numbers"); + EVEL_EXIT(); + } + /**************************************************************************//** + * Add an additional CPU usage value name/value pair to the Measurement. + * + * The name and value are null delimited ASCII strings. The library takes + * a copy so the caller does not have to preserve values after the function + * returns. + * + * + * @param id ASCIIZ string with the CPU's identifier. + * @param usage CPU utilization. + *****************************************************************************/ + public MEASUREMENT_CPU_USE evel_measurement_new_cpu_use_add(String id, double usage) + { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check assumptions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); + assert(id != null); + assert(usage >= 0.0); + + /***************************************************************************/ + /* Allocate a container for the value and push onto the list. */ + /***************************************************************************/ + LOGGER.debug(MessageFormatter.format("Adding id={0} usage={1}", id, usage)); + MEASUREMENT_CPU_USE cpu_use = new MEASUREMENT_CPU_USE(); + assert(cpu_use != null); + cpu_use.id = id; + cpu_use.usage = usage; + cpu_use.idle = new EvelOptionDouble(); + cpu_use.intrpt = new EvelOptionDouble(); + cpu_use.nice = new EvelOptionDouble(); + cpu_use.softirq = new EvelOptionDouble(); + cpu_use.steal = new EvelOptionDouble(); + cpu_use.sys = new EvelOptionDouble(); + cpu_use.user = new EvelOptionDouble(); + cpu_use.wait = new EvelOptionDouble(); + /* + * Ves6.0 Added Fields 14/07/2018 + */ + cpu_use.cpuCapacityContention= new EvelOptionDouble(); + cpu_use.cpuDemandAvg= new EvelOptionDouble(); + cpu_use.cpuDemandMhz= new EvelOptionDouble(); + cpu_use.cpuDemandPct= new EvelOptionDouble(); + cpu_use.cpuLatencyAvg= new EvelOptionDouble(); + cpu_use.cpuOverheadAvg= new EvelOptionDouble(); + cpu_use.cpuSwapWaitTime= new EvelOptionDouble(); + if( cpu_usage == null ){ + cpu_usage = new ArrayList(); + LOGGER.debug("Allocate new cpu usage"); + } + + cpu_usage.add(cpu_use); + + EVEL_EXIT(); + return cpu_use; + } + /**************************************************************************//** + * Set the amount of time the CPU cannot run due to centention, in milliseconds. + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + + + public void evel_measurement_cpu_use_cpuCapacityContention_set(MEASUREMENT_CPU_USE cpu_use, + double val) + { + EVEL_ENTER(); + cpu_use.cpuCapacityContention.SetValuePr(val,"CPU cpuCapacityContention"); + EVEL_EXIT(); + } + /**************************************************************************//** + * Set the total CPU time that the VNF/VNFC/VM could use if there is no contention, in milliseconds. + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + public void evel_measurement_cpu_use_cpuDeamandAvg_set(MEASUREMENT_CPU_USE cpu_use, + double val) + { + EVEL_ENTER(); + cpu_use.cpuDemandAvg.SetValuePr(val,"Total CPU Time"); + EVEL_EXIT(); + } + + /**************************************************************************//** + * Set CPU demand as a percentage of the provisioned capacity. + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + public void evel_measurement_cpu_use_cpuDeamandPct_set(MEASUREMENT_CPU_USE cpu_use, + double val) + { + EVEL_ENTER(); + cpu_use.cpuDemandPct.SetValuePr(val,"CPU Demand as a percentage"); + EVEL_EXIT(); + } + /**************************************************************************//** + * Set CPU demand in megahertz. + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + public void evel_measurement_cpu_use_cpuDeamandMhz_set(MEASUREMENT_CPU_USE cpu_use, + double val) + { + EVEL_ENTER(); + cpu_use.cpuDemandMhz.SetValuePr(val,"CPU demand in megahertz"); + EVEL_EXIT(); + } + /**************************************************************************//** + * Set Percentage of time the VM is unable to run because it is contending for access to the physical CPUs. + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + public void evel_measurement_cpu_use_cpuLatencyAvg_set(MEASUREMENT_CPU_USE cpu_use, + double val) + { + EVEL_ENTER(); + cpu_use.cpuLatencyAvg.SetValuePr(val,"CPU Percentage of time"); + EVEL_EXIT(); + } + /**************************************************************************//** + * Set The overhead demand above available allocations and reservations. + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + public void evel_measurement_cpu_use_cpuOverheadAvg_set(MEASUREMENT_CPU_USE cpu_use, + double val) + { + EVEL_ENTER(); + cpu_use.cpuOverheadAvg.SetValuePr(val,"CPU overhead demand"); + EVEL_EXIT(); + } + /**************************************************************************//** + * Set CPU Swap wait time in milliseconds. + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + public void evel_measurement_cpu_use_cpuSwapWaitTime_set(MEASUREMENT_CPU_USE cpu_use, + double val) + { + EVEL_ENTER(); + cpu_use.cpuSwapWaitTime.SetValuePr(val,"CPU Swap wait time"); + EVEL_EXIT(); + } + + + + + /**************************************************************************//** + * Set the CPU Idle value in measurement interval + * percentage of CPU time spent in the idle task + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + public void evel_measurement_cpu_use_idle_set(MEASUREMENT_CPU_USE cpu_use, + double val) + { + EVEL_ENTER(); + cpu_use.idle.SetValuePr(val,"CPU idle time"); + EVEL_EXIT(); + } + + /**************************************************************************//** + * Set the percentage of time spent servicing interrupts + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + public void evel_measurement_cpu_use_interrupt_set(MEASUREMENT_CPU_USE cpu_use, + double val) + { + EVEL_ENTER(); + cpu_use.intrpt.SetValuePr(val,"CPU interrupt value"); + + EVEL_EXIT(); + } + + + /**************************************************************************//** + * Set the percentage of time spent running user space processes that have been niced + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + public void evel_measurement_cpu_use_nice_set(MEASUREMENT_CPU_USE cpu_use, + double val) + { + EVEL_ENTER(); + cpu_use.nice.SetValuePr(val, "CPU nice value"); + + EVEL_EXIT(); + } + + + /**************************************************************************//** + * Set the percentage of time spent handling soft irq interrupts + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + public void evel_measurement_cpu_use_softirq_set(MEASUREMENT_CPU_USE cpu_use, + double val) + { + EVEL_ENTER(); + cpu_use.softirq.SetValuePr(val, "CPU Soft IRQ value"); + + EVEL_EXIT(); + } + + /**************************************************************************//** + * Set the percentage of time spent in involuntary wait + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + public void evel_measurement_cpu_use_steal_set(MEASUREMENT_CPU_USE cpu_use, + double val) { EVEL_ENTER(); - cpu_use.idle.SetValuePr(val,"CPU idle time"); + cpu_use.steal.SetValuePr(val,"CPU involuntary wait"); + EVEL_EXIT(); } /**************************************************************************//** - * Set the percentage of time spent servicing interrupts + * Set the percentage of time spent on system tasks running the kernel * * @note The property is treated as immutable: it is only valid to call * the setter once. However, we don't assert if the caller tries to @@ -681,150 +2529,397 @@ public class EvelScalingMeasurement extends EvelHeader { * @param cpu_use Pointer to the CPU Use. * @param val double *****************************************************************************/ - public void evel_measurement_cpu_use_interrupt_set(MEASUREMENT_CPU_USE cpu_use, + public void evel_measurement_cpu_use_system_set(MEASUREMENT_CPU_USE cpu_use, + double val) + { + EVEL_ENTER(); + cpu_use.sys.SetValuePr(val,"CPU System load"); + EVEL_EXIT(); + } + + + /**************************************************************************//** + * Set the percentage of time spent running un-niced user space processes + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + public void evel_measurement_cpu_use_usageuser_set(MEASUREMENT_CPU_USE cpu_use, double val) { EVEL_ENTER(); - cpu_use.intrpt.SetValuePr(val,"CPU interrupt value"); - + cpu_use.user.SetValuePr(val,"CPU User load value"); + + EVEL_EXIT(); + } + + /**************************************************************************//** + * Set the percentage of CPU time spent waiting for I/O operations to complete + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param cpu_use Pointer to the CPU Use. + * @param val double + *****************************************************************************/ + public void evel_measurement_cpu_use_wait_set(MEASUREMENT_CPU_USE cpu_use, + double val) + { + EVEL_ENTER(); + cpu_use.wait.SetValuePr(val, "CPU Wait IO value"); + + EVEL_EXIT(); + } + + + /**************************************************************************//** + * Add an additional Memory usage value name/value pair to the Measurement. + * + * The name and value are null delimited ASCII strings. The library takes + * a copy so the caller does not have to preserve values after the function + * returns. + * + * + * @param id ASCIIZ string with the Memory identifier. + * @param vmidentifier ASCIIZ string with the VM's identifier. + * @param membuffsz Memory Size. + * + * @return Returns pointer to memory use structure in measurements + *****************************************************************************/ + public MEASUREMENT_MEM_USE evel_measurement_new_mem_use_add( + String vmidentifier, double membuffsz) + { + MEASUREMENT_MEM_USE mem_use = null; + EVEL_ENTER(); + + /***************************************************************************/ + /* Check assumptions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); + // assert(id != null); + assert(membuffsz >= 0.0); + + /***************************************************************************/ + /* Allocate a container for the value and push onto the list. */ + /***************************************************************************/ + LOGGER.debug(MessageFormatter.format("Adding buffer size={1}", membuffsz)); + mem_use = new MEASUREMENT_MEM_USE(); + assert(mem_use != null); + // mem_use.id = id; + mem_use.vmid = vmidentifier; + mem_use.membuffsz = membuffsz; + mem_use.memcache = new EvelOptionDouble(); + mem_use.memconfig= new EvelOptionDouble(); + mem_use.memfree= new EvelOptionDouble(); + mem_use.slabrecl= new EvelOptionDouble(); + mem_use.slabunrecl= new EvelOptionDouble(); + mem_use.memused= new EvelOptionDouble(); + + + + mem_use.memoryDemand= new EvelOptionDouble(); + mem_use.memoryLatencyAvg= new EvelOptionDouble(); + mem_use.memorySharedAvg= new EvelOptionDouble(); + mem_use.memorySwapInAvg= new EvelOptionDouble(); + mem_use.memorySwapInRateAvg= new EvelOptionDouble(); + mem_use.memorySwapOutAvg= new EvelOptionDouble(); + mem_use.memorySwapOutRateAvg= new EvelOptionDouble(); + mem_use.memorySwapUsedAvg= new EvelOptionDouble(); + + assert(mem_use.id != null); + + if( mem_usage == null ){ + mem_usage = new ArrayList(); + LOGGER.debug("Allocated new memory usage"); + } + + + mem_usage.add(mem_use); + + EVEL_EXIT(); + return mem_use; + } + + /**************************************************************************//** + * Set kilobytes of memory used for cache + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param mem_use Pointer to the Memory Use. + * @param val double + *****************************************************************************/ + public void evel_measurement_mem_use_memcache_set(MEASUREMENT_MEM_USE mem_use, + double val) + { + EVEL_ENTER(); + mem_use.memcache.SetValuePr(val,"Memory cache value"); + + EVEL_EXIT(); + } + + /**************************************************************************//** + * Set kilobytes of memory configured in the virtual machine on which the VNFC reporting + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param mem_use Pointer to the Memory Use. + * @param val double + *****************************************************************************/ + public void evel_measurement_mem_use_memconfig_set(MEASUREMENT_MEM_USE mem_use, + double val) + { + EVEL_ENTER(); + mem_use.memconfig.SetValuePr(val, "Memory configured value"); + EVEL_EXIT(); + } + + /**************************************************************************//** + * Set kilobytes of physical RAM left unused by the system + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param mem_use Pointer to the Memory Use. + * @param val double + *****************************************************************************/ + public void evel_measurement_mem_use_memfree_set(MEASUREMENT_MEM_USE mem_use, + double val) + { + EVEL_ENTER(); + mem_use.memfree.SetValuePr(val, "Memory freely available value"); + EVEL_EXIT(); + } + + /**************************************************************************//** + * Set the part of the slab that can be reclaimed such as caches measured in kilobytes + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param mem_use Pointer to the Memory Use. + * @param val double + *****************************************************************************/ + public void evel_measurement_mem_use_slab_reclaimed_set(MEASUREMENT_MEM_USE mem_use, + double val) + { + EVEL_ENTER(); + mem_use.slabrecl.SetValuePr(val, "Memory reclaimable slab set"); + EVEL_EXIT(); + } + + /**************************************************************************//** + * Set the part of the slab that cannot be reclaimed such as caches measured in kilobytes + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param mem_use Pointer to the Memory Use. + * @param val double + *****************************************************************************/ + public void evel_measurement_mem_use_slab_unreclaimable_set(MEASUREMENT_MEM_USE mem_use, + double val) + { + EVEL_ENTER(); + mem_use.slabunrecl.SetValuePr(val, "Memory unreclaimable slab set"); + EVEL_EXIT(); + } + + /**************************************************************************//** + * Set the total memory minus the sum of free, buffered, cached and slab memory in kilobytes + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param mem_use Pointer to the Memory Use. + * @param val double + *****************************************************************************/ + public void evel_measurement_mem_use_usedup_set(MEASUREMENT_MEM_USE mem_use, + double val) + { + EVEL_ENTER(); + mem_use.memused.SetValuePr(val, "Memory usedup total set"); + EVEL_EXIT(); + } + + + /* + * VES6.0 Added Fields 14July + */ + /**************************************************************************//** + * Set the Host demand in kibibytes. + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param mem_use Pointer to the Memory Use. + * @param val double + *****************************************************************************/ + public void evel_measurement_mem_use_memoryDemand_set(MEASUREMENT_MEM_USE mem_use, + double val) + { + EVEL_ENTER(); + mem_use.memoryDemand.SetValuePr(val, "Host demand in kibibytes"); + EVEL_EXIT(); + } + + + /**************************************************************************//** + * Set Percentage of time the VM is waiting to access swapped or compressed memory. + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param mem_use Pointer to the Memory Use. + * @param val double + *****************************************************************************/ + public void evel_measurement_mem_use_memoryLatencyAvg_set(MEASUREMENT_MEM_USE mem_use, + double val) + { + EVEL_ENTER(); + mem_use.memoryLatencyAvg.SetValuePr(val, "Percentage of time the VM is waiting to access swapped or compressed memory"); EVEL_EXIT(); } - - + /**************************************************************************//** - * Set the percentage of time spent running user space processes that have been niced + * Set Space used for caching swapped pages in the host cache in kibibytes. * * @note The property is treated as immutable: it is only valid to call * the setter once. However, we don't assert if the caller tries to * overwrite, just ignoring the update instead. * - * @param cpu_use Pointer to the CPU Use. + * @param mem_use Pointer to the Memory Use. * @param val double *****************************************************************************/ - public void evel_measurement_cpu_use_nice_set(MEASUREMENT_CPU_USE cpu_use, - double val) + public void evel_measurement_mem_use_memorySharedAvg_set(MEASUREMENT_MEM_USE mem_use, + double val) { EVEL_ENTER(); - cpu_use.nice.SetValuePr(val, "CPU nice value"); - + mem_use.memorySharedAvg.SetValuePr(val, "Space used for caching swapped pages in the host cache in kibibytes"); EVEL_EXIT(); } - + /**************************************************************************//** - * Set the percentage of time spent handling soft irq interrupts + * Set Amount of memory swapped-in from host cache in kibibytes. * * @note The property is treated as immutable: it is only valid to call * the setter once. However, we don't assert if the caller tries to * overwrite, just ignoring the update instead. * - * @param cpu_use Pointer to the CPU Use. + * @param mem_use Pointer to the Memory Use. * @param val double *****************************************************************************/ - public void evel_measurement_cpu_use_softirq_set(MEASUREMENT_CPU_USE cpu_use, - double val) + public void evel_measurement_mem_use_memorySwapInAvg_set(MEASUREMENT_MEM_USE mem_use, + double val) { EVEL_ENTER(); - cpu_use.softirq.SetValuePr(val, "CPU Soft IRQ value"); - + mem_use.memorySwapInAvg.SetValuePr(val, "Amount of memory swapped-in from host cache in kibibytes."); EVEL_EXIT(); } - + /**************************************************************************//** - * Set the percentage of time spent in involuntary wait + * Set Rate at which memory is swapped from disk into active memory during the interval in kilobyte per second. * * @note The property is treated as immutable: it is only valid to call * the setter once. However, we don't assert if the caller tries to * overwrite, just ignoring the update instead. * - * @param cpu_use Pointer to the CPU Use. + * @param mem_use Pointer to the Memory Use. * @param val double *****************************************************************************/ - public void evel_measurement_cpu_use_steal_set(MEASUREMENT_CPU_USE cpu_use, - double val) + public void evel_measurement_mem_use_memorySwapInRateAvg_set(MEASUREMENT_MEM_USE mem_use, + double val) { EVEL_ENTER(); - cpu_use.steal.SetValuePr(val,"CPU involuntary wait"); - + mem_use.memorySwapInRateAvg.SetValuePr(val, "Rate at which memory is swapped from disk into active memory during the interval in kilobyte per second."); EVEL_EXIT(); } - + + /**************************************************************************//** - * Set the percentage of time spent on system tasks running the kernel + * Set Amount of memory swapped-out to host cache in kibibytes * * @note The property is treated as immutable: it is only valid to call * the setter once. However, we don't assert if the caller tries to * overwrite, just ignoring the update instead. * - * @param cpu_use Pointer to the CPU Use. + * @param mem_use Pointer to the Memory Use. * @param val double *****************************************************************************/ - public void evel_measurement_cpu_use_system_set(MEASUREMENT_CPU_USE cpu_use, + public void evel_measurement_mem_use_memorySwapOutAvg_set(MEASUREMENT_MEM_USE mem_use, double val) { EVEL_ENTER(); - cpu_use.sys.SetValuePr(val,"CPU System load"); + mem_use.memorySwapOutAvg.SetValuePr(val, "Amount of memory swapped-out to host cache in kibibytes."); EVEL_EXIT(); } - - + /**************************************************************************//** - * Set the percentage of time spent running un-niced user space processes + * Set Rate at which memory is being swapped from active memory to disk during the current interval in kilobytes per second. * * @note The property is treated as immutable: it is only valid to call * the setter once. However, we don't assert if the caller tries to * overwrite, just ignoring the update instead. * - * @param cpu_use Pointer to the CPU Use. + * @param mem_use Pointer to the Memory Use. * @param val double *****************************************************************************/ - public void evel_measurement_cpu_use_usageuser_set(MEASUREMENT_CPU_USE cpu_use, - double val) + public void evel_measurement_mem_use_memorySwapOutRateAvg_set(MEASUREMENT_MEM_USE mem_use, + double val) { EVEL_ENTER(); - cpu_use.user.SetValuePr(val,"CPU User load value"); - + mem_use.memorySwapOutRateAvg.SetValuePr(val, "Rate at which memory is being swapped from active memory to disk during the current interval in kilobytes per second"); EVEL_EXIT(); } - + /**************************************************************************//** - * Set the percentage of CPU time spent waiting for I/O operations to complete + * Set Space used for caching swapped pages in the host cache in kibibytes. * * @note The property is treated as immutable: it is only valid to call * the setter once. However, we don't assert if the caller tries to * overwrite, just ignoring the update instead. * - * @param cpu_use Pointer to the CPU Use. + * @param mem_use Pointer to the Memory Use. * @param val double *****************************************************************************/ - public void evel_measurement_cpu_use_wait_set(MEASUREMENT_CPU_USE cpu_use, - double val) + public void evel_measurement_mem_use_memorySwapUsedAvg_set(MEASUREMENT_MEM_USE mem_use, + double val) { EVEL_ENTER(); - cpu_use.wait.SetValuePr(val, "CPU Wait IO value"); - + mem_use.memorySwapUsedAvg.SetValuePr(val, "Space used for caching swapped pages in the host cache in kibibytes."); EVEL_EXIT(); } - - + + /**************************************************************************//** - * Add an additional Memory usage value name/value pair to the Measurement. + * Add an additional Disk usage value name/value pair to the Measurement. * * The name and value are null delimited ASCII strings. The library takes * a copy so the caller does not have to preserve values after the function * returns. * * - * @param id ASCIIZ string with the Memory identifier. - * @param vmidentifier ASCIIZ string with the VM's identifier. - * @param membuffsz Memory Size. - * - * @return Returns pointer to memory use structure in measurements + * @param id ASCIIZ string with the CPU's identifier. + * @param usage Disk utilization. *****************************************************************************/ - public MEASUREMENT_MEM_USE evel_measurement_new_mem_use_add( - String id, String vmidentifier, double membuffsz) + public MEASUREMENT_DISK_USE evel_measurement_new_disk_use_add(String id) { - MEASUREMENT_MEM_USE mem_use = null; + MEASUREMENT_DISK_USE disk_use = null; EVEL_ENTER(); /***************************************************************************/ @@ -832,232 +2927,319 @@ public class EvelScalingMeasurement extends EvelHeader { /***************************************************************************/ assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); assert(id != null); - assert(membuffsz >= 0.0); /***************************************************************************/ /* Allocate a container for the value and push onto the list. */ /***************************************************************************/ - LOGGER.debug(MessageFormatter.format("Adding id={0} buffer size={1}", id, membuffsz)); - mem_use = new MEASUREMENT_MEM_USE(); - assert(mem_use != null); - mem_use.id = id; - mem_use.vmid = vmidentifier; - mem_use.membuffsz = membuffsz; - mem_use.memcache = new EvelOptionDouble(); - mem_use.memconfig= new EvelOptionDouble(); - mem_use.memfree= new EvelOptionDouble(); - mem_use.slabrecl= new EvelOptionDouble(); - mem_use.slabunrecl= new EvelOptionDouble(); - mem_use.memused= new EvelOptionDouble(); + LOGGER.debug(MessageFormatter.format("Adding id={0} disk usage", id)); + disk_use = new MEASUREMENT_DISK_USE(); + assert(disk_use != null); + disk_use.id = id; + assert(disk_use.id != null); - assert(mem_use.id != null); + disk_use.iotimeavg= new EvelOptionDouble(); + disk_use.iotimelast= new EvelOptionDouble(); + disk_use.iotimemax= new EvelOptionDouble(); + disk_use.iotimemin= new EvelOptionDouble(); + disk_use.mergereadavg= new EvelOptionDouble(); + disk_use.mergereadlast= new EvelOptionDouble(); + disk_use.mergereadmax= new EvelOptionDouble(); + disk_use.mergereadmin= new EvelOptionDouble(); + disk_use.mergewriteavg= new EvelOptionDouble(); + disk_use.mergewritelast= new EvelOptionDouble(); + disk_use.mergewritemax= new EvelOptionDouble(); + disk_use.mergewritemin= new EvelOptionDouble(); + disk_use.octetsreadavg= new EvelOptionDouble(); + disk_use.octetsreadlast= new EvelOptionDouble(); + disk_use.octetsreadmax= new EvelOptionDouble(); + disk_use.octetsreadmin= new EvelOptionDouble(); + disk_use.octetswriteavg= new EvelOptionDouble(); + disk_use.octetswritelast= new EvelOptionDouble(); + disk_use.octetswritemax= new EvelOptionDouble(); + disk_use.octetswritemin= new EvelOptionDouble(); + disk_use.opsreadavg= new EvelOptionDouble(); + disk_use.opsreadlast= new EvelOptionDouble(); + disk_use.opsreadmax= new EvelOptionDouble(); + disk_use.opsreadmin= new EvelOptionDouble(); + disk_use.opswriteavg= new EvelOptionDouble(); + disk_use.opswritelast= new EvelOptionDouble(); + disk_use.opswritemax= new EvelOptionDouble(); + disk_use.opswritemin= new EvelOptionDouble(); + disk_use.pendingopsavg= new EvelOptionDouble(); + disk_use.pendingopslast= new EvelOptionDouble(); + disk_use.pendingopsmax= new EvelOptionDouble(); + disk_use.pendingopsmin= new EvelOptionDouble(); + disk_use.timereadavg= new EvelOptionDouble(); + disk_use.timereadlast= new EvelOptionDouble(); + disk_use.timereadmax= new EvelOptionDouble(); + disk_use.timereadmin= new EvelOptionDouble(); + disk_use.timewriteavg= new EvelOptionDouble(); + disk_use.timewritelast= new EvelOptionDouble(); + disk_use.timewritemax= new EvelOptionDouble(); + disk_use.timewritemin= new EvelOptionDouble(); + /* + * + */ + disk_use.diskBusResets=new EvelOptionDouble(); + disk_use.diskCommandsAborted=new EvelOptionDouble(); + disk_use.diskCommandsAvg=new EvelOptionDouble(); + disk_use.diskFlushRequests=new EvelOptionDouble(); + disk_use.diskFlushTime=new EvelOptionDouble(); + disk_use.diskReadCommandsAvg=new EvelOptionDouble(); + disk_use.diskTime=new EvelOptionDouble(); + disk_use.diskTotalReadLatencyAvg=new EvelOptionDouble(); + disk_use.diskWriteCommandsAvg=new EvelOptionDouble(); + disk_use.diskTotalWriteLatencyAvg=new EvelOptionDouble(); - if( mem_usage == null ){ - mem_usage = new ArrayList(); - LOGGER.debug("Allocated new memory usage"); + + disk_use.diskWeightedIoTimeAvg=new EvelOptionDouble(); + disk_use.diskWeightedIoTimeLast=new EvelOptionDouble(); + disk_use.diskWeightedIoTimeMax=new EvelOptionDouble(); + disk_use.diskWeightedIoTimeMin=new EvelOptionDouble(); + + + + if( disk_usage == null ){ + disk_usage = new ArrayList(); + LOGGER.debug("Unable to allocate new disk usage"); } + + disk_usage.add(disk_use); - mem_usage.add(mem_use); EVEL_EXIT(); - return mem_use; + return disk_use; } + + /* + * Ves 6.0 19/07/2018 + */ + + /**************************************************************************//** + * Set milliseconds spent doing input/output operations over 1 sec; treat + * this metric as a device load percentage where 1000ms matches 100% load; + * provide the average over the measurement interval + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param disk_use Pointer to the Disk Use. + * @param val double + *****************************************************************************/ + + public void evel_measurement_disk_use_diskWeightedIoTimeAvg_set(MEASUREMENT_DISK_USE disk_use, + double val) + { + EVEL_ENTER(); + disk_use.diskWeightedIoTimeAvg.SetValuePr(val,"average within the collection interval"); + EVEL_EXIT(); + } + + + public void evel_measurement_disk_use_diskWeightedIoTimeLast_set(MEASUREMENT_DISK_USE disk_use, + double val) + { + EVEL_ENTER(); + disk_use.diskWeightedIoTimeLast.SetValuePr(val,"last within the collection interval."); + EVEL_EXIT(); + } + + public void evel_measurement_disk_use_diskWeightedIoTimeMax_set(MEASUREMENT_DISK_USE disk_use, + double val) + { + EVEL_ENTER(); + disk_use.diskWeightedIoTimeMax.SetValuePr(val,"maximum within the collection interval."); + EVEL_EXIT(); + } + + public void evel_measurement_disk_use_diskWeightedIoTimeMin_set(MEASUREMENT_DISK_USE disk_use, + double val) + { + EVEL_ENTER(); + disk_use.diskWeightedIoTimeMin.SetValuePr(val,"minimum within the collection interval."); + EVEL_EXIT(); + } + + + + + /* + * ************************************* + */ + /**************************************************************************//** - * Set kilobytes of memory used for cache + * Set milliseconds spent doing input/output operations over 1 sec; treat + * this metric as a device load percentage where 1000ms matches 100% load; + * provide the average over the measurement interval * * @note The property is treated as immutable: it is only valid to call * the setter once. However, we don't assert if the caller tries to * overwrite, just ignoring the update instead. * - * @param mem_use Pointer to the Memory Use. + * @param disk_use Pointer to the Disk Use. * @param val double *****************************************************************************/ - public void evel_measurement_mem_use_memcache_set(MEASUREMENT_MEM_USE mem_use, - double val) + public void evel_measurement_disk_use_diskBusResets_set(MEASUREMENT_DISK_USE disk_use, + double val) { EVEL_ENTER(); - mem_use.memcache.SetValuePr(val,"Memory cache value"); - + disk_use.diskBusResets.SetValuePr(val,"Disk Bus Resets"); EVEL_EXIT(); } - /**************************************************************************//** - * Set kilobytes of memory configured in the virtual machine on which the VNFC reporting + * Set milliseconds spent doing input/output operations over 1 sec; treat + * this metric as a device load percentage where 1000ms matches 100% load; + * provide the average over the measurement interval * * @note The property is treated as immutable: it is only valid to call * the setter once. However, we don't assert if the caller tries to * overwrite, just ignoring the update instead. * - * @param mem_use Pointer to the Memory Use. + * @param disk_use Pointer to the Disk Use. * @param val double *****************************************************************************/ - public void evel_measurement_mem_use_memconfig_set(MEASUREMENT_MEM_USE mem_use, - double val) + public void evel_measurement_disk_use_diskCommandsAborted_set(MEASUREMENT_DISK_USE disk_use, + double val) { EVEL_ENTER(); - mem_use.memconfig.SetValuePr(val, "Memory configured value"); + disk_use.diskCommandsAborted.SetValuePr(val,"Disk ioload set"); EVEL_EXIT(); } - /**************************************************************************//** - * Set kilobytes of physical RAM left unused by the system + * Set Average number of commands per second. * * @note The property is treated as immutable: it is only valid to call * the setter once. However, we don't assert if the caller tries to * overwrite, just ignoring the update instead. * - * @param mem_use Pointer to the Memory Use. + * @param disk_use Pointer to the Disk Use. * @param val double *****************************************************************************/ - public void evel_measurement_mem_use_memfree_set(MEASUREMENT_MEM_USE mem_use, - double val) + public void evel_measurement_disk_use_diskCommandsAvg_set(MEASUREMENT_DISK_USE disk_use, + double val) { EVEL_ENTER(); - mem_use.memfree.SetValuePr(val, "Memory freely available value"); + disk_use.diskCommandsAvg.SetValuePr(val,"Average number of commands per second"); EVEL_EXIT(); } - /**************************************************************************//** - * Set the part of the slab that can be reclaimed such as caches measured in kilobytes + * Set Total flush requests of the disk cache. + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param disk_use Pointer to the Disk Use. + * @param val double + *****************************************************************************/ + public void evel_measurement_disk_use_diskFlushRequests_set(MEASUREMENT_DISK_USE disk_use, + double val) + { + EVEL_ENTER(); + disk_use.diskFlushRequests.SetValuePr(val,"Total flush requests"); + EVEL_EXIT(); + } + /**************************************************************************//** + * Set Average number of read commands issued per second to the disk during the collection interval. + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * @param disk_use Pointer to the Disk Use. + * @param val double + *****************************************************************************/ + public void evel_measurement_disk_use_diskReadCommandsAvg_set(MEASUREMENT_DISK_USE disk_use, + double val) + { + EVEL_ENTER(); + disk_use.diskReadCommandsAvg.SetValuePr(val,"Average number of read commands issued per second to the disk during the collection interval."); + EVEL_EXIT(); + } + /**************************************************************************//** + * Set Total time spent on disk cache flushing in milliseconds. + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. * + * @param disk_use Pointer to the Disk Use. + * @param val double + *****************************************************************************/ + public void evel_measurement_disk_use_diskFlushTime_set(MEASUREMENT_DISK_USE disk_use, + double val) + { + EVEL_ENTER(); + disk_use.diskFlushTime.SetValuePr(val,"Total time spent on disk cache flushing in milliseconds."); + EVEL_EXIT(); + } + /**************************************************************************//** + * Set Total time spent on disk cache reads/writes in nanoseconds * @note The property is treated as immutable: it is only valid to call * the setter once. However, we don't assert if the caller tries to * overwrite, just ignoring the update instead. * - * @param mem_use Pointer to the Memory Use. + * @param disk_use Pointer to the Disk Use. * @param val double *****************************************************************************/ - public void evel_measurement_mem_use_slab_reclaimed_set(MEASUREMENT_MEM_USE mem_use, - double val) + public void evel_measurement_disk_use_diskTime_set(MEASUREMENT_DISK_USE disk_use, + double val) { EVEL_ENTER(); - mem_use.slabrecl.SetValuePr(val, "Memory reclaimable slab set"); + disk_use.diskTime.SetValuePr(val,"Total time spent on disk cache reads/writes in nanoseconds"); EVEL_EXIT(); } - /**************************************************************************//** - * Set the part of the slab that cannot be reclaimed such as caches measured in kilobytes - * + * Set The average amount of time taken for a read from the perspective of a Guest OS. This is the sum of Kernel Read Latency and Physical Device Read Latency. * @note The property is treated as immutable: it is only valid to call * the setter once. However, we don't assert if the caller tries to * overwrite, just ignoring the update instead. * - * @param mem_use Pointer to the Memory Use. + * @param disk_use Pointer to the Disk Use. * @param val double *****************************************************************************/ - public void evel_measurement_mem_use_slab_unreclaimable_set(MEASUREMENT_MEM_USE mem_use, - double val) + public void evel_measurement_disk_use_diskTotalReadLatencyAvg_set(MEASUREMENT_DISK_USE disk_use, + double val) { EVEL_ENTER(); - mem_use.slabunrecl.SetValuePr(val, "Memory unreclaimable slab set"); + disk_use.diskTotalReadLatencyAvg.SetValuePr(val,"The average amount of time taken for a read from the perspective of a Guest OS. This is the sum of Kernel Read Latency and Physical Device Read Latency."); EVEL_EXIT(); } - /**************************************************************************//** - * Set the total memory minus the sum of free, buffered, cached and slab memory in kilobytes + * Set The average amount of time taken for a write from the perspective of a Guest OS. This is the sum of Kernel Write Latency and Physical Device Write Latency. * * @note The property is treated as immutable: it is only valid to call * the setter once. However, we don't assert if the caller tries to * overwrite, just ignoring the update instead. * - * @param mem_use Pointer to the Memory Use. + * @param disk_use Pointer to the Disk Use. * @param val double *****************************************************************************/ - public void evel_measurement_mem_use_usedup_set(MEASUREMENT_MEM_USE mem_use, - double val) + public void evel_measurement_disk_use_diskTotalWriteLatencyAvg_set(MEASUREMENT_DISK_USE disk_use, + double val) { EVEL_ENTER(); - mem_use.memused.SetValuePr(val, "Memory usedup total set"); + disk_use.diskTotalWriteLatencyAvg.SetValuePr(val,"The average amount of time taken for a write from the perspective of a Guest OS. This is the sum of Kernel Write Latency and Physical Device Write Latency."); EVEL_EXIT(); } - /**************************************************************************//** - * Add an additional Disk usage value name/value pair to the Measurement. - * - * The name and value are null delimited ASCII strings. The library takes - * a copy so the caller does not have to preserve values after the function - * returns. + * Set Average number of write commands issued per second to the disk during the collection interval. + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. * - * - * @param id ASCIIZ string with the CPU's identifier. - * @param usage Disk utilization. + * @param disk_use Pointer to the Disk Use. + * @param val double *****************************************************************************/ - public MEASUREMENT_DISK_USE evel_measurement_new_disk_use_add(String id) + public void evel_measurement_disk_use_diskWriteCommandsAvg_set(MEASUREMENT_DISK_USE disk_use, + double val) { - MEASUREMENT_DISK_USE disk_use = null; EVEL_ENTER(); - - /***************************************************************************/ - /* Check assumptions. */ - /***************************************************************************/ - assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT); - assert(id != null); - - /***************************************************************************/ - /* Allocate a container for the value and push onto the list. */ - /***************************************************************************/ - LOGGER.debug(MessageFormatter.format("Adding id={0} disk usage", id)); - disk_use = new MEASUREMENT_DISK_USE(); - assert(disk_use != null); - disk_use.id = id; - assert(disk_use.id != null); - - disk_use.iotimeavg= new EvelOptionDouble(); - disk_use.iotimelast= new EvelOptionDouble(); - disk_use.iotimemax= new EvelOptionDouble(); - disk_use.iotimemin= new EvelOptionDouble(); - disk_use.mergereadavg= new EvelOptionDouble(); - disk_use.mergereadlast= new EvelOptionDouble(); - disk_use.mergereadmax= new EvelOptionDouble(); - disk_use.mergereadmin= new EvelOptionDouble(); - disk_use.mergewriteavg= new EvelOptionDouble(); - disk_use.mergewritelast= new EvelOptionDouble(); - disk_use.mergewritemax= new EvelOptionDouble(); - disk_use.mergewritemin= new EvelOptionDouble(); - disk_use.octetsreadavg= new EvelOptionDouble(); - disk_use.octetsreadlast= new EvelOptionDouble(); - disk_use.octetsreadmax= new EvelOptionDouble(); - disk_use.octetsreadmin= new EvelOptionDouble(); - disk_use.octetswriteavg= new EvelOptionDouble(); - disk_use.octetswritelast= new EvelOptionDouble(); - disk_use.octetswritemax= new EvelOptionDouble(); - disk_use.octetswritemin= new EvelOptionDouble(); - disk_use.opsreadavg= new EvelOptionDouble(); - disk_use.opsreadlast= new EvelOptionDouble(); - disk_use.opsreadmax= new EvelOptionDouble(); - disk_use.opsreadmin= new EvelOptionDouble(); - disk_use.opswriteavg= new EvelOptionDouble(); - disk_use.opswritelast= new EvelOptionDouble(); - disk_use.opswritemax= new EvelOptionDouble(); - disk_use.opswritemin= new EvelOptionDouble(); - disk_use.pendingopsavg= new EvelOptionDouble(); - disk_use.pendingopslast= new EvelOptionDouble(); - disk_use.pendingopsmax= new EvelOptionDouble(); - disk_use.pendingopsmin= new EvelOptionDouble(); - disk_use.timereadavg= new EvelOptionDouble(); - disk_use.timereadlast= new EvelOptionDouble(); - disk_use.timereadmax= new EvelOptionDouble(); - disk_use.timereadmin= new EvelOptionDouble(); - disk_use.timewriteavg= new EvelOptionDouble(); - disk_use.timewritelast= new EvelOptionDouble(); - disk_use.timewritemax= new EvelOptionDouble(); - disk_use.timewritemin= new EvelOptionDouble(); - - if( disk_usage == null ){ - disk_usage = new ArrayList(); - LOGGER.debug("Unable to allocate new disk usage"); - } - - - disk_usage.add(disk_use); - - + disk_use.diskWriteCommandsAvg.SetValuePr(val,"Average number of write commands issued per second to the disk during the collection interval."); EVEL_EXIT(); - return disk_use; } - /**************************************************************************//** * Set milliseconds spent doing input/output operations over 1 sec; treat * this metric as a device load percentage where 1000ms matches 100% load; @@ -1822,7 +4004,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param ephemeral_used Ephemeral storage in use. * @param ephemeral_iops Ephemeral storage IOPS. *****************************************************************************/ - public void evel_measurement_fsys_use_add( + public MEASUREMENT_FSYS_USE evel_measurement_fsys_use_add( String filesystem_name, double block_configured, double block_used, @@ -1868,6 +4050,8 @@ public class EvelScalingMeasurement extends EvelHeader { filesystem_usage.add(fsys_use); EVEL_EXIT(); + + return fsys_use; } /**************************************************************************//** @@ -1881,7 +4065,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param feature ASCIIZ string with the feature's name. * @param utilization Utilization of the feature. *****************************************************************************/ - public void evel_measurement_feature_use_add( + public MEASUREMENT_FEATURE_USE evel_measurement_feature_use_add( String feature, int utilization) { @@ -1913,6 +4097,7 @@ public class EvelScalingMeasurement extends EvelHeader { feature_usage.add(feature_use); EVEL_EXIT(); + return feature_use; } /**************************************************************************//** @@ -2013,7 +4198,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param codec ASCIIZ string with the codec's name. * @param utilization Number of codecs in use. *****************************************************************************/ - public void evel_measurement_codec_use_add( String codec, + public MEASUREMENT_CODEC_USE evel_measurement_codec_use_add( String codec, int utilization ) { MEASUREMENT_CODEC_USE codec_use = null; @@ -2043,6 +4228,8 @@ public class EvelScalingMeasurement extends EvelHeader { codec_usage.add(codec_use); EVEL_EXIT(); + + return codec_use; } @@ -2210,6 +4397,8 @@ public class EvelScalingMeasurement extends EvelHeader { latency_distribution.add(bucket); EVEL_EXIT(); + + } /**************************************************************************//** @@ -2222,7 +4411,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param high_end High end of the bucket's range. * @param count Count of events in this bucket. *****************************************************************************/ - public void evel_measurement_latency_add( + public MEASUREMENT_LATENCY_BUCKET evel_measurement_latency_add( double low_end, double high_end, int count) @@ -2240,29 +4429,31 @@ public class EvelScalingMeasurement extends EvelHeader { evel_meas_latency_bucket_add(bucket); EVEL_EXIT(); + + return bucket; } /**************************************************************************//** * Create a new vNIC Use to be added to a Measurement event. * - * @note The mandatory fields on the ::MEASUREMENT_VNIC_PERFORMANCE must be supplied + * @note The mandatory fields on the ::MEASUREMENT_NIC_PERFORMANCE must be supplied * to this factory function and are immutable once set. Optional * fields have explicit setter functions, but again values may only be - * set once so that the ::MEASUREMENT_VNIC_PERFORMANCE has immutable + * set once so that the ::MEASUREMENT_NIC_PERFORMANCE has immutable * properties. * * @param vnic_id ASCIIZ string with the vNIC's ID. * @param val_suspect True or false confidence in data. * - * @returns pointer to the newly manufactured ::MEASUREMENT_VNIC_PERFORMANCE. + * @returns pointer to the newly manufactured ::MEASUREMENT_NIC_PERFORMANCE. * If the structure is not used it must be released using * ::evel_measurement_free_vnic_performance. * @retval null Failed to create the vNIC Use. *****************************************************************************/ - public MEASUREMENT_VNIC_PERFORMANCE evel_measurement_new_vnic_performance(String vnic_id, - String val_suspect) + public MEASUREMENT_NIC_PERFORMANCE evel_measurement_new_vnic_performance(String vnic_id, + String val_suspect) { - MEASUREMENT_VNIC_PERFORMANCE vnic_perf=null; + MEASUREMENT_NIC_PERFORMANCE vnic_perf=null; EVEL_ENTER(); @@ -2276,11 +4467,14 @@ public class EvelScalingMeasurement extends EvelHeader { /* Allocate, then set Mandatory Parameters. */ /***************************************************************************/ - vnic_perf = new MEASUREMENT_VNIC_PERFORMANCE(); + vnic_perf = new MEASUREMENT_NIC_PERFORMANCE(); assert(vnic_perf != null); vnic_perf.vnic_id = vnic_id; vnic_perf.valuesaresuspect = val_suspect; + //VES6.0 added field 14July + //vnic_perf.nicIdentifier = nicIdentifier; + vnic_perf.recvd_bcast_packets_acc= new EvelOptionDouble(); vnic_perf.recvd_bcast_packets_delta= new EvelOptionDouble(); @@ -2311,6 +4505,19 @@ public class EvelScalingMeasurement extends EvelHeader { vnic_perf.tx_ucast_packets_acc= new EvelOptionDouble(); vnic_perf.tx_ucast_packets_delta= new EvelOptionDouble(); + + vnic_perf.administrativeState= new EvelOptionDouble(); + vnic_perf.operationalState= new EvelOptionDouble(); + vnic_perf.receivedPercentDiscard= new EvelOptionDouble(); + vnic_perf.receivedPercentError= new EvelOptionDouble(); + vnic_perf.receivedUtilization= new EvelOptionDouble(); + vnic_perf.speed= new EvelOptionString(); + vnic_perf.transmittedPercentDiscard= new EvelOptionDouble(); + vnic_perf.transmittedPercentError= new EvelOptionDouble(); + vnic_perf.transmittedUtilization= new EvelOptionDouble(); + + + LOGGER.debug("Adding "+vnic_perf+"VNIC ID="+ vnic_perf.vnic_id+"Value="+vnic_perf.valuesaresuspect); /***************************************************************************/ @@ -2334,7 +4541,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param recvd_bcast_packets_acc *****************************************************************************/ - public void evel_vnic_performance_rx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_rx_bcast_pkt_acc_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double recvd_bcast_packets_acc) { EVEL_ENTER(); @@ -2362,7 +4569,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param recvd_bcast_packets_delta *****************************************************************************/ - public void evel_vnic_performance_rx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_rx_bcast_pkt_delta_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double recvd_bcast_packets_delta) { EVEL_ENTER(); @@ -2391,7 +4598,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param recvd_discard_packets_acc *****************************************************************************/ - public void evel_vnic_performance_rx_discard_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_rx_discard_pkt_acc_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double recvd_discard_packets_acc) { EVEL_ENTER(); @@ -2419,7 +4626,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param recvd_discard_packets_delta *****************************************************************************/ - public void evel_vnic_performance_rx_discard_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_rx_discard_pkt_delta_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double recvd_discard_packets_delta) { EVEL_ENTER(); @@ -2448,7 +4655,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param recvd_error_packets_acc *****************************************************************************/ - public void evel_vnic_performance_rx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_rx_error_pkt_acc_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double recvd_error_packets_acc) { EVEL_ENTER(); @@ -2476,7 +4683,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param recvd_error_packets_delta *****************************************************************************/ - public void evel_vnic_performance_rx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_rx_error_pkt_delta_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double recvd_error_packets_delta) { EVEL_ENTER(); @@ -2504,7 +4711,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param recvd_mcast_packets_acc *****************************************************************************/ - public void evel_vnic_performance_rx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_rx_mcast_pkt_acc_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double recvd_mcast_packets_acc) { EVEL_ENTER(); @@ -2532,7 +4739,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param recvd_mcast_packets_delta *****************************************************************************/ - public void evel_vnic_performance_rx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_rx_mcast_pkt_delta_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double recvd_mcast_packets_delta) { EVEL_ENTER(); @@ -2560,7 +4767,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param recvd_octets_acc *****************************************************************************/ - public void evel_vnic_performance_rx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_rx_octets_acc_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double recvd_octets_acc) { EVEL_ENTER(); @@ -2588,7 +4795,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param recvd_octets_delta *****************************************************************************/ - public void evel_vnic_performance_rx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_rx_octets_delta_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double recvd_octets_delta) { EVEL_ENTER(); @@ -2616,7 +4823,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param recvd_total_packets_acc *****************************************************************************/ - public void evel_vnic_performance_rx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_rx_total_pkt_acc_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double recvd_total_packets_acc) { EVEL_ENTER(); @@ -2644,7 +4851,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param recvd_total_packets_delta *****************************************************************************/ - public void evel_vnic_performance_rx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_rx_total_pkt_delta_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double recvd_total_packets_delta) { EVEL_ENTER(); @@ -2672,7 +4879,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param recvd_ucast_packets_acc *****************************************************************************/ - public void evel_vnic_performance_rx_ucast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_rx_ucast_pkt_acc_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double recvd_ucast_packets_acc) { EVEL_ENTER(); @@ -2700,7 +4907,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param recvd_ucast_packets_delta *****************************************************************************/ - public void evel_vnic_performance_rx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_rx_ucast_pkt_delta_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double recvd_ucast_packets_delta) { EVEL_ENTER(); @@ -2728,7 +4935,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param tx_bcast_packets_acc *****************************************************************************/ - public void evel_vnic_performance_tx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_tx_bcast_pkt_acc_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double tx_bcast_packets_acc) { EVEL_ENTER(); @@ -2756,7 +4963,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param tx_bcast_packets_delta *****************************************************************************/ - public void evel_vnic_performance_tx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_tx_bcast_pkt_delta_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double tx_bcast_packets_delta) { EVEL_ENTER(); @@ -2784,7 +4991,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param tx_discarded_packets_acc *****************************************************************************/ - public void evel_vnic_performance_tx_discarded_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_tx_discarded_pkt_acc_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double tx_discarded_packets_acc) { EVEL_ENTER(); @@ -2812,7 +5019,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param tx_discarded_packets_delta *****************************************************************************/ - public void evel_vnic_performance_tx_discarded_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_tx_discarded_pkt_delta_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double tx_discarded_packets_delta) { EVEL_ENTER(); @@ -2840,7 +5047,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param tx_error_packets_acc *****************************************************************************/ - public void evel_vnic_performance_tx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_tx_error_pkt_acc_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double tx_error_packets_acc) { EVEL_ENTER(); @@ -2868,7 +5075,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param tx_error_packets_delta *****************************************************************************/ - public void evel_vnic_performance_tx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_tx_error_pkt_delta_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double tx_error_packets_delta) { EVEL_ENTER(); @@ -2896,7 +5103,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param tx_mcast_packets_acc *****************************************************************************/ - public void evel_vnic_performance_tx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_tx_mcast_pkt_acc_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double tx_mcast_packets_acc) { EVEL_ENTER(); @@ -2924,7 +5131,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param tx_mcast_packets_delta *****************************************************************************/ - public void evel_vnic_performance_tx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_tx_mcast_pkt_delta_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double tx_mcast_packets_delta) { EVEL_ENTER(); @@ -2952,7 +5159,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param tx_octets_acc *****************************************************************************/ - public void evel_vnic_performance_tx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_tx_octets_acc_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double tx_octets_acc) { EVEL_ENTER(); @@ -2980,7 +5187,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param tx_octets_delta *****************************************************************************/ - public void evel_vnic_performance_tx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_tx_octets_delta_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double tx_octets_delta) { EVEL_ENTER(); @@ -3009,7 +5216,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param tx_total_packets_acc *****************************************************************************/ - public void evel_vnic_performance_tx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_tx_total_pkt_acc_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double tx_total_packets_acc) { EVEL_ENTER(); @@ -3037,7 +5244,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param tx_total_packets_delta *****************************************************************************/ - public void evel_vnic_performance_tx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_tx_total_pkt_delta_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double tx_total_packets_delta) { EVEL_ENTER(); @@ -3066,7 +5273,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param tx_ucast_packets_acc *****************************************************************************/ - public void evel_vnic_performance_tx_ucast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_tx_ucast_pkt_acc_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double tx_ucast_packets_acc) { EVEL_ENTER(); @@ -3094,7 +5301,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use. * @param tx_ucast_packets_delta *****************************************************************************/ - public void evel_vnic_performance_tx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE vnic_performance, + public void evel_vnic_performance_tx_ucast_pkt_delta_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, double tx_ucast_packets_delta) { EVEL_ENTER(); @@ -3110,6 +5317,159 @@ public class EvelScalingMeasurement extends EvelHeader { EVEL_EXIT(); } + + /* + * VES6.0 UPDATE 19JULY + */ + + public void evel_vnic_performance_administrativeState_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, + double administrativeState) + { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(administrativeState >= 0.0); + + vnic_performance.administrativeState.SetValuePr( + administrativeState,"Administrative State"); + + EVEL_EXIT(); + } + + + + public void evel_vnic_performance_operationalState_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, + double operationalState) + { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(operationalState >= 0.0); + + vnic_performance.operationalState.SetValuePr( + operationalState,"operational State"); + + EVEL_EXIT(); + } + + public void evel_vnic_performance_receivedPercentDiscard_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, + double receivedPercentDiscard) + { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(receivedPercentDiscard >= 0.0); + + vnic_performance.receivedPercentDiscard.SetValuePr( + receivedPercentDiscard,"Received Percent Discard"); + + EVEL_EXIT(); + } + + public void evel_vnic_performance_receivedPercentError_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, + double receivedPercentError) + { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(receivedPercentError >= 0.0); + + vnic_performance.receivedPercentError.SetValuePr( + receivedPercentError,"Received Percent Error"); + + EVEL_EXIT(); + } + + public void evel_vnic_performance_receivedUtilization_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, + double receivedUtilization) + { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(receivedUtilization >= 0.0); + + vnic_performance.receivedUtilization.SetValuePr( + receivedUtilization,"Received Utilization"); + + EVEL_EXIT(); + } + + public void evel_vnic_performance_speed_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, + String speed) + { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(speed != null); + + vnic_performance.speed.SetValuePr( + speed,"Speed"); + + EVEL_EXIT(); + } + + public void evel_vnic_performance_transmittedPercentDiscard_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, + double transmittedPercentDiscard) + { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(transmittedPercentDiscard >= 0.0); + + vnic_performance.transmittedPercentDiscard.SetValuePr( + transmittedPercentDiscard,"Transmitted Percent Discard"); + + EVEL_EXIT(); + } + + public void evel_vnic_performance_transmittedPercentError_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, + double transmittedPercentError) + { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(transmittedPercentError >= 0.0); + + vnic_performance.transmittedPercentError.SetValuePr( + transmittedPercentError,"Transmitted Percent Error"); + + EVEL_EXIT(); + } + + public void evel_vnic_performance_transmittedUtilization_set(MEASUREMENT_NIC_PERFORMANCE vnic_performance, + double transmittedUtilization) + { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(transmittedUtilization >= 0.0); + + vnic_performance.transmittedUtilization.SetValuePr( + transmittedUtilization,"transmittedUtilization"); + + EVEL_EXIT(); + } + + + /**************************************************************************//** @@ -3119,7 +5479,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @param vnic_performance Pointer to the vNIC Use to add. *****************************************************************************/ public void evel_meas_vnic_performance_add( - MEASUREMENT_VNIC_PERFORMANCE vnic_performance) + MEASUREMENT_NIC_PERFORMANCE vnic_performance) { EVEL_ENTER(); @@ -3131,7 +5491,7 @@ public class EvelScalingMeasurement extends EvelHeader { assert(vnic_performance != null); if( vnic_usage == null ){ - vnic_usage = new ArrayList(); + vnic_usage = new ArrayList(); LOGGER.debug("Allocate new file system usage"); } @@ -3183,6 +5543,9 @@ public class EvelScalingMeasurement extends EvelHeader { public void evel_measurement_vnic_performance_add( String vnic_id, String valset, + //VES6.0 added field 14July + //String nicIdentifier, + String speed, double recvd_bcast_packets_acc, double recvd_bcast_packets_delta, double recvd_discarded_packets_acc, @@ -3210,14 +5573,26 @@ public class EvelScalingMeasurement extends EvelHeader { double tx_total_packets_acc, double tx_total_packets_delta, double tx_ucast_packets_acc, - double tx_ucast_packets_delta) + double tx_ucast_packets_delta, + //VES6.0 addded fileds 19July + double administrativeState, + double operationalState, + double receivedPercentDiscard, + double receivedPercentError, + double receivedUtilization, + + double transmittedPercentDiscard, + double transmittedPercentError, + double transmittedUtilization + ) { - MEASUREMENT_VNIC_PERFORMANCE vnic_performance = null; + MEASUREMENT_NIC_PERFORMANCE vnic_performance = null; EVEL_ENTER(); /***************************************************************************/ /* Trust the assertions in the underlying methods. */ /***************************************************************************/ + //VES6.0 added field 14July vnic_performance = evel_measurement_new_vnic_performance(vnic_id, valset); evel_vnic_performance_rx_bcast_pkt_acc_set(vnic_performance, recvd_bcast_packets_acc); @@ -3249,8 +5624,23 @@ public class EvelScalingMeasurement extends EvelHeader { evel_vnic_performance_tx_ucast_pkt_acc_set(vnic_performance, tx_ucast_packets_acc); evel_vnic_performance_tx_ucast_pkt_delta_set(vnic_performance, tx_ucast_packets_delta); + //VES6.0 added fields 19July + + evel_vnic_performance_administrativeState_set(vnic_performance, administrativeState); + evel_vnic_performance_operationalState_set(vnic_performance, operationalState); + evel_vnic_performance_receivedPercentDiscard_set(vnic_performance, receivedPercentDiscard); + evel_vnic_performance_receivedPercentError_set(vnic_performance, receivedPercentError); + evel_vnic_performance_receivedUtilization_set(vnic_performance, receivedUtilization); + evel_vnic_performance_speed_set(vnic_performance, speed); + evel_vnic_performance_transmittedPercentDiscard_set(vnic_performance, transmittedPercentDiscard); + evel_vnic_performance_transmittedPercentError_set(vnic_performance, transmittedPercentError); + evel_vnic_performance_transmittedUtilization_set(vnic_performance, transmittedUtilization); + + + + if( vnic_usage == null ){ - vnic_usage = new ArrayList(); + vnic_usage = new ArrayList(); LOGGER.debug("Allocate new file system usage"); } @@ -3292,6 +5682,7 @@ public class EvelScalingMeasurement extends EvelHeader { * * @retval JSON Object of Scaling Measurement event *****************************************************************************/ + @SuppressWarnings("null") JsonObjectBuilder evelScalingMeasurementObject() { MEASUREMENT_CPU_USE cpu_use = null; @@ -3299,17 +5690,36 @@ public class EvelScalingMeasurement extends EvelHeader { MEASUREMENT_DISK_USE disk_use = null; MEASUREMENT_FSYS_USE fsys_use = null; MEASUREMENT_LATENCY_BUCKET bucket = null; - MEASUREMENT_VNIC_PERFORMANCE vnic_use = null; + MEASUREMENT_NIC_PERFORMANCE nic_use = null; MEASUREMENT_FEATURE_USE feature_use = null; MEASUREMENT_CODEC_USE codec_use = null; MEASUREMENT_GROUP meas_group = null; CUSTOM_MEASUREMENT custom_meas = null; + + MEASUREMENT_IPMI ipmij = null; + MEASUREMENT_LOAD load = null; + MEASUREMENT_PROCESS_STATS process_stats = null; + MACHINE_CHECK_EXCEPTION check_exception = null; + + MEASUREMENT_HUGE_PAGE hugePage = null; + + + MEASUREMENT_IPMI_PROCESSOR ipmiProcessorJson = null; + IPMIglobalAggregateTemperatureMargin ipmiGlobalAggTempMarginJson; + Processor_DIMMaggregate_Thermal_Margin ipmiProcessorDIMMagregatejson = null; + IPMIpowerSupply ipmiPowerSupplyJson; + IPMIbattery ipmiBatteryJson; + IPMINIC ipmiNicJson; + IPMIHSBP ipmiHsbpJson; + IPMIbaseboardTemperature ipmiBaseBoardTempJson; + IPMIbaseboardvoltageResulator ipmiBaseboardVoltageResultatorJson; + IPMIfan ipmifanjson; //DLIST_ITEM item = null; //DLIST_ITEM nested_item = null; //DLIST_ITEM addl_info_item = null; //OTHER_FIELD addl_info = null; - double version = major_version+(double)minor_version/10; - +// double version = major_version+(double)minor_version/10; + String version = "4.0"; EVEL_ENTER(); /***************************************************************************/ @@ -3327,26 +5737,143 @@ public class EvelScalingMeasurement extends EvelHeader { /* Optional fields. */ /***************************************************************************/ // additional fields - if( additional_info != null ) - { - JsonArrayBuilder builder = Json.createArrayBuilder(); - for(int i=0;i> it = additional_inf.entrySet().iterator(); + while(it.hasNext()) { + Map.Entry add_inf = (Map.Entry)it.next(); + String addl_info_key = add_inf.getKey(); + String addl_info_value = add_inf.getValue(); +// JsonObject obj1 = Json.createObjectBuilder() +// .add("name", addl_info_key) +// .add("value", addl_info_value).build(); + builder.add(addl_info_key, addl_info_value); + } + evelmeasmt.add("additionalFields", builder); + } // TBD additional json objects if( concurrent_sessions.is_set ) evelmeasmt.add("concurrentSessions", concurrent_sessions.GetValue()); if( configured_entities.is_set ) evelmeasmt.add("configuredEntities", configured_entities.GetValue()); - + /******************************************************************************* + * MEASUREMENT Load + *******************************************************************************/ + if(loads != null && loads.size() >0) { + JsonArrayBuilder builder = Json.createArrayBuilder(); + for(int i=0;i0) { + + JsonArrayBuilder builder = Json.createArrayBuilder(); + for(int i=0;i0) { + JsonArrayBuilder builder = Json.createArrayBuilder(); + for(int i=0;i0) { + JsonArrayBuilder builder = Json.createArrayBuilder(); + for(int i=0;i 0) { + JsonObjectBuilder builder1 = Json.createObjectBuilder(); + JsonArrayBuilder builder = Json.createArrayBuilder(); + System.out.println("ipmis size---"+ ipmis.size()); + for(int i=0;i 0 ) { + JsonArrayBuilder ipmi_processor_builder = Json.createArrayBuilder(); + for(int j=0; j 0) { + JsonArrayBuilder ipmi_procesor_DTS_thermal_margin = Json.createArrayBuilder(); + for( int k=0 ;k0) { + + JsonArrayBuilder ipmi_global_aggregate_tepmerature_margin_array = Json.createArrayBuilder(); + for(int j=0; j0) { + + JsonArrayBuilder ipmi_power_supply_array = Json.createArrayBuilder(); + for(int j=0; j0) { + + JsonArrayBuilder ipmi_battery_array = Json.createArrayBuilder(); + for(int j=0; j0) { + + JsonArrayBuilder ipmi_Nic_array = Json.createArrayBuilder(); + for(int j=0; j0) { + + JsonArrayBuilder ipmi_HSBP_array = Json.createArrayBuilder(); + for(int j=0; j0) { + + JsonArrayBuilder ipmi_baseboard_Temperature_array = Json.createArrayBuilder(); + for(int j=0; j0) { + + JsonArrayBuilder ipmi_Baseboardvoltage_Resulator = Json.createArrayBuilder(); + for(int j=0; j0) { + + JsonArrayBuilder ipmi_Fan = Json.createArrayBuilder(); + for(int j=0; j 0 ) { - JsonArrayBuilder builder = Json.createArrayBuilder(); + JsonObjectBuilder builder = Json.createObjectBuilder(); + // JsonArrayBuilder builder = Json.createArrayBuilder(); for(int i=0;i 0 ) { - JsonArrayBuilder builder = Json.createArrayBuilder(); + //JsonObjectBuilder builder = Json.createObjectBuilder(); + JsonArrayBuilder builder = Json.createArrayBuilder(); for(int i=0;i additional_info; + // ArrayList additional_info; + HashMap additional_inf; private static final Logger LOGGER = Logger.getLogger( EvelStateChange.class.getName() ); @@ -94,7 +100,7 @@ public class EvelStateChange extends EvelHeader { old_state = oldstate; state_interface = interfce; - additional_info = null; + additional_inf = null; } /**************************************************************************//** @@ -123,18 +129,18 @@ public class EvelStateChange extends EvelHeader { assert(name != null); assert(value != null); - if( additional_info == null ) + if( additional_inf == null ) { - additional_info = new ArrayList(); + additional_inf = new HashMap<>(); } LOGGER.debug(MessageFormat.format("Adding name={0} value={1}", name, value)); - addl_info = new String[2]; - assert(addl_info != null); - addl_info[0] = name; - addl_info[1] = value; - - additional_info.add(addl_info); + // addl_info = new String[2]; + // assert(addl_info != null); + // addl_info[0] = name; + // addl_info[1] = value; + additional_inf.put(name, value); + // additional_info.add(addl_info); EVEL_EXIT(); } @@ -185,8 +191,8 @@ public class EvelStateChange extends EvelHeader { { String nstate; String ostate; - double version = major_version+(double)minor_version/10; - + //double version = major_version+(double)minor_version/10; + String version = "4.0"; EVEL_ENTER(); @@ -213,7 +219,7 @@ public class EvelStateChange extends EvelHeader { /***************************************************************************/ /* Optional additional information */ /***************************************************************************/ - if( additional_info != null ) + /* if( additional_info != null ) { JsonArrayBuilder builder = Json.createArrayBuilder(); for(int i=0;i> it = additional_inf.entrySet().iterator(); + while(it.hasNext()) { + Map.Entry add_inf = (Map.Entry)it.next(); + String addl_info_key = add_inf.getKey(); + String addl_info_value = add_inf.getValue(); +// JsonObject obj1 = Json.createObjectBuilder() +// .add("name", addl_info_key) +// .add("value", addl_info_value).build(); + builder.add(addl_info_key, addl_info_value); + } + evelstate.add("additionalFields", builder); } EVEL_EXIT(); diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelSyslog.java b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelSyslog.java index 1bdcaf0..a1bd94b 100644 --- a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelSyslog.java +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelSyslog.java @@ -24,6 +24,10 @@ package evel_javalibrary.att.com; import java.text.MessageFormat; import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; import javax.json.Json; import javax.json.JsonArrayBuilder; @@ -100,6 +104,9 @@ public class EvelSyslog extends EvelHeader { EvelOptionString syslog_severity; double syslog_fver; EvelOptionInt syslog_ver; + EvelOptionString syslogmsg_host; + + HashMap additional_inf; private static final Logger LOGGER = Logger.getLogger( EvelSyslog.class.getName() ); @@ -137,6 +144,10 @@ public class EvelSyslog extends EvelHeader { syslog_s_data = new EvelOptionString(); syslog_sdid = new EvelOptionString(); syslog_severity = new EvelOptionString(); + + syslogmsg_host = new EvelOptionString(); + + additional_inf =null; } /**************************************************************************//** @@ -158,6 +169,44 @@ public class EvelSyslog extends EvelHeader { EVEL_EXIT(); } + + //VES 7.O added 4Sept2018 + /**************************************************************************//** + * Add an additional value name/value pair to the Syslog. + * + * The name and value are null delimited ASCII strings. The library takes + * a copy so the caller does not have to preserve values after the function + * returns. + * + * + * @param name ASCIIZ string with the attribute's name. The caller + * does not need to preserve the value once the function + * returns. + * @param value ASCIIZ string with the attribute's value. The caller + * does not need to preserve the value once the function + * returns. + *****************************************************************************/ + public void evel__syslog_addl_info_add(String name, String value) + { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_SYSLOG); + assert(name != null); + assert(value != null); + + if( additional_inf == null ) + { + additional_inf = new HashMap<>(); + } + + LOGGER.debug(MessageFormat.format("Adding name={0} value={1}", name, value)); + additional_inf.put(name, value); + + EVEL_EXIT(); + } /**************************************************************************//** * Add an additional value name/value pair to the Syslog. @@ -174,7 +223,7 @@ public class EvelSyslog extends EvelHeader { * does not need to preserve the value once the function * returns. *****************************************************************************/ - public void evel_syslog_addl_filter_set(String filter) + public void evel_syslog_addl_filter_set(String filter) { EVEL_ENTER(); @@ -190,6 +239,36 @@ public class EvelSyslog extends EvelHeader { EVEL_EXIT(); } + + + + /**************************************************************************//** + * Set the Event Source Host property of the Syslog. + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * + * @param host The Event Source Host to be set. ASCIIZ string. The caller + * does not need to preserve the value once the function + * returns. + *****************************************************************************/ + public void evel_syslog_priority_set(int priority) + { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_SYSLOG); + assert(priority > 0); + + syslog_priority.SetValuePr( + priority, + "Priority"); + EVEL_EXIT(); + } /**************************************************************************//** * Set the Event Source Host property of the Syslog. @@ -355,6 +434,37 @@ public class EvelSyslog extends EvelHeader { "Structured Data"); EVEL_EXIT(); } + + + /**************************************************************************//** + * Set the Structured SDID property of the Syslog. + * + * @note The property is treated as immutable: it is only valid to call + * the setter once. However, we don't assert if the caller tries to + * overwrite, just ignoring the update instead. + * + * + * @param sdid The Structured Data to be set. ASCIIZ string. name@number + * Caller does not need to preserve the value once the function + * returns. + *****************************************************************************/ + public void evel_syslog_msghost_set(String msghost) + { + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_SYSLOG); + assert(msghost != null); + + syslogmsg_host.SetValuePr( + msghost, + "SysLog msg log"); + EVEL_EXIT(); + } + + /**************************************************************************//** * Set the Structured SDID property of the Syslog. @@ -425,8 +535,8 @@ public class EvelSyslog extends EvelHeader { JsonObjectBuilder evelSyslogObject() { String evt_source_type; - double version = major_version+(double)minor_version/10; - + // double version = major_version+(double)minor_version/10; + String version = "4.0"; EVEL_ENTER(); assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_SYSLOG); @@ -435,7 +545,7 @@ public class EvelSyslog extends EvelHeader { /* Mandatory fields */ /***************************************************************************/ JsonObjectBuilder obj = Json.createObjectBuilder() - .add("eventSourceType", EvelFault.evel_source_type(event_source_type)) + .add("eventSourceType", event_source_type.toString()) .add("syslogMsg", syslog_msg) .add("syslogTag", syslog_tag) .add("syslogFieldsVersion",version); @@ -452,6 +562,25 @@ public class EvelSyslog extends EvelHeader { syslog_sdid.encJsonValue(obj, "syslogSdId"); syslog_severity.encJsonValue(obj, "syslogSev"); syslog_ver.encJsonValue(obj, "syslogVer"); + syslogmsg_host.encJsonValue(obj, "syslogMsgHost"); + + + if(additional_inf != null) { + //JsonArrayBuilder builder = Json.createArrayBuilder(); + JsonObjectBuilder builder = Json.createObjectBuilder(); + Iterator> it = additional_inf.entrySet().iterator(); + while(it.hasNext()) { + Map.Entry add_inf = (Map.Entry)it.next(); + String addl_info_key = add_inf.getKey(); + String addl_info_value = add_inf.getValue(); +// JsonObject obj1 = Json.createObjectBuilder() +// .add("name", addl_info_key) +// .add("value", addl_info_value).build(); + builder.add(addl_info_key, addl_info_value); + } + obj.add("additionalFields", builder); + } + EVEL_EXIT(); diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelThresholdCross.java b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelThresholdCross.java index 9d28b4a..11a6f83 100644 --- a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelThresholdCross.java +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelThresholdCross.java @@ -25,6 +25,10 @@ package evel_javalibrary.att.com; import java.text.MessageFormat; import java.util.ArrayList; import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; import javax.json.Json; import javax.json.JsonArrayBuilder; @@ -33,6 +37,7 @@ import javax.json.JsonObjectBuilder; import org.apache.log4j.Logger; +import evel_javalibrary.att.com.EvelHeader.PRIORITIES; import evel_javalibrary.att.com.EvelMobileFlow.MOBILE_GTP_PER_FLOW_METRICS; @@ -58,7 +63,8 @@ public class EvelThresholdCross extends EvelHeader { EVEL_ELEMENT_ANOMALY, EVEL_INTERFACE_ANOMALY, EVEL_SERVICE_ANOMALY, - EVEL_MAX_ANOMALY + EVEL_MAX_ANOMALY, + } public enum EVEL_SEVERITIES{ @@ -80,6 +86,10 @@ public class EvelThresholdCross extends EvelHeader { String name; String thresholdCrossed; String value; + + + Map hashMap; + } PERF_COUNTER additionalParameters; @@ -94,7 +104,10 @@ public class EvelThresholdCross extends EvelHeader { /***************************************************************************/ /* Optional fields */ /***************************************************************************/ - ArrayList additional_info; + //ArrayList additional_info; + Map additional_inf; + + EvelOptionString alertValue; ArrayList alertidList; EvelOptionString dataCollector; @@ -102,7 +115,9 @@ public class EvelThresholdCross extends EvelHeader { EvelOptionString interfaceName; EvelOptionString networkService; EvelOptionString possibleRootCause; - + + + private static final Logger LOGGER = Logger.getLogger( EvelThresholdCross.class.getName() ); @@ -123,9 +138,9 @@ public class EvelThresholdCross extends EvelHeader { *****************************************************************************/ public EvelThresholdCross( String evname,String evid, String tcriticality, - String tname, + //String tname, String tthresholdCrossed, - String tvalue, + //String tvalue, EVEL_EVENT_ACTION talertAction, String talertDescription, EVEL_ALERT_TYPE talertType, @@ -136,18 +151,22 @@ public class EvelThresholdCross extends EvelHeader { super(evname,evid); event_domain = EvelHeader.DOMAINS.EVEL_DOMAIN_THRESHOLD_CROSSING; assert( tcriticality!= null ); - assert( tname!= null ); + // assert( tname!= null ); assert( tthresholdCrossed!= null ); - assert( tvalue!= null ); + // assert( tvalue!= null ); assert( talertAction!= null ); additionalParameters = new PERF_COUNTER(); assert( additionalParameters != null); additionalParameters.criticality = tcriticality; - additionalParameters.name = tname; + // additionalParameters.name = tname; additionalParameters.thresholdCrossed = tthresholdCrossed; - additionalParameters.value = tvalue; + // additionalParameters.value = tvalue; + + + additionalParameters.hashMap = null; + alertAction = talertAction; alertDescription = talertDescription; alertType = talertType; @@ -155,7 +174,7 @@ public class EvelThresholdCross extends EvelHeader { eventSeverity = teventSeverity; eventStartTimestamp = teventStartTimestamp; - additional_info = null; + additional_inf = null; alertValue = new EvelOptionString(); alertidList = null; dataCollector = new EvelOptionString(); @@ -213,6 +232,7 @@ public class EvelThresholdCross extends EvelHeader { LOGGER.debug(MessageFormat.format("Adding alertid={0}", alertid)); alertidList.add(new String(alertid)); + EVEL_EXIT(); } @@ -232,7 +252,7 @@ public class EvelThresholdCross extends EvelHeader { *****************************************************************************/ public void evel_thresholdcross_addl_info_add(String name, String value) { - String[] addl_info = null; + //String[] addl_info = null; EVEL_ENTER(); /***************************************************************************/ @@ -242,22 +262,68 @@ public class EvelThresholdCross extends EvelHeader { assert(name != null); assert(value != null); - if( additional_info == null ) + if( additional_inf == null ) { - additional_info = new ArrayList(); + // additional_info = new ArrayList(); + additional_inf = new HashMap(); } LOGGER.debug(MessageFormat.format("Adding name={0} value={1}", name, value)); - addl_info = new String[2]; - assert(addl_info != null); - addl_info[0] = name; - addl_info[1] = value; + // addl_info = new String[2]; + // assert(addl_info != null); + // addl_info[0] = name; + // addl_info[1] = value; + additional_inf.put(name, value); + // additional_info.add(addl_info); + + EVEL_EXIT(); + } + + + + /**************************************************************************//** + * Add an optional additional value name/value pair to the Alert. + * + * The name and value are null delimited ASCII strings. The library takes + * a copy so the caller does not have to preserve values after the function + * returns. + * @param name ASCIIZ string with the attribute's name. The caller + * does not need to preserve the value once the function + * returns. + * @param value ASCIIZ string with the attribute's value. The caller + * does not need to preserve the value once the function + * returns. + *****************************************************************************/ + public void evel_thresholdcross_hashMap_add(String name, String value) + { + //String[] addl_info = null; + EVEL_ENTER(); + + /***************************************************************************/ + /* Check preconditions. */ + /***************************************************************************/ + assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_THRESHOLD_CROSSING); + assert(name != null); + assert(value != null); + + if( additionalParameters.hashMap == null ) + { + // additional_info = new ArrayList(); + additionalParameters.hashMap = new HashMap(); + } - additional_info.add(addl_info); + LOGGER.debug(MessageFormat.format("Adding name={0} value={1}", name, value)); + // addl_info = new String[2]; + // assert(addl_info != null); + // addl_info[0] = name; + // addl_info[1] = value; + additionalParameters.hashMap.put(name, value); + // additional_info.add(addl_info); EVEL_EXIT(); } + /**************************************************************************//** * Set the TCA probable Root cause. @@ -392,8 +458,118 @@ public class EvelThresholdCross extends EvelHeader { "Alert value"); EVEL_EXIT(); } + + + String evel_alerType(EVEL_ALERT_TYPE alerType) + { + String result; + + EVEL_ENTER(); + + switch (alerType) + { + case EVEL_CARD_ANOMALY: + result = "CARD-ANOMALY"; + break; + + case EVEL_ELEMENT_ANOMALY: + result = "ELEMENT-ANOMALY"; + break; + + case EVEL_SERVICE_ANOMALY: + result = "INTERFACE-ANOMALY"; + break; + case EVEL_MAX_ANOMALY: + result = "SERVICE-ANOMALY"; + break; + + default: + result = null; + + } + + EVEL_EXIT(); + + return result; + } + + String evel_alertAction(EVEL_EVENT_ACTION alertAction) + { + String result; + + EVEL_ENTER(); + + switch (alertAction) + { + case EVEL_EVENT_ACTION_CLEAR: + result = "CLEAR"; + break; + + case EVEL_EVENT_ACTION_CONTINUE: + result = "CONT"; + break; + + case EVEL_EVENT_ACTION_SET: + result = "SET"; + break; + + case EVEL_MAX_EVENT_ACTION: + result = "ACTION"; + break; + + default: + result = null; + + } + + EVEL_EXIT(); + + return result; + } + + + String eventSeverity(EVEL_SEVERITIES eventSeverity) + { + String result; + + EVEL_ENTER(); + + + + switch (eventSeverity) + { + case EVEL_SEVERITY_CRITICAL: + result = "CRITICAL"; + break; + + case EVEL_SEVERITY_MAJOR: + result = "MAJOR"; + break; + + case EVEL_SEVERITY_WARNING: + result = "WARNING"; + break; + + case EVEL_SEVERITY_NORMAL: + result = "NORMAL"; + break; + + case EVEL_MAX_SEVERITIES: + result = "MINOR"; + break; + + default: + result = null; + + } + + EVEL_EXIT(); + + return result; + } + /**************************************************************************//** * Encode the fault in JSON according to AT&T's schema for the TC ALert type. * @@ -401,10 +577,13 @@ public class EvelThresholdCross extends EvelHeader { *****************************************************************************/ JsonObjectBuilder evelThresholdCrossingObject() { - double version = major_version+(double)minor_version/10; - + // double version = major_version+(double)minor_version/10; + String version = "4.0"; EVEL_ENTER(); - + + String actionAlert = evel_alertAction(alertAction); + String typeAlert = evel_alerType(alertType); + String severityEvent = eventSeverity(eventSeverity); /***************************************************************************/ /* Check preconditions. */ @@ -415,60 +594,109 @@ public class EvelThresholdCross extends EvelHeader { /* Mandatory fields. */ /***************************************************************************/ //encode counter + JsonArrayBuilder counterobjArray = Json.createArrayBuilder(); JsonObjectBuilder counterobj = Json.createObjectBuilder() .add( "criticality",additionalParameters.criticality) - .add( "name", additionalParameters.name) - .add( "thresholdCrossed",additionalParameters.thresholdCrossed) - .add( "value", additionalParameters.value); +// .add( "name", additionalParameters.name) + .add( "thresholdCrossed",additionalParameters.thresholdCrossed); +// .add( "value", additionalParameters.value); + + + if(additionalParameters.hashMap != null) { + JsonObjectBuilder builder = Json.createObjectBuilder(); + Iterator> it = additionalParameters.hashMap.entrySet().iterator(); + while(it.hasNext()) { + Map.Entry add_inf = (Map.Entry)it.next(); + String addl_info_key = add_inf.getKey(); + String addl_info_value = add_inf.getValue(); +// JsonObject obj1 = Json.createObjectBuilder() +// .add("name", addl_info_key) +// .add("value", addl_info_value).build(); + builder.add(addl_info_key, addl_info_value); + } + counterobj.add("hashMap", builder); + + counterobjArray.add(counterobj); + } + JsonObjectBuilder evelrep = Json.createObjectBuilder() - .add("additionalParameters", counterobj) - .add("alertAction", alertAction.toString()) + .add("additionalParameters", counterobjArray) + .add("alertAction", actionAlert) .add("alertDescription", alertDescription) - .add("alertType", alertType.toString()) + .add("alertType", typeAlert) .add("collectionTimestamp", collectionTimestamp.toString()) - .add("eventSeverity",eventSeverity.toString()) + .add("eventSeverity",severityEvent) .add("eventStartTimestamp",eventStartTimestamp.toString()); /***************************************************************************/ /* Optional fields. */ /***************************************************************************/ alertValue.encJsonValue(evelrep, "alertValue"); + + + dataCollector.encJsonValue(evelrep, "dataCollector"); + elementType.encJsonValue(evelrep, "elementType"); + interfaceName.encJsonValue(evelrep, "interfaceName"); + networkService.encJsonValue(evelrep, "networkService"); + possibleRootCause.encJsonValue(evelrep, "possibleRootCause"); + + +// if( alertidList != null && alertidList.size() > 0) +// { +// JsonArrayBuilder builder = Json.createArrayBuilder(); +// for(int i=0;i 0) { JsonArrayBuilder builder = Json.createArrayBuilder(); for(int i=0;i> it = additional_inf.entrySet().iterator(); + while(it.hasNext()) { + Map.Entry add_inf = (Map.Entry)it.next(); + String addl_info_key = add_inf.getKey(); + String addl_info_value = add_inf.getValue(); +// JsonObject obj1 = Json.createObjectBuilder() +// .add("name", addl_info_key) +// .add("value", addl_info_value).build(); + builder.add(addl_info_key, addl_info_key); + } + evelrep.add("additionalFields", builder); } - + evelrep.add( "thresholdCrossingFieldsVersion", version); + EVEL_EXIT(); @@ -489,7 +717,7 @@ public class EvelThresholdCross extends EvelHeader { JsonObject obj = Json.createObjectBuilder() .add("event", Json.createObjectBuilder() .add( "commonEventHeader",eventHeaderObject() ) - .add( "thresholdCrossingAlert",evelThresholdCrossingObject() ) + .add( "thresholdCrossingAlertFields",evelThresholdCrossingObject() ) ).build(); EVEL_EXIT(); diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelVoiceQuality.java b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelVoiceQuality.java index 9a3983c..c95dbc8 100644 --- a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelVoiceQuality.java +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelVoiceQuality.java @@ -41,7 +41,7 @@ public class EvelVoiceQuality extends EvelHeader { int major_version = 1; int minor_version = 0; - + /**************************************************************************//** * Vendor VNF Name fields. * JSON equivalent field: vendorVnfNameFields @@ -51,7 +51,7 @@ public class EvelVoiceQuality extends EvelHeader { EvelOptionString vfmodule; EvelOptionString vnfname; } - + /**************************************************************************//** * Service Event endpoint description * JSON equivalent field: endpointDesc @@ -95,6 +95,25 @@ public class EvelVoiceQuality extends EvelHeader { EvelOptionDouble packetLossPercent; EvelOptionDouble rFactor; EvelOptionDouble roundTripDelay; + + /* + * Ves6.0 Added Fields 15/07/2018 + */ + + EvelOptionDouble endpointAverageJitter; + EvelOptionDouble endpointMaxJitter; + EvelOptionDouble endpointRtpOctetsLost; + EvelOptionDouble endpointRtpPacketsLost; + EvelOptionDouble localAverageJitter; + EvelOptionDouble localMaxJitter; + EvelOptionDouble localAverageJitterBufferDelay; + EvelOptionDouble localMaxJitterBufferDelay; + EvelOptionDouble localRtpOctetsLost; + EvelOptionDouble localRtpPacketsLost; + EvelOptionDouble oneWayDelay; + + + } /***************************************************************************/ @@ -459,14 +478,14 @@ public class EvelVoiceQuality extends EvelHeader { *****************************************************************************/ public void evel_voice_quality_end_metrics_set( String adjacencyName, String endpointDescr, - double endpointJitter, + //double endpointJitter, double endpointRtpOctetsDiscarded, double endpointRtpOctetsReceived, double endpointRtpOctetsSent, double endpointRtpPacketsDiscarded, double endpointRtpPacketsReceived, double endpointRtpPacketsSent, - double localJitter, + // double localJitter, double localRtpOctetsDiscarded, double localRtpOctetsReceived, double localRtpOctetsSent, @@ -474,10 +493,25 @@ public class EvelVoiceQuality extends EvelHeader { double localRtpPacketsReceived, double localRtpPacketsSent, double mosCqe, - double packetsLost, + // double packetsLost, double packetLossPercent, double rFactor, - double roundTripDelay) { + double roundTripDelay, + /* + * Ves6.0 AddedFields 15/07/2018 + */ + double endpointAverageJitter, + double endpointMaxJitter, + double endpointRtpOctetsLost, + double endpointRtpPacketsLost, + double localAverageJitter, + double localMaxJitter, + double localAverageJitterBufferDelay, + double localMaxJitterBufferDelay, + double localRtpOctetsLost, + double localRtpPacketsLost, + double oneWayDelay + ) { END_OF_CALL_VOICE_QUALITY_METRICS vQMetrices = null; EVEL_ENTER(); @@ -520,15 +554,46 @@ public class EvelVoiceQuality extends EvelHeader { vQMetrices.packetLossPercent= new EvelOptionDouble(); vQMetrices.rFactor= new EvelOptionDouble(); vQMetrices.roundTripDelay= new EvelOptionDouble(); + /* + * Ves6.0 AddedFields 15/07/2018 + * */ + + vQMetrices.endpointAverageJitter = new EvelOptionDouble(); + vQMetrices.endpointMaxJitter = new EvelOptionDouble(); + vQMetrices.endpointRtpOctetsLost= new EvelOptionDouble(); + vQMetrices.endpointRtpPacketsLost = new EvelOptionDouble(); + vQMetrices.localAverageJitter=new EvelOptionDouble(); + vQMetrices.localMaxJitter=new EvelOptionDouble(); + vQMetrices.localAverageJitterBufferDelay=new EvelOptionDouble(); + vQMetrices.localMaxJitterBufferDelay=new EvelOptionDouble(); + vQMetrices.localRtpOctetsLost=new EvelOptionDouble(); + vQMetrices.localRtpPacketsLost=new EvelOptionDouble(); + vQMetrices.oneWayDelay=new EvelOptionDouble(); + + /* + * Ves6.0 AddedFields 15/07/2018 + * */ + + vQMetrices.endpointMaxJitter.SetValuePr(endpointMaxJitter, "EndpointMax jitter"); + vQMetrices.endpointAverageJitter.SetValuePr(endpointAverageJitter, "Endpoint Average Jitter"); + vQMetrices.endpointRtpOctetsLost.SetValuePr(endpointRtpOctetsLost, "End point RtpOctets Lost"); + vQMetrices.endpointRtpPacketsLost.SetValuePr(endpointRtpPacketsLost,"End point Rtp Packets Lost"); + vQMetrices.localAverageJitter.SetValuePr(localAverageJitter,"Local Average Jitter"); + vQMetrices.localMaxJitter.SetValuePr(localMaxJitter, "Local Max Jitter"); + vQMetrices.localMaxJitterBufferDelay.SetValuePr(localMaxJitterBufferDelay, "Local Max Jitter Buffer Delay"); + vQMetrices.localRtpOctetsLost.SetValuePr(localRtpOctetsLost, "Local RtpOctets Lost"); + vQMetrices.localRtpPacketsLost.SetValuePr(localRtpPacketsLost, "Local RtpPackets Lost"); + vQMetrices.oneWayDelay.SetValuePr(oneWayDelay, "OneWay Delay"); + - vQMetrices.endpointJitter.SetValuePr(endpointJitter, "Endpoint jitter"); +// vQMetrices.endpointJitter.SetValuePr(endpointJitter, "Endpoint jitter"); vQMetrices.endpointRtpOctetsDiscarded.SetValuePr(endpointRtpOctetsDiscarded, "Endpoint RTP octets discarded"); vQMetrices.endpointRtpOctetsReceived.SetValuePr(endpointRtpOctetsReceived, "Endpoint RTP octets received"); vQMetrices.endpointRtpOctetsSent.SetValuePr(endpointRtpOctetsSent, "Endpoint RTP octets sent"); vQMetrices.endpointRtpPacketsDiscarded.SetValuePr(endpointRtpPacketsDiscarded, "Endpoint RTP packets discarded"); vQMetrices.endpointRtpPacketsReceived.SetValuePr(endpointRtpPacketsReceived, "Endpoint RTP packets received"); vQMetrices.endpointRtpPacketsSent.SetValuePr(endpointRtpPacketsSent, "Endpoint RTP packets sent"); - vQMetrices.localJitter.SetValuePr( localJitter, "Local jitter"); +// vQMetrices.localJitter.SetValuePr( localJitter, "Local jitter"); vQMetrices.localRtpOctetsDiscarded.SetValuePr(localRtpOctetsDiscarded, "Local RTP octets discarded"); vQMetrices.localRtpOctetsReceived.SetValuePr(localRtpOctetsReceived, "Local RTP octets received"); vQMetrices.localRtpOctetsSent.SetValuePr(localRtpOctetsSent, "Local RTP octets sent"); @@ -536,7 +601,7 @@ public class EvelVoiceQuality extends EvelHeader { vQMetrices.localRtpPacketsReceived.SetValuePr(localRtpPacketsReceived, "Local RTP packets received"); vQMetrices.localRtpPacketsSent.SetValuePr(localRtpPacketsSent, "Local RTP packets sent"); vQMetrices.mosCqe.SetValuePr(mosCqe, "Decimal range from 1 to 5 (1 decimal place)"); - vQMetrices.packetsLost.SetValuePr(packetsLost, "Packets lost"); +// vQMetrices.packetsLost.SetValuePr(packetsLost, "Packets lost"); vQMetrices.packetLossPercent.SetValuePr(packetLossPercent, "Calculated percentage packet loss"); vQMetrices.rFactor.SetValuePr(rFactor, "rFactor "); vQMetrices.roundTripDelay.SetValuePr(roundTripDelay, "Round trip delay in milliseconds "); @@ -554,7 +619,8 @@ public class EvelVoiceQuality extends EvelHeader { JsonObjectBuilder evelVoiceQualityObject() { - double version = major_version+(double)minor_version/10; + //double version = major_version+(double)minor_version/10; + String version = "4.0"; EVEL_ENTER(); @@ -569,8 +635,8 @@ public class EvelVoiceQuality extends EvelHeader { JsonObjectBuilder vnfnamedobj = Json.createObjectBuilder() .add( "vendorName",vnfname_field.vendorname); - vnfname_field.vfmodule.encJsonValue(vnfnamedobj,"vfModuleName"); - vnfname_field.vfmodule.encJsonValue(vnfnamedobj,"vnfName"); + vnfname_field.vfmodule.encJsonValue(vnfnamedobj,"nfModuleName"); + vnfname_field.vfmodule.encJsonValue(vnfnamedobj,"nfName"); JsonObjectBuilder evelvq = Json.createObjectBuilder() .add("correlator", correlator) @@ -578,7 +644,7 @@ public class EvelVoiceQuality extends EvelHeader { .add("callerSideCodec", callerSideCodec) .add("midCallRtcp", midCallRtcp) .add("voiceQualityFieldsVersion", version) - .add("vendorVnfNameFields", vnfnamedobj); + .add("vendorNfNameFields", vnfnamedobj); /***************************************************************************/ /* Optional fields. */ @@ -589,15 +655,16 @@ public class EvelVoiceQuality extends EvelHeader { // additional fields if( additional_info != null ) { - JsonArrayBuilder builder = Json.createArrayBuilder(); + //JsonArrayBuilder builder = Json.createArrayBuilder(); + JsonObjectBuilder builder = Json.createObjectBuilder(); for(int i=0;i hm = new HashMap<>(); + static HashMap vpp_metrics = new HashMap<>(); + + static HashMap common_meas = new HashMap<>(); + + + static int bytes_in_this_round; + static int bytes_out_this_round; + static int packets_in_this_round; + static int packets_out_this_round; + + static int gm_event_id = 1; + static String event_id1 = "mvfs"; + static String event_id = "00000000"; + static String event_id2=null; + + static int request_rate = 0; + + static long epoch_start = 0; + + static String linkStart = ""; + static int linkCount; + + + Long start_epoch_microsec = 0L; + Long last_epoch_microsec = 0L; + + //public static void main(String[] args) { + public void run() { + // TODO Auto-generated method stub + //read_config_file(); + read_meas_traffic(); + read_common_config_file(); + read_meas_config_file(); + + HashMap intFaceMap = read_interface_config_file(); + int numOfInterfaces = 0; + if( !intFaceMap.isEmpty() ) + numOfInterfaces = intFaceMap.size(); + if( numOfInterfaces <= 0) { + System.out.println("ERROR : Didn't find interfacess in config file, exiting thread"); + return; + } + + System.out.println("MAP values: " + hm.values()); + + HashMap last_metrics = read_vpp_metrics(linkStart); + try { + Thread.sleep(Integer.parseInt(common_meas.get("measurementInterval"))); + }catch(Exception e) {} + + + while(true) { + //request_rate = rand()%10000; + request_rate =2; + EvelBatch ebt = new EvelBatch(); + event_id2 = event_id1+ event_id+(gm_event_id++); + EvelScalingMeasurement eveMeas = new EvelScalingMeasurement( Double.parseDouble(common_meas.get("measurementInterval")) , + common_meas.get("eventName"), + event_id2); + + for( String vNic : intFaceMap.keySet() ) { + //System.out.println("INFO:: getting vpp metrics for vNic "+vNic); + + HashMap current_metrics = read_vpp_metrics(vNic); + if( current_metrics.size() !=4 ) { + System.out.println("ERROR:: Did't get vpp metrics for vNic "+vNic); + continue; + } + + if (Integer.parseInt((String) current_metrics.get("bytes_in")) + - Integer.parseInt((String) last_metrics.get("bytes_in")) > 0) { + bytes_in_this_round = Integer.parseInt((String) current_metrics.get("bytes_in")) + - Integer.parseInt((String) last_metrics.get("bytes_in")); + } else { + bytes_in_this_round = 0; + } + + if (Integer.parseInt((String) current_metrics.get("bytes_out")) + - Integer.parseInt((String) last_metrics.get("bytes_out")) > 0) { + bytes_out_this_round = Integer.parseInt((String) current_metrics.get("bytes_out")) + - Integer.parseInt((String) last_metrics.get("bytes_out")); + } else { + bytes_out_this_round = 0; + } + + if (Integer.parseInt((String) current_metrics.get("packets_in")) + - Integer.parseInt((String) last_metrics.get("packets_in")) > 0) { + packets_in_this_round = Integer.parseInt((String) current_metrics.get("packets_in")) + - Integer.parseInt((String) last_metrics.get("packets_in")); + } else { + packets_in_this_round = 0; + } + + if (Integer.parseInt((String) current_metrics.get("packets_out")) + - Integer.parseInt((String) last_metrics.get("packets_out")) > 0) { + packets_out_this_round = Integer.parseInt((String) current_metrics.get("packets_out")) + - Integer.parseInt((String) last_metrics.get("packets_out")); + } else { + packets_out_this_round = 0; + } + + event_id2 = event_id1+ (gm_event_id++); + /* EvelScalingMeasurement eveMeas = new EvelScalingMeasurement( Double.parseDouble(hm.get("measurementInterval")) , + hm.get("eventName"), + event_id2); */ + + + EvelScalingMeasurement.MEASUREMENT_NIC_PERFORMANCE vNicPerf = eveMeas.evel_measurement_new_vnic_performance(vNic, "true"); + eveMeas.evel_meas_vnic_performance_add(vNicPerf ); + + if( hm.get("eventType")!=null) { + + start_epoch_microsec = last_epoch_microsec; + last_epoch_microsec = System.nanoTime()/1000; + + eveMeas.evel_last_epoch_set(start_epoch_microsec); + eveMeas.evel_start_epoch_set(last_epoch_microsec); + + + eveMeas.evel_measurement_type_set( hm.get("eventType").toString()); + eveMeas.evel_measurement_request_rate_set(request_rate ); + eveMeas.evel_vnic_performance_rx_total_pkt_delta_set(vNicPerf, packets_in_this_round); + eveMeas.evel_vnic_performance_tx_total_pkt_delta_set(vNicPerf, packets_out_this_round); + eveMeas.evel_vnic_performance_rx_octets_delta_set( vNicPerf, bytes_in_this_round); + eveMeas.evel_vnic_performance_tx_octets_delta_set( vNicPerf, bytes_out_this_round); + + eveMeas.evel_nfcnamingcode_set(hm.get("nfcNamingCode").toString()); + eveMeas.evel_nfnamingcode_set(hm.get("nfNamingCode").toString()); + eveMeas.evel_reporting_entity_name_set(hm.get("reportingEntityName").toString()); + eveMeas.evel_reporting_entity_id_set(hm.get("reportingEntityId").toString()); + eveMeas.evel_nfVendorName_set(hm.get("nfVendorName").toString()); + eveMeas.evel_header_set_sourceid(true,hm.get("sourceId").toString()); + + eveMeas.evel_header_set_source_name(hm.get("sourceName").toString()); + eveMeas.evel_timeZoneOffset_set(hm.get("timeZoneOffset").toString()); + + + + + } + + + try { + Thread.sleep(Integer.parseInt(common_meas.get("measurementInterval"))); + }catch(Exception e) {} + last_metrics = current_metrics; + } + + //ebt.addEvent(eveMeas); + AgentMain.evel_post_event(eveMeas); + System.out.println(" Event sent"); + + } + + } + + + + + public static HashMap read_vpp_metrics(String linkStart) { + Process p; + + String s=""; + HashMap vpp_metrics_map = new HashMap<>(); + String params[] = {"-f3", "-f11", "-f4", "-f12"}; + try { + Runtime rt = Runtime.getRuntime(); + for(int i=0;i<4;i++) { + String[] command = {"/bin/sh", "-c", "cat /proc/net/dev | grep \""+linkStart+"\" | tr -s \' \' | cut -d\' \' "+params[i]+""}; + Process child = rt.exec(command); + + BufferedReader reader = new BufferedReader(new InputStreamReader( + child.getInputStream())); + + while ((s= reader.readLine()) != null) { + String[] res = s.split(" "); + if( i==0) + vpp_metrics_map.put("bytes_in", res[0]); + if( i==1) + vpp_metrics_map.put("packets_in", res[0]); + if( i==2) + vpp_metrics_map.put("bytes_out", res[0]); + if( i==3) + vpp_metrics_map.put("packets_out", res[0]); + + } + } + + } catch (Exception e) { + e.printStackTrace(); + } + return vpp_metrics_map; + } + + + + public static HashMap read_common_config_file() { + + List list = new ArrayList(); + + + hm.put("eventType", ""); + hm.put("nfcNamingCode", ""); + hm.put("nfNamingCode", ""); + hm.put("nfVendorName", ""); + hm.put("reportingEntityId", ""); + hm.put("reportingEntityName", ""); + hm.put("sourceId", ""); + hm.put("sourceName", ""); + hm.put("timeZoneOffset", ""); + + + + System.out.println("KEYS: " + hm.keySet().size()); + System.out.println("VALUES: " + hm.values()); + + try { + // File file = new File("/home/ves/users/admin/temp/fw_common_config.txt"); + File file = new File("./src/main/java/evel_javalibrary/att/com/loadbalance/fw_common_config.txt"); + list = Files.readAllLines(file.toPath(), Charset.defaultCharset()); + for (String lineSplit : list) { + String[] res = lineSplit.split(" "); + hm.put(res[0], res[1]); + System.out.println("File reading after split ---" + res[0]); + System.out.println("File reading after split second---" + res[1]); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + System.out.println("KEYS: " + hm.keySet().size()); + System.out.println("VALUES: " + hm.values()); + return hm; + } + + + + public static HashMap read_interface_config_file() { + + List list = new ArrayList(); + HashMap interface_config = new HashMap<>(); + //interface_config.put("lo", ""); + + + System.out.println("KEYS: " + interface_config.keySet().size()); + System.out.println("VALUES: " + interface_config.values()); + + try { + //File file = new File("/home/ves/users/admin/temp/fw_interface_config.txt"); + File file = new File("./src/main/java/evel_javalibrary/att/com/loadbalance/fw_interface_config.txt"); + list = Files.readAllLines(file.toPath(), Charset.defaultCharset()); + for (String lineSplit : list) { + String[] res = lineSplit.split(" "); + interface_config.put(res[0], res[1]); + } + + linkStart = (String)interface_config.keySet().toArray()[1]; + linkCount = interface_config.keySet().size(); + + + + } catch (Exception ex) { + ex.printStackTrace(); + } + + return interface_config; + } + + + + + + + + public static HashMap read_meas_config_file() { + + List list = new ArrayList(); + + common_meas.put("eventName", "Measurement_vFirewall-AT&T_nicPerformance"); + common_meas.put("measurementInterval", ""); + + System.out.println("KEYS: " + common_meas.keySet().size()); + System.out.println("VALUES: " + common_meas.values()); + + try { + //File file = new File("/home/ves/users/admin/temp/fw_meas_config.txt"); + File file = new File("./src/main/java/evel_javalibrary/att/com/loadbalance/fw_meas_config.txt"); + list = Files.readAllLines(file.toPath(), Charset.defaultCharset()); + for (String lineSplit : list) { + String[] res = lineSplit.split(" "); + common_meas.put(res[0], res[1]); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + System.out.println("KEYS: " + common_meas.keySet().size()); + System.out.println("VALUES: " + common_meas.values()); + return common_meas; + } + + + + + + public static HashMap read_meas_traffic() { + Process p; + List vpp_params = new ArrayList(); + String s=""; + // HashMap vpp_metrics_map = new HashMap<>(); + String params[] = {"-f3", "-f11", "-f4", "-f12"}; + try { +// System.out.println("***********inside read_vpp_metrics"); +// String command = "cat /proc/net/dev | grep \"Receive\" | tr -s \' \' | cut -d\' \' -f3"; + //{"-f3", "-f11", "-f4", "-f12"}; +// String command = "cat /proc/net/dev | grep \""+vnic+"\" "; + for(int i=0;i<4;i++) { + String[] command = {"/bin/sh", "-c", "docker logs vHello | grep -c"}; +// System.out.println("**COMMAND***: "+command); + Process child = Runtime.getRuntime().exec(command); + + BufferedReader reader = new BufferedReader(new InputStreamReader( + child.getInputStream())); + + while ((s= reader.readLine()) != null) { + vpp_params.add(s); + System.out.println("VPP meas_traffic:----" + s); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return vpp_metrics; + } +} diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/faultData.java b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/faultData.java new file mode 100644 index 0000000..5400ba3 --- /dev/null +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/faultData.java @@ -0,0 +1,286 @@ +package evel_javalibrary.att.com.loadbalance; +/**************************************************************************//** + * @file + * Evel Fault Event class extends EvelHeader class + * + * This file implements the Evel Fault Event class which is intended to provide a + * simple wrapper around the complexity of AT&T's Vendor Event Listener API so + * that VNFs can use it to send Fault events. + * + * License + * ------- + * Unless otherwise specified, all software contained herein is + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *****************************************************************************/ + +import java.io.File; +import java.nio.charset.Charset; +import java.nio.file.Files; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import evel_javalibrary.att.com.AgentMain; +import evel_javalibrary.att.com.EvelBatch; +import evel_javalibrary.att.com.EvelFault; +import evel_javalibrary.att.com.EvelFault.EVEL_SEVERITIES; +import evel_javalibrary.att.com.EvelFault.EVEL_SOURCE_TYPES; +import evel_javalibrary.att.com.EvelFault.EVEL_VF_STATUSES; +import evel_javalibrary.att.com.EvelHeader; +import evel_javalibrary.att.com.EvelHeader.PRIORITIES; + + + +public class faultData extends Thread{ + + static HashMap fault_config = new HashMap<>(); + static HashMap interface_config = new HashMap<>(); + + static HashMap hm = new HashMap<>(); + + static String linkStart = ""; + static int linkCount; + + + static int gm_event_id = 1; + static String event_id1 = "fault"; + static String event_id = "00000000"; + static String event_id2=null; + + + static int bytes_in; + static int bytes_out; + static int packets_in; + static int packets_out; + + + static int falut_raised =0; + + + public void run() { + + String alarmCondition = "linkDown"; + String specificProblem = "Transmit-Receive issue"; + + Long start_epoch_microsec = 0L; + Long last_epoch_microsec = 0L; + + + MeasureData mdataThread = new MeasureData(); + hm = mdataThread.read_common_config_file(); + + read_fault_config_file(); + HashMap intFaceMapFault = mdataThread.read_interface_config_file(); + int numOfInterfacesFalut = 0; + if( !intFaceMapFault.isEmpty() ) + numOfInterfacesFalut = intFaceMapFault.size(); + if( numOfInterfacesFalut <= 0) { + System.out.println("ERROR : Didn't find interfacess in config file, exiting thread"); + return; + } + + + HashMap falut_last_metrics = mdataThread.read_vpp_metrics(linkStart); + + while(true) { + //request_rate = rand()%10000; + //request_rate =2; + EvelBatch ebt = new EvelBatch(); + event_id2 = event_id1+ event_id+(gm_event_id++); +// EvelScalingMeasurement eveMeas = new EvelScalingMeasurement( Double.parseDouble(common_meas.get("measurementInterval")) , +// common_meas.get("eventName"), +// event_id2); + + EvelHeader header = new EvelHeader("", ""); + + + //EvelFault eveFalt = new EvelFault(fault_config.get("eventName"), event_id2, alarmCondition, specificProblem,EVEL_PRIORITY_MEDIUM, EVEL_SEVERITY_MAJOR,EVEL_SOURCE_HOST,EVEL_VF_STATUS_IDLE); + + EvelFault eveFalt = new EvelFault(fault_config.get("eventName"),event_id2, alarmCondition, specificProblem, + EvelHeader.PRIORITIES.EVEL_PRIORITY_HIGH, + EVEL_SEVERITIES.EVEL_SEVERITY_MAJOR, + EVEL_SOURCE_TYPES.EVEL_SOURCE_CARD, + EVEL_VF_STATUSES.EVEL_VF_STATUS_ACTIVE); + + + + //EvelFault eveFalt = new EvelFault(fault_config.get("eventName"), event_id2, alarmCondition,specificProblem,1,1,3,1); + // EvelFault eveFalt = new EvelFault("eventName", "event_id2", "alarmCondition","specificProblem",1,1,3,1); + // EvelFault eveFalt = new EvelFault(fault_config.get("eventName"), event_id2, alarmCondition,specificProblem,1,1,3,1); + + for( String falut : intFaceMapFault.keySet() ) { + + HashMap falut_current_metrics = mdataThread.read_vpp_metrics(falut); + if( falut_current_metrics.size() !=4 ) { + System.out.println("ERROR:: Did't get vpp metrics for vNic "+falut); + continue; + } + + if (Integer.parseInt((String) falut_current_metrics.get("bytes_in")) + - Integer.parseInt((String) falut_last_metrics.get("bytes_in")) > 0) { + bytes_in = Integer.parseInt((String) falut_current_metrics.get("bytes_in")) + - Integer.parseInt((String) falut_last_metrics.get("bytes_in")); + } else { + bytes_in = 0; + } + + if (Integer.parseInt((String) falut_current_metrics.get("bytes_out")) + - Integer.parseInt((String) falut_last_metrics.get("bytes_out")) > 0) { + bytes_out = Integer.parseInt((String) falut_current_metrics.get("bytes_out")) + - Integer.parseInt((String) falut_last_metrics.get("bytes_out")); + } else { + bytes_out = 0; + } + + if (Integer.parseInt((String) falut_current_metrics.get("packets_in")) + - Integer.parseInt((String) falut_last_metrics.get("packets_in")) > 0) { + packets_in = Integer.parseInt((String) falut_current_metrics.get("packets_in")) + - Integer.parseInt((String) falut_last_metrics.get("packets_in")); + } else { + packets_in = 0; + } + + if (Integer.parseInt((String) falut_current_metrics.get("packets_out")) + - Integer.parseInt((String) falut_last_metrics.get("packets_out")) > 0) { + packets_out = Integer.parseInt((String) falut_current_metrics.get("packets_out")) + - Integer.parseInt((String) falut_last_metrics.get("packets_out")); + } else { + packets_out = 0; + } + + + + if((bytes_in < Integer.parseInt((String)fault_config.get("lowWaterMark")) || bytes_out < Integer.parseInt((String)fault_config.get("lowWaterMark")) || + packets_in < Integer.parseInt((String)fault_config.get("lowWaterMark")) || packets_out < Integer.parseInt((String)fault_config.get("lowWaterMark"))) && falut_raised == 0){ + + event_id2 = event_id1+ (gm_event_id++); + + if(eveFalt != null) { + + falut_raised =1; + eveFalt.evel_fault_interface_set(linkStart); + + if( hm.get("eventType")!=null) { + eveFalt.evel_fault_type_set(hm.get("eventType")); + + start_epoch_microsec = last_epoch_microsec; + last_epoch_microsec = System.nanoTime()/1000; + + eveFalt.evel_last_epoch_set(start_epoch_microsec); + eveFalt.evel_start_epoch_set(last_epoch_microsec); + + eveFalt.evel_fault_category_set("link"); + eveFalt.evel_fault_interface_set("My Interface"); + eveFalt.evel_nfcnamingcode_set(hm.get("nfcNamingCode").toString()); + eveFalt.evel_nfnamingcode_set(hm.get("nfNamingCode").toString()); + eveFalt.evel_reporting_entity_name_set(hm.get("reportingEntityName").toString()); + eveFalt.evel_reporting_entity_id_set(hm.get("reportingEntityId").toString()); + eveFalt.evel_nfVendorName_set(hm.get("nfVendorName").toString()); + eveFalt.evel_header_set_sourceid(true,hm.get("sourceId").toString()); + + eveFalt.evel_header_set_source_name(hm.get("sourceName").toString()); + eveFalt.evel_timeZoneOffset_set(hm.get("timeZoneOffset").toString()); + + } + + } + + }else if((bytes_in > Integer.parseInt((String)fault_config.get("lowWaterMark")) && bytes_out > Integer.parseInt((String)fault_config.get("lowWaterMark")) && + packets_in > Integer.parseInt((String)fault_config.get("lowWaterMark")) && packets_out > Integer.parseInt((String)fault_config.get("lowWaterMark"))) && falut_raised == 1) { + + + + event_id2 = event_id1+ (gm_event_id++); +// EvelHeader header = new EvelHeader("", ""); +// EvelFault eveFalt = new EvelFault(fault_config.get("eventName"), event_id2, "linkDown", "Transmit-Receive issue", header.priority, eveFalt.event_severity,eveFalt.event_source_type,eveFalt.vf_status); + + if(eveFalt != null) { + falut_raised =1; + + eveFalt.evel_fault_interface_set(linkStart); + System.out.println("Event type is "+hm.get("eventType") ); + if( hm.get("eventType")!=null) { + eveFalt.evel_fault_type_set(hm.get("eventType")); + + eveFalt.evel_fault_category_set("link"); + eveFalt.evel_nfcnamingcode_set(hm.get("nfcNamingCode").toString()); + eveFalt.evel_nfnamingcode_set(hm.get("nfNamingCode").toString()); + eveFalt.evel_reporting_entity_name_set(hm.get("reportingEntityName").toString()); + eveFalt.evel_reporting_entity_id_set(hm.get("reportingEntityId").toString()); + eveFalt.evel_nfVendorName_set(hm.get("nfVendorName").toString()); + eveFalt.evel_header_set_sourceid(true,hm.get("sourceId").toString()); + + eveFalt.evel_header_set_source_name(hm.get("sourceName").toString()); + eveFalt.evel_timeZoneOffset_set(hm.get("timeZoneOffset").toString()); + + } + + } + + + + } + + + try { + Thread.sleep(1000); + }catch(Exception e) {} + } + // ebt.addEvent(eveFalt); + AgentMain.evel_post_event(eveFalt); + System.out.println(" Event sent"); + + } + + + } + + + + + + + public static HashMap read_fault_config_file() { + + List list = new ArrayList(); + + List list_interface = new ArrayList(); + + fault_config.put("eventName", ""); + fault_config.put("faultCheckInterval", ""); + fault_config.put("lowWaterMark", ""); + + //interface_config.put("lo", ""); + + try { + // File file = new File("/home/ves/users/admin/temp/fw_flt_config.txt"); + File file = new File("./src/main/java/evel_javalibrary/att/com/loadbalance/fw_flt_config.txt"); + System.out.println("File path is..."+ file); + list = Files.readAllLines(file.toPath(), Charset.defaultCharset()); + for (String lineSplit : list) { + String[] res = lineSplit.split(" "); + fault_config.put(res[0], res[1]); + } + + + } catch (Exception ex) { + ex.printStackTrace(); + } + System.out.println("KEYS:fault_config " + fault_config.keySet().size()); + System.out.println("VALUES:fault_config " + fault_config.values()); + return fault_config; + } + + + +} diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/fw_common_config.txt b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/fw_common_config.txt new file mode 100644 index 0000000..e40b5b3 --- /dev/null +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/fw_common_config.txt @@ -0,0 +1,9 @@ +eventType platform +nfcNamingCode ssc +nfNamingCode scfx +nfVendorName AT&T +reportingEntityId cc305d54-75b4-431b-adb2-eb6b9e541234 +reportingEntityName ibcx0001vm002oam001 +sourceId de305d54-75b4-431b-adb2-eb6b9e546014 +sourceName scfx0001vm002cap001 +timeZoneOffset UTC-05:30 diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/fw_config.txt b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/fw_config.txt new file mode 100644 index 0000000..f730d6f --- /dev/null +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/fw_config.txt @@ -0,0 +1,10 @@ +eventName Measurement_vFirewall-AT&T_nicPerformance +eventType platform +nfcNamingCode ssc +nfNamingCode scfx +nfVendorName AT&T +reportingEntityId cc305d54-75b4-431b-adb2-eb6b9e541234 +reportingEntityName ibcx0001vm002oam001 +sourceId de305d54-75b4-431b-adb2-eb6b9e546014 +timeZoneOffset UTC-05:30 +measurementInterval 30 diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/fw_flt_config.txt b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/fw_flt_config.txt new file mode 100644 index 0000000..4b660ea --- /dev/null +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/fw_flt_config.txt @@ -0,0 +1,3 @@ +eventName Fault_vFirewall-AT&T_linkDownError +faultCheckInterval 30 +lowWaterMark 100 diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/fw_hb_config.txt b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/fw_hb_config.txt new file mode 100644 index 0000000..c288120 --- /dev/null +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/fw_hb_config.txt @@ -0,0 +1,2 @@ +eventName Heartbeat_vFirewall-AT&T_heartbeat +heartbeatInterval 20 diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/fw_interface_config.txt b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/fw_interface_config.txt new file mode 100644 index 0000000..46c3777 --- /dev/null +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/fw_interface_config.txt @@ -0,0 +1,13 @@ +lo DNS1_RSLOTPORT_VLAN_CLASSTYPE +bond0 DNS2_RSLOTPORT_VLAN_CLASSTYPE +bond0.4020 DNS3_RSLOTPORT_VLAN_CLASSTYPE +bond0.4020.4020 DNS4_RSLOTPORT_VLAN_CLASSTYPE +bond0.4021 DNS5_RSLOTPORT_VLAN_CLASSTYPE +bond0.4021.4021 DNS6_RSLOTPORT_VLAN_CLASSTYPE +ens3 DNS7_RSLOTPORT_VLAN_CLASSTYPE +ens4 DNS8_RSLOTPORT_VLAN_CLASSTYPE +ens5 DNS9_RSLOTPORT_VLAN_CLASSTYPE +ens6 DNSa_RSLOTPORT_VLAN_CLASSTYPE +ens7 DNSb_RSLOTPORT_VLAN_CLASSTYPE +docker0 DNSb_RSLOTPORT_VLAN_CLASSTYPE +enp0s3 DNSb_RSLOTPORT_VLAN_CLASSTYPE diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/fw_meas_config.txt b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/fw_meas_config.txt new file mode 100644 index 0000000..7fac2f7 --- /dev/null +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/fw_meas_config.txt @@ -0,0 +1,2 @@ +eventName Measurement_vFirewall-AT&T_nicPerformance +measurementInterval 30 diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/heartBeatData.java b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/heartBeatData.java new file mode 100644 index 0000000..9da7521 --- /dev/null +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/heartBeatData.java @@ -0,0 +1,153 @@ +package evel_javalibrary.att.com.loadbalance; +/**************************************************************************//** + * @file + * Heartbeat field class + * + * This file implements the Heartbeat Event class which is intended to provide a + * simple wrapper around the complexity of AT&T's Vendor Event Listener API so + * that VNFs can use it to send Agent status. + * + * License + * ------- + * Unless otherwise specified, all software contained herein is + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *****************************************************************************/ + +import java.io.File; +import java.nio.charset.Charset; +import java.nio.file.Files; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import javax.json.Json; +import javax.json.JsonArray; +import javax.json.JsonArrayBuilder; +import javax.json.JsonObject; +import javax.json.JsonObjectBuilder; + +import evel_javalibrary.att.com.AgentMain; +import evel_javalibrary.att.com.EvelBatch; +import evel_javalibrary.att.com.EvelHeartbeatField; + +public class heartBeatData extends Thread{ + + static HashMap hm = new HashMap<>(); + static HashMap hb_config = new HashMap<>(); + static int gm_event_id = 1; + static String event_id1 = "mvfs"; + static String event_id2=null; + + + public void run() { + + Long start_epoch_microsec = 0L; + Long last_epoch_microsec = 0L; + + MeasureData mdataThread = new MeasureData(); + hm = mdataThread.read_common_config_file(); + read_hb_config_file(); + + while(true) { + event_id2 = event_id1+ (gm_event_id++); + + + EvelHeartbeatField evelHb = new EvelHeartbeatField(Integer.parseInt(hb_config.get("heartbeatInterval")) , + hb_config.get("eventName"), + event_id2); + + if( hm.get("eventType")!=null) { + + start_epoch_microsec = last_epoch_microsec; + last_epoch_microsec = System.nanoTime()/1000; + + evelHb.evel_last_epoch_set(start_epoch_microsec); + evelHb.evel_start_epoch_set(last_epoch_microsec); + + evelHb.evel_header_type_set(hm.get("eventType").toString()); + evelHb.evel_nfcnamingcode_set(hm.get("nfcNamingCode").toString()); + evelHb.evel_nfnamingcode_set(hm.get("nfNamingCode").toString()); + evelHb.evel_reporting_entity_name_set(hm.get("reportingEntityName").toString()); + evelHb.evel_reporting_entity_id_set(hm.get("reportingEntityId").toString()); + evelHb.evel_nfVendorName_set(hm.get("nfVendorName").toString()); + evelHb.evel_header_set_sourceid(true,hm.get("sourceId").toString()); + evelHb.evel_header_set_source_name(hm.get("sourceName").toString()); + + evelHb.evel_timeZoneOffset_set(hm.get("timeZoneOffset").toString()); + + + JsonObject obj = Json.createObjectBuilder() + .add( "heartbeatFields",evelHeartbeatFieldObject() + ).build(); + + EvelBatch ebt = new EvelBatch(); + //ebt.addEvent(evelHb); + + + System.out.println(" Event sent..."+ obj.asJsonObject()); + System.out.println("Event sent...###########"); + AgentMain.evel_post_event(evelHb); + System.out.println(" Event sent..."); + } + + try { + Thread.sleep(1000); + }catch(Exception e) { + + } + } + } + + + JsonObjectBuilder evelHeartbeatFieldObject() + { + String version = "3.0"; + JsonObjectBuilder evelHeatbeat = Json.createObjectBuilder() + .add("heartbeatInterval", hb_config.get("heartbeatInterval")); + evelHeatbeat.add( "heartbeatFieldsVersion", version); + return evelHeatbeat; + } + + + public static HashMap read_hb_config_file() { + + List list = new ArrayList(); + + hb_config.put("eventName", ""); + hb_config.put("heartbeatInterval", ""); + + + System.out.println("KEYS: " + hb_config.keySet().size()); + System.out.println("VALUES: " + hb_config.values()); + + try { + //File file = new File("/home/ves/users/admin/temp/fw_hb_config.txt"); + File file = new File("./src/main/java/evel_javalibrary/att/com/loadbalance/fw_hb_config.txt"); + list = Files.readAllLines(file.toPath(), Charset.defaultCharset()); + for (String lineSplit : list) { + String[] res = lineSplit.split(" "); + hb_config.put(res[0], res[1]); +// System.out.println("File reading after split ---" + res[0]); +// System.out.println("File reading after split second---" + res[1]); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + System.out.println("KEYS:hb_config " + hb_config.keySet().size()); + System.out.println("VALUES:hb_config " + hb_config.values()); + return hb_config; + } + + + + +} diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/maindir/Main.java b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/maindir/Main.java new file mode 100644 index 0000000..96da88a --- /dev/null +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/maindir/Main.java @@ -0,0 +1,659 @@ + +package evel_javalibrary.att.com.maindir; + +/**************************************************************************//** + * @file + * Sample Test Agent for EVEL library + * + * This file implements the Sample Agent which is intended to provide a + * simple wrapper around the complexity of AT&T's Vendor Event Listener API so + * that VNFs can use it without worrying about details of the API transport. + * It also shows how events can be formatted with data for POST + * + * License + * ------- + * Unless otherwise specified, all software contained herein is + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *****************************************************************************/ + + +import org.apache.log4j.Logger; + +import evel_javalibrary.att.com.*; +import evel_javalibrary.att.com.AgentMain.EVEL_ERR_CODES; +import evel_javalibrary.att.com.EvelFault.EVEL_SEVERITIES; +import evel_javalibrary.att.com.EvelFault.EVEL_SOURCE_TYPES; +import evel_javalibrary.att.com.EvelFault.EVEL_VF_STATUSES; +import evel_javalibrary.att.com.EvelHeader.PRIORITIES; +import evel_javalibrary.att.com.EvelMobileFlow.MOBILE_GTP_PER_FLOW_METRICS; +import evel_javalibrary.att.com.EvelScalingMeasurement.MACHINE_CHECK_EXCEPTION; +import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_CODEC_USE; +import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_CPU_USE; +import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_DISK_USE; +import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_FEATURE_USE; +import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_FSYS_USE; +import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_HUGE_PAGE; +import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_IPMI; +import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_IPMI.MEASUREMENT_IPMI_PROCESSOR; +import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_LATENCY_BUCKET; +import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_LOAD; +import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_MEM_USE; +import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_NIC_PERFORMANCE; +import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_PROCESS_STATS; +import evel_javalibrary.att.com.EvelStateChange.EVEL_ENTITY_STATE; +import evel_javalibrary.att.com.EvelSyslog.EVEL_SYSLOG_FACILITIES; +import evel_javalibrary.att.com.EvelThresholdCross.EVEL_ALERT_TYPE; +import evel_javalibrary.att.com.EvelThresholdCross.EVEL_EVENT_ACTION; + +import org.apache.log4j.Level; + +import java.io.*; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Date; + +public class Main +{ + + public static void main(String[] args) + { + + try{ + AgentMain.evel_initialize("http://127.0.0.1", 30000, + // "http://1.2.3.4", 8080, + //"/vendor_event_listener","/example_vnf", + null,null, + "will", + "pill", + null, null, null, + //"/home/gokul/newwk/demo/vnfs/VES5.0/evel/sslcerts2/my-keystore.jks", "changeit", "changeit", + Level.TRACE); + } catch( Exception e ) + { + e.printStackTrace(); + } + + for(int i= 0; i < 2; i++) //srikanth no need for forloop , send only once. + { + + EvelHeader header = EvelHeader.evel_new_heartbeat("Hearbeat_vAFX","vmname_ip"); +// header.evel_nfnamingcode_set("vVNF"); +// header.evel_nfcnamingcode_set("vVNF"); +// header.evel_timeZoneOffset_set("UTC+5:30"); +// +// +// +// +// AgentMain.evel_post_event(header); + try { + Thread.sleep(1); + } catch( Exception e ) + { + e.printStackTrace(); + } + + + + EvelBatch be = new EvelBatch(); + + + EvelFault flt = new EvelFault("Fault_vVNF", "vmname_ip", + "My alaram condition", "It broke very badly", + EvelHeader.PRIORITIES.EVEL_PRIORITY_HIGH, + EVEL_SEVERITIES.EVEL_SEVERITY_MAJOR, + EVEL_SOURCE_TYPES.EVEL_SOURCE_CARD, + EVEL_VF_STATUSES.EVEL_VF_STATUS_ACTIVE); + flt.evel_fault_addl_info_add("name1", "value1"); + flt.evel_fault_addl_info_add("name2", "value2"); + flt.evel_fault_interface_set("My Interface Card"); + flt.evel_fault_category_set("link"); + AgentMain.evel_post_event(flt); + + +// EvelFault flt2 = new EvelFault("Fault_vVNF", "vmname_ip", +// "NIC error", "Hardware failed", +// EvelHeader.PRIORITIES.EVEL_PRIORITY_HIGH, +// EVEL_SEVERITIES.EVEL_SEVERITY_MAJOR, +// EVEL_SOURCE_TYPES.EVEL_SOURCE_CARD, +// EVEL_VF_STATUSES.EVEL_VF_STATUS_ACTIVE); +// flt2.evel_fault_addl_info_add("nichw", "fail"); +// flt2.evel_fault_addl_info_add("nicsw", "fail"); +// be.addEvent(flt2); +// +// EvelFault flt3 = new EvelFault("Fault_vVNF", "vmname_ip2", +// "NIC error", "Hardware failed", +// EvelHeader.PRIORITIES.EVEL_PRIORITY_NORMAL, +// EVEL_SEVERITIES.EVEL_SEVERITY_MAJOR, +// EVEL_SOURCE_TYPES.EVEL_SOURCE_CARD, +// EVEL_VF_STATUSES.EVEL_VF_STATUS_ACTIVE); +// flt3.evel_fault_type_set("Interface fault"); +// flt3.evel_fault_category_set("Failed category"); +// flt3.evel_fault_interface_set("An Interface Card"); +// flt3.evel_fault_addl_info_add("nichw", "fail"); +// flt3.evel_fault_addl_info_add("nicsw", "fail"); +// AgentMain.evel_post_event(flt3); +// be.addEvent(flt3); + + + /* + * Fault is End + * */ + + EvelStateChange stc = new EvelStateChange("StateChange_vVNF", "vmname_ip", + EvelStateChange.EVEL_ENTITY_STATE.EVEL_ENTITY_STATE_IN_SERVICE, + EvelStateChange.EVEL_ENTITY_STATE.EVEL_ENTITY_STATE_OUT_OF_SERVICE,"bgp"); + stc.evel_statechange_addl_info_add("bgpa", "fail"); + stc.evel_statechange_addl_info_add("bgpb", "fail"); + AgentMain.evel_post_event(stc); + + //be.addEvent(stc); + + + /* + * State Change End + * */ + + + EvelScalingMeasurement sm = new EvelScalingMeasurement(10.0,"Measurements_vVNF", "vmname_ip"); + sm.evel_measurement_myerrors_set(10,20,30,40); + + sm.evel_measurement_concurrent_sessions_set(5); + sm.evel_measurement_config_entities_set(9); + sm.evel_measurement_mean_req_lat_set(13.6); + sm.evel_measurement_request_rate_set(1234); + sm.evel_measurement_vnfc_scaling_metric_set(35); + sm.evel_measurement_media_port_use_set(20); + + MEASUREMENT_CPU_USE cpuuse = sm.evel_measurement_new_cpu_use_add("cpu2", 10.0); + sm.evel_measurement_cpu_use_cpuCapacityContention_set(cpuuse, 11.3); + sm.evel_measurement_cpu_use_cpuDeamandAvg_set(cpuuse, 11.4); + sm.evel_measurement_cpu_use_cpuDeamandPct_set(cpuuse, 11.6); + sm.evel_measurement_cpu_use_cpuDeamandMhz_set(cpuuse, 11.8); + sm.evel_measurement_cpu_use_cpuLatencyAvg_set(cpuuse, 11.9); + sm.evel_measurement_cpu_use_cpuOverheadAvg_set(cpuuse, 12.2); + sm.evel_measurement_cpu_use_cpuSwapWaitTime_set(cpuuse, 13.2); + sm.evel_measurement_cpu_use_idle_set(cpuuse, 14.2); + sm.evel_measurement_cpu_use_interrupt_set(cpuuse, 15.2); + sm.evel_measurement_cpu_use_nice_set(cpuuse, 16.2); + sm.evel_measurement_cpu_use_softirq_set(cpuuse, 17.2); + sm.evel_measurement_cpu_use_steal_set(cpuuse, 18.2); + sm.evel_measurement_cpu_use_system_set(cpuuse, 19.2); + sm.evel_measurement_cpu_use_usageuser_set(cpuuse, 18.9); + sm.evel_measurement_cpu_use_wait_set(cpuuse, 19.9); + + + MEASUREMENT_DISK_USE diskuse = sm.evel_measurement_new_disk_use_add("100"); + sm.evel_measurement_disk_use_diskWeightedIoTimeAvg_set(diskuse, 10.1); + sm.evel_measurement_disk_use_diskWeightedIoTimeLast_set(diskuse, 10.1); + sm.evel_measurement_disk_use_diskWeightedIoTimeMax_set(diskuse, 10.1); + sm.evel_measurement_disk_use_diskWeightedIoTimeMin_set(diskuse, 10.1); + sm.evel_measurement_disk_use_diskBusResets_set(diskuse, 10.1); + sm.evel_measurement_disk_use_diskCommandsAborted_set(diskuse, 10.1); + sm.evel_measurement_disk_use_diskCommandsAvg_set(diskuse, 10.1); + sm.evel_measurement_disk_use_diskFlushRequests_set(diskuse, 10.1); + sm.evel_measurement_disk_use_diskReadCommandsAvg_set(diskuse, 10.1); + sm.evel_measurement_disk_use_diskFlushTime_set(diskuse, 10.1); + sm.evel_measurement_disk_use_diskTime_set(diskuse, 10.1); + sm.evel_measurement_disk_use_diskTotalReadLatencyAvg_set(diskuse, 10.1); + sm.evel_measurement_disk_use_diskTotalWriteLatencyAvg_set(diskuse, 10.1); + sm.evel_measurement_disk_use_diskWriteCommandsAvg_set(diskuse, 10.1); + sm.evel_measurement_disk_use_iotimeavg_set(diskuse, 10.1); + sm.evel_measurement_disk_use_iotimelast_set(diskuse, 10.1); + sm.evel_measurement_disk_use_iotimemax_set(diskuse, 10.1); + sm.evel_measurement_disk_use_iotimemin_set(diskuse, 10.1); + sm.evel_measurement_disk_use_mergereadavg_set(diskuse, 10.1); + sm.evel_measurement_disk_use_mergereadlast_set(diskuse, 10.1); + sm.evel_measurement_disk_use_mergereadmax_set(diskuse, 10.1); + sm.evel_measurement_disk_use_mergereadmin_set(diskuse, 10.1); + sm.evel_measurement_disk_use_mergewritelast_set(diskuse, 10.1); + sm.evel_measurement_disk_use_mergewritemax_set(diskuse, 10.1); + sm.evel_measurement_disk_use_mergewritemin_set(diskuse, 10.1); + sm.evel_measurement_disk_use_mergewriteavg_set(diskuse, 10.1); + sm.evel_measurement_disk_use_octetsreadavg_set(diskuse, 10.1); + sm.evel_measurement_disk_use_octetsreadlast_set(diskuse, 10.1); + sm.evel_measurement_disk_use_octetsreadmax_set(diskuse, 10.1); + sm.evel_measurement_disk_use_octetsreadmin_set(diskuse, 10.1); + sm.evel_measurement_disk_use_octetswriteavg_set(diskuse, 10.1); + sm.evel_measurement_disk_use_octetswritelast_set(diskuse, 10.1); + sm.evel_measurement_disk_use_octetswritemax_set(diskuse, 10.1); + sm.evel_measurement_disk_use_octetswritemin_set(diskuse, 10.1); + sm.evel_measurement_disk_use_opsreadavg_set(diskuse, 10.1); + sm.evel_measurement_disk_use_opsreadlast_set(diskuse, 10.1); + sm.evel_measurement_disk_use_opsreadmax_set(diskuse, 10.1); + sm.evel_measurement_disk_use_opsreadmin_set(diskuse, 10.1); + sm.evel_measurement_disk_use_opswriteavg_set(diskuse, 10.1); + sm.evel_measurement_disk_use_opswritelast_set(diskuse, 10.1); + sm.evel_measurement_disk_use_opswritemax_set(diskuse, 10.1); + sm.evel_measurement_disk_use_opswritemin_set(diskuse, 10.1); + sm.evel_measurement_disk_use_pendingopsavg_set(diskuse, 10.1); + sm.evel_measurement_disk_use_pendingopslast_set(diskuse, 10.1); + sm.evel_measurement_disk_use_pendingopsmax_set(diskuse, 10.1); + sm.evel_measurement_disk_use_pendingopsmin_set(diskuse, 10.1); + sm.evel_measurement_disk_use_timereadavg_set(diskuse, 10.1); + sm.evel_measurement_disk_use_timereadlast_set(diskuse, 10.1); + sm.evel_measurement_disk_use_timereadmax_set(diskuse, 10.1); + sm.evel_measurement_disk_use_timereadmin_set(diskuse, 10.1); + sm.evel_measurement_disk_use_timewriteavg_set(diskuse, 10.1); + sm.evel_measurement_disk_use_timewritelast_set(diskuse, 10.1); + sm.evel_measurement_disk_use_timewritemax_set(diskuse, 10.1); + sm.evel_measurement_disk_use_timewritemin_set(diskuse, 10.1); + + MEASUREMENT_FEATURE_USE featureuse = sm.evel_measurement_feature_use_add("featureuse", 100); + + MEASUREMENT_HUGE_PAGE husePage= sm.evel_measurement_new_huge_page_add("HUGEPage1", 100000); + sm.evel_measurement_huge_page_bytesFree_set(husePage, 1100000); + sm.evel_measurement_huge_page_percentFree_set(husePage, 1000); + sm.evel_measurement_huge_page_percentUsed_set(husePage, 2000); + sm.evel_measurement_huge_page_vmPageNumberFree_set(husePage, 3000); + sm.evel_measurement_huge_page_vmPageNumberUsed_set(husePage, 4000); + + + + MEASUREMENT_MEM_USE memuse = sm.evel_measurement_new_mem_use_add("memuse", 100.0); + sm.evel_measurement_mem_use_memcache_set(memuse, 51.1); + sm.evel_measurement_mem_use_memconfig_set(memuse, 51.1); + sm.evel_measurement_mem_use_memfree_set(memuse, 51.1); + sm.evel_measurement_mem_use_slab_reclaimed_set(memuse, 51.1); + sm.evel_measurement_mem_use_slab_unreclaimable_set(memuse, 51.1); + sm.evel_measurement_mem_use_usedup_set(memuse, 51.1); + sm.evel_measurement_mem_use_memoryDemand_set(memuse, 51.1); + sm.evel_measurement_mem_use_memoryLatencyAvg_set(memuse, 51.1); + sm.evel_measurement_mem_use_memorySharedAvg_set(memuse, 51.1); + sm.evel_measurement_mem_use_memorySwapInAvg_set(memuse, 51.1); + sm.evel_measurement_mem_use_memorySwapInRateAvg_set(memuse, 51.1); + sm.evel_measurement_mem_use_memorySwapOutAvg_set(memuse, 51.1); + sm.evel_measurement_mem_use_memorySwapOutRateAvg_set(memuse, 51.1); + sm.evel_measurement_mem_use_memorySwapUsedAvg_set(memuse, 51.1); + + + + MEASUREMENT_LATENCY_BUCKET latecy = sm.evel_measurement_latency_add(10000, 2000, 3000); + sm.evel_meas_latency_bucket_low_end_set(latecy, 10); + sm.evel_meas_latency_bucket_high_end_set(latecy, 20); + + MEASUREMENT_FSYS_USE fileuse = sm.evel_measurement_fsys_use_add("FileSystem", 10.0, 2.8, 2.4, 3.3, 5.5, 9.0); + + + MEASUREMENT_NIC_PERFORMANCE vnic = sm.evel_measurement_new_vnic_performance("vnic1","true"); + vnic.recvd_bcast_packets_acc.SetValue(2400000.0); + vnic.recvd_mcast_packets_delta.SetValue(5677888.0); + vnic.recvd_mcast_packets_acc.SetValue(5677888.0); + vnic.tx_ucast_packets_acc.SetValue(547856576.0); + vnic.tx_ucast_packets_delta.SetValue(540000.0); + + sm.evel_meas_vnic_performance_add(vnic); + + MEASUREMENT_CODEC_USE codecuse = sm.evel_measurement_codec_use_add("codecuse", 100); + + + MEASUREMENT_LOAD load = sm.evel_measurement_new_load_add(19); + sm.evel_measurement_load_shortTerm_set(load, 55.5); + sm.evel_measurement_load_midTerm_set(load, 66.3); + sm.evel_measurement_load_longTerm_set(load, 77.3); + + MEASUREMENT_PROCESS_STATS processtate = sm.evel_measurement_new_process_stats_add("ProcessState", 19); + sm.evel_measurement_process_stats_forkRate_set(processtate, 20.3); + sm.evel_measurement_process_stats_psStateBlocked_set(processtate, 22.1); + sm.evel_measurement_process_stats_psStatePaging_set(processtate, 23.3); + sm.evel_measurement_process_stats_psStateRunning_set(processtate, 24.2); + sm.evel_measurement_process_stats_psStateSleeping_set(processtate, 25.5); + sm.evel_measurement_process_stats_psStateStopped_set(processtate, 26.6); + sm.evel_measurement_process_stats_psStateZombie_set(processtate, 26.6); + + MACHINE_CHECK_EXCEPTION except = sm.evel_measurement_new_machine_check_exception_add("Exception"); + sm.evel_measurement_Exception_correctedMemoryErrors_set(except, 10.0); + sm.evel_measurement_Exception_correctedMemoryErrors_In1Hr_set(except, 12.5); + sm.evel_measurement_Exception_uncorrectedMemoryErrors_set(except, 15.2); + sm.evel_measurement_Exception_uncorrectedMemoryErrors_In1Hr_set(except, 15.3); + + + sm.evel_measurement_addl_info_add("name", "value"); + + MEASUREMENT_IPMI ipmi = sm.evel_measurement_new_ipmis_add(); + + sm.evel_measurement_ipmi_exitAirTemperature_set(ipmi, 10.0); + sm.evel_measurement_ipmi_frontPanelTemperature_set(ipmi, 11.0); + sm.evel_measurement_ipmi_ioModuleTemperature_set(ipmi, 12.2); + sm.evel_measurement_ipmi_systemAirflow_set(ipmi, 13.4); + + ipmi.evel_measurement_IPMI_MEASUREMENT_IPMI_PROCESSOR_add("ProcessorIdentifier"); + ipmi.evel_measurement_IPMIbaseboardTemperature_add("IPMIbaseboardTemperature"); + ipmi.evel_measurement_IPMIbaseboardvoltageResulator_add("IPMIbaseboardvoltageRegulator"); + ipmi.evel_measurement_IPMI_MEASUREMENT_IPMIbattery_add("IPMIbattery"); + ipmi.evel_measurement_IPMI_MEASUREMENT_IPMIpowerSupply_add("powerSupplyIdentifier"); + ipmi.evel_measurement_IPMI_MEASUREMENT_IPMIglobalAggregateTemperatureMargin_add("AggregateTemperatureMargin"); + ipmi.evel_measurement_IPMINIC_add("nic_Identifier"); + ipmi.evel_measurement_IPMIHSBP_add("hsbpIdentifier"); + ipmi.evel_measurement_IPMIfan_add("fanIdentifier"); + + + sm.evel_measurement_custom_measurement_add("Measurement", "name", "value"); + + //sm.evel_meas_ipmi_add(ipmi); srikant , impi has added above, no need add here + +// cpuuse.steal.SetValue(34.0); +// cpuuse.user.SetValue(32.0); +// sm.evel_measurement_custom_measurement_add("group1","name1","val1"); +// sm.evel_measurement_custom_measurement_add("group1","name2","val2"); +// sm.evel_measurement_custom_measurement_add("group2","name1","val1"); +// sm.evel_measurement_custom_measurement_add("group2","name2","val2"); + + // be.addEvent(sm); + // AgentMain.evel_post_event(be); + + + + +/* + * EvelScalingMeasurement Change End + * */ + + + + + AgentMain.evel_post_event(sm); + + + + + + + + + EvelSyslog sysl = new EvelSyslog("Syslog_vVNF", "vmname_ip", + EvelFault.EVEL_SOURCE_TYPES.EVEL_SOURCE_ROUTER, + "Router failed","JUNIPER"); + + sysl.evel_syslog_event_source_host_set("SL Host"); + sysl.evel_syslog_priority_set(21); + sysl.evel_syslog_proc_id_set(456); + sysl.evel_syslog_proc_set("routed"); + + sysl.evel_syslog_s_data_set("sys data"); + sysl.evel_syslog_sdid_set("200"); + sysl.evel_syslog_severity_set("Alert"); + + sysl.evel_syslog_facility_set(EVEL_SYSLOG_FACILITIES.EVEL_SYSLOG_FACILITY_INTERNAL); + sysl.evel_syslog_severity_set("Data"); + sysl.evel_syslog_version_set(20); + sysl.evel_syslog_msghost_set("Host@msg"); + + sysl.evel__syslog_addl_info_add("name1", "value1"); + sysl.evel__syslog_addl_info_add("name2", "value2"); + AgentMain.evel_post_event(sysl); + + + //be.addEvent(sysl); + /* + * Ves6.0 Updated 15/07/2018 + */ + + + + +/* + * EvelSyslog Change End + * */ + + + EvelNotification notification = new EvelNotification("Notification_vVNF", "vmname_ip","change_identifier", "configuration changed"); + notification.evel_notification_add_newState_set("maintainance"); + notification.evel_notification_add_oldState_set("out of Service"); + notification.evel_notification_add_changeContact_set("ChangeContact"); + notification.evel_notification_addl_info_add("name1", "value1"); + notification.evel_notification_addl_info_add("name4", "value5"); + + notification.evel_notification_add_namedarray("hmNam1", "hmName1", "hmNmae2"); + + AgentMain.evel_post_event(notification); + + + + +/* + * notification Change End + * */ + + + + EvelPnfRegistration pnfRegistration = new EvelPnfRegistration("PnfRegistration_vVNF", "vmname_ip"); + pnfRegistration.evel_pnrregistration_add_lastServiceDate_set("10FEB2019"); + pnfRegistration.evel_pnrregistration_add_modelNumber_set("123456789"); + pnfRegistration.evel_pnfRegistration_serialNumber_set("6061ZW3"); + pnfRegistration.evel_pnrregistration_add_macaddress_set("FF:28:22:34:45:56"); + pnfRegistration.evel_pnrregistration_add_manufactureDate_set("FEB2011"); + // pnfRegistration.evel_pnrregistration_add_modelNumber_set("FE934567"); + pnfRegistration.evel_pnrregistration_add_oamV4IpAddress_set("100.10.10"); + + pnfRegistration.evel_pnfRegistration_softwareVersion_set("SW1234"); + + + pnfRegistration.evel_pnfRegistration_unitFamily_set("unitFamily222"); + pnfRegistration.evel_pnfRegistration_unitType_set("unitType1"); + + pnfRegistration.evel_pnrregistration_add_oamV4IpAddress_set("10.255.1.254"); + pnfRegistration.evel_pnrregistration_add_oamV6IpAddress_set("10.100.100.254"); + + + pnfRegistration.evel_pnfRegistration_vendorName_set("Vend_nam_123"); + pnfRegistration.evel_pnrregistration_addl_info_add("Name1", "value1"); + pnfRegistration.evel_pnrregistration_addl_info_add("Name2", "value2"); + + + AgentMain.evel_post_event(pnfRegistration); + + // be.addEvent(pnfRegistration); + +/* + * EvelPnfRegistration Change End + * */ + + EvelHeartbeatField hfld = new EvelHeartbeatField(123,"HeartbeatField_vVNF", "1"); + hfld.evel_hrtbt_interval_set(100); + hfld.evel_timeZoneOffset_set("UTC+5:30"); + AgentMain.evel_post_event(hfld); + +/* + * EvelHeartbeatField Change End + * */ + + EvelSipSignaling sip = new EvelSipSignaling("SipSignaling_vVNF", "vmname_ip","aricent","corlator","127.0.0.1","5647","10.1.1.124","5678"); + + + sip.evel_signaling_vnfmodule_name_set("nfName"); + sip.evel_signaling_vnfname_set("nf_name"); + sip.evel_signaling_addl_info_add("name1", "value1"); + sip.evel_signaling_addl_info_add("name2", "value2"); + AgentMain.evel_post_event(sip); + + // be.addEvent(sip); + +/* + * EvelSipSignaling Change End + * */ + + + + EvelVoiceQuality vq = new EvelVoiceQuality("VoiceQuality_vVNF", "vmname_ip", + "calleeSideCodc", + "callerSideCodc", "corlator", + "midCllRtcp", "juniper"); + vq.evel_voice_quality_end_metrics_set("adjname", "Caller", 20, 30, 40, 50, 60, 70, 80, 100, 110, 120, 130, 140, 15.1, 160.12, 170, 190, 200,210,220,230,240,250,260,270,280,290,300); + + + vq.evel_voice_quality_vnfmodule_name_set("vnfNaming"); + vq.evel_voice_quality_vnfname_set("vnfName"); + vq.evel_voice_quality_addl_info_add("Name1", "value1"); + vq.evel_voice_quality_addl_info_add("Name2", "value2"); + AgentMain.evel_post_event(vq); + + + // be.addEvent(vq); + + +/* + * EvelVoiceQuality Change End + * */ + + + EvelOther ev = new EvelOther("MyCustomEvent_vVNF", "vmname_ip"); + ev.evel_other_field_add("name1", "value1"); + ev.evel_other_field_add("name2", "value2"); + ev.evel_other_field_add("name3", "value3"); + ev.evel_other_field_add("name4", "value4"); + + ev.evel_other_field_add_namedarray("value3", "name3", "value6"); + ev.evel_other_field_add_namedarray("value1", "name4", "value7"); + ev.evel_other_field_add_namedarray("value1", "name4", "value7"); + ev.evel_other_field_add_namedarray("value4", "name5", "value8"); + AgentMain.evel_post_event(ev); + + + // be.addEvent(ev); + +/* + * EvelOther Change End + * */ + + + String dateStart = "01/14/2012 09:29:58"; + String dateStop = "01/15/2012 10:31:48"; + + //HH converts hour in 24 hours format (0-23), day calculation + SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); + + Date d1 = null; + Date d2 = null; + + try { + d1 = format.parse(dateStart); + d2 = format.parse(dateStop); + }catch (Exception e) { + e.printStackTrace(); + } + EvelThresholdCross tca = new EvelThresholdCross("ThresholdCross_vVNF", "vmname_ip", "CRIT", + "mcastRxPackets", EvelThresholdCross.EVEL_EVENT_ACTION.EVEL_EVENT_ACTION_CLEAR, + "Mcast Rx breached", + EvelThresholdCross.EVEL_ALERT_TYPE.EVEL_CARD_ANOMALY, + + d1, EvelThresholdCross.EVEL_SEVERITIES.EVEL_SEVERITY_CRITICAL, + d2); + + tca.evel_threshold_cross_alertvalue_set("alertvalue"); + tca.evel_threshold_cross_data_collector_set("data_collector"); + tca.evel_threshold_cross_data_elementtype_set("data_elementtype"); + tca.evel_threshold_cross_interfacename_set("interfacename"); + tca.evel_threshold_cross_networkservice_set("networkservice"); + tca.evel_threshold_cross_possible_rootcause_set("possible_rootcause"); + + + + + tca.evel_thresholdcross_addl_info_add("addname1", "addvalue1"); + tca.evel_thresholdcross_addl_info_add("addname2", "addvalue2"); + tca.evel_thresholdcross_alertid_add("alert1"); + tca.evel_thresholdcross_alertid_add("alert2"); + tca.evel_thresholdcross_alertid_add("alert3"); + tca.evel_thresholdcross_hashMap_add("hashName", "hashValue"); + + AgentMain.evel_post_event(tca); + + // be.addEvent(tca); + + + + +/* + * EvelThresholdCross Change End + * */ + + + + EvelMobileFlow mf = new EvelMobileFlow("MobileFlow_vVNF", "vmname_ip", + "In", + null, + "GTP", + "v2.3", + "1.2.3.4", + 345556, + "5.6.7.8", + 334344); + MOBILE_GTP_PER_FLOW_METRICS mygtp = mf.new MOBILE_GTP_PER_FLOW_METRICS( + 1.01, + 2.02, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + d1, + "ACTIVE", + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28); + mf.gtp_per_flow_metrics = mygtp; + + + mf.evel_mobile_gtp_metrics_iptos_set(mygtp,2, 3); + mf.evel_mobile_gtp_metrics_iptos_set(mygtp,5, 6); + + mf.evel_mobile_gtp_metrics_tcp_flag_count_add(mygtp, 3, 4); + mf.evel_mobile_gtp_metrics_tcp_flag_count_add(mygtp, 5, 8); + + mf.evel_mobile_gtp_metrics_qci_cos_count_add(mygtp, 2, 3); + mf.evel_mobile_gtp_metrics_qci_cos_count_add(mygtp, 5, 6); + + + + + + + + mf.evel_mobile_flow_addl_field_add("mobileFlowName1", "mobileValue1"); + + mf.evel_mobile_flow_app_type_set("application type"); + AgentMain.evel_post_event(mf); + + // be.addEvent(mf); + // AgentMain.evel_post_event(be); + +/* + * EvelMobileFlow Change End + * */ + + + } //srikanth no need for forloop , send only once. + + AgentMain.evel_shutdown(); + + } +} + diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/test/java/TestJunit.java b/veslibrary/ves_javalibrary/evel_javalib2/src/test/java/TestJunit.java index 285ea01..d1dd3d4 100644 --- a/veslibrary/ves_javalibrary/evel_javalib2/src/test/java/TestJunit.java +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/test/java/TestJunit.java @@ -31,7 +31,7 @@ import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_CPU_USE; import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_MEM_USE; import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_LATENCY_BUCKET; import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_DISK_USE; -import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_VNIC_PERFORMANCE; +import evel_javalibrary.att.com.EvelScalingMeasurement.MEASUREMENT_NIC_PERFORMANCE; import evel_javalibrary.att.com.EvelStateChange.EVEL_ENTITY_STATE; import evel_javalibrary.att.com.EvelThresholdCross.EVEL_ALERT_TYPE; import evel_javalibrary.att.com.EvelThresholdCross.EVEL_EVENT_ACTION; @@ -62,7 +62,6 @@ import javax.json.Json; import javax.json.JsonObject; import javax.json.JsonObjectBuilder; -import java.net.HttpURLConnection; @PrepareForTest({AgentMain.class}) @RunWith(PowerMockRunner.class) @@ -234,7 +233,7 @@ public class TestJunit { sm.evel_measurement_cpu_use_system_set(my1,0.5); sm.evel_measurement_cpu_use_usageuser_set(my1,0.5); - MEASUREMENT_MEM_USE mym1 = sm.evel_measurement_new_mem_use_add("mem1", "vm1",123456.0); + MEASUREMENT_MEM_USE mym1 = sm.evel_measurement_new_mem_use_add("mem1",123456.0); sm.evel_measurement_mem_use_memcache_set(mym1, 456.); sm.evel_measurement_mem_use_memconfig_set(mym1, 456.); sm.evel_measurement_mem_use_memfree_set(mym1, 456.); @@ -286,7 +285,7 @@ public class TestJunit { sm.evel_measurement_disk_use_timewritemin_set(dsk,45.); - MEASUREMENT_VNIC_PERFORMANCE vnic_p = sm.evel_measurement_new_vnic_performance("vnic1","true"); + MEASUREMENT_NIC_PERFORMANCE vnic_p = sm.evel_measurement_new_vnic_performance("vnic1","true"); vnic_p.recvd_bcast_packets_acc.SetValue(2400000.0); vnic_p.recvd_mcast_packets_delta.SetValue(5677888.0); vnic_p.recvd_mcast_packets_acc.SetValue(5677888.0); @@ -302,8 +301,12 @@ public class TestJunit { sm.evel_meas_latency_bucket_low_end_set(myb,1.); sm.evel_meas_latency_bucket_add(myb); sm.evel_measurement_latency_add(1.,10.,20); + + /* + * Arguments updated 15/07/2018 + */ - sm.evel_measurement_vnic_performance_add("vnic","vals", 1.,2.,3.,4.,5.,6.,7.,8.,9.,10.,11.,12.,13.,14.,15.,16.,17.,18.,19.,20.,21.,22.,23.,24.,25.,26.,27.,28.); + sm.evel_measurement_vnic_performance_add("vnic","vals","5 mbps", 1.,2.,3.,4.,5.,6.,7.,8.,9.,10.,11.,12.,13.,14.,15.,16.,17.,18.,19.,20.,21.,22.,23.,24.,25.,26.,27.,28.,29.,30.,31.,32.,33.,34.,35.,36.); when(mymainmock.evel_post_event(sm)).thenReturn(true); boolean ret = mymainmock.evel_post_event(sm); @@ -395,7 +398,11 @@ public class TestJunit { "calleeSideCodc", "callerSideCodc", "corlator", "midCllRtcp", "juniper"); - vq.evel_voice_quality_end_metrics_set("adjname", "Caller", 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 15.1, 160.12, 170, 180, 190); + /* + * Arguments updated 15/07/2018 + */ + vq.evel_voice_quality_end_metrics_set("adjname", "Caller", 20, 30, 40, 50, 60, 70, 80, 100, 110, 120, 130, 140, 15.1, 160.12, 170, 190, 200,210,220,230,240,250,260,270,280,290,300); + //vq.evel_voice_quality_end_metrics_set("adjname", "Caller", 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 15.1, 160.12, 170, 190, 200,210,220,230,240,250,260,270,280,290,300); vq.evel_voice_quality_addl_info_add("bgpb", "fail"); vq.evel_voice_quality_callee_codec_set("codec1"); vq.evel_voice_quality_caller_codec_set("codec1"); @@ -404,7 +411,11 @@ public class TestJunit { vq.evel_voice_quality_vnfmodule_name_set("mod1"); vq.evel_voice_quality_vnfname_set("mod1"); vq.evel_voice_quality_phone_number_set("1234-567-8910"); - vq.evel_voice_quality_end_metrics_set("name","descr", 1.,2.,3.,4.,5.,6.,7.,8.,9.,10.,11.,12,13.,14.,15.,16.,17.,18.,19.); + /* + * Arguments updated 15/07/2018 + */ + + // vq.evel_voice_quality_end_metrics_set("name","descr",2.,3.,4.,5.,6.,7.,8.,9.,10.,11.,12,13.,14.,15.,16.,17.,19.,20.,21.,22.,23.,24.,25.,26.,27.,28.,29.,30.); when(mymainmock.evel_post_event(vq)).thenReturn(true); boolean ret = mymainmock.evel_post_event(vq); @@ -468,17 +479,25 @@ public class TestJunit { } - EvelThresholdCross tca = new EvelThresholdCross("ThresholdCross_vVNF", "vmname_ip", - "CRIT", - "mcast Limit reached", - "mcastRxPackets", - "1250000000", - EvelThresholdCross.EVEL_EVENT_ACTION.EVEL_EVENT_ACTION_SET, - "Mcast Rx breached", - EvelThresholdCross.EVEL_ALERT_TYPE.EVEL_ELEMENT_ANOMALY, - d1, - EvelThresholdCross.EVEL_SEVERITIES.EVEL_SEVERITY_CRITICAL, - d2); +// EvelThresholdCross tca = new EvelThresholdCross("ThresholdCross_vVNF", "vmname_ip", +// "CRIT", +// "mcast Limit reached", +// "mcastRxPackets", +// "1250000000", +// EvelThresholdCross.EVEL_EVENT_ACTION.EVEL_EVENT_ACTION_SET, +// "Mcast Rx breached", +// EvelThresholdCross.EVEL_ALERT_TYPE.EVEL_ELEMENT_ANOMALY, +// d1, +// EvelThresholdCross.EVEL_SEVERITIES.EVEL_SEVERITY_CRITICAL, +// d2); + + EvelThresholdCross tca = new EvelThresholdCross("ThresholdCross_vVNF", "vmname_ip", "CRIT", + "mcastRxPackets", EvelThresholdCross.EVEL_EVENT_ACTION.EVEL_EVENT_ACTION_CLEAR, + "Mcast Rx breached", + EvelThresholdCross.EVEL_ALERT_TYPE.EVEL_CARD_ANOMALY, + + d1, EvelThresholdCross.EVEL_SEVERITIES.EVEL_SEVERITY_CRITICAL, + d2); tca.evel_threshold_cross_interfacename_set("ns345"); tca.evel_thresholdcross_addl_info_add("n1", "v1"); tca.evel_thresholdcross_addl_info_add("n2", "v2"); @@ -556,26 +575,6 @@ public class TestJunit { assertTrue( ret ); } - @Test - public void testBlockingPost() throws Exception, IOException { - EvelFault flt = new EvelFault("Fault_vVNF", "vmname_ip", - "NIC error", "Hardware failed", - EvelHeader.PRIORITIES.EVEL_PRIORITY_HIGH, - EVEL_SEVERITIES.EVEL_SEVERITY_MAJOR, - EVEL_SOURCE_TYPES.EVEL_SOURCE_CARD, - EVEL_VF_STATUSES.EVEL_VF_STATUS_ACTIVE); - flt.evel_fault_addl_info_add("nichw", "fail"); - flt.evel_fault_addl_info_add("nicsw", "fail"); - flt.evel_fault_category_set("intftype"); - flt.evel_fault_interface_set("eth0"); - flt.evel_fault_type_set("vmintf"); - when(mymainmock.sendObjectWithReturn(any(EvelObject.class))).thenReturn(200); - when(mymainmock.evel_post_event_immediate(flt)).thenCallRealMethod(); - int ret = mymainmock.evel_post_event_immediate(flt); - LOG.info("Returned "+ret); - assertEquals(200, ret); - - } } -- cgit 1.2.3-korg