diff options
Diffstat (limited to 'veslibrary/ves_javalibrary/evel_javalib2/src')
25 files changed, 6400 insertions, 429 deletions
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<String[]> additional_info;
+ // ArrayList<String[]> additional_info;
+ HashMap<String, String > 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<String[]>();
+ // additional_info = new ArrayList<String[]>();
+ 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<additional_info.size();i++) {
@@ -516,7 +516,26 @@ public class EvelFault extends EvelHeader { }
evelfault.add("alarmAdditionalInformation", builder);
}
+ */
+
+ if(additional_inf != null) {
+ // JsonArrayBuilder builder = Json.createArrayBuilder();
+ JsonObjectBuilder builder = Json.createObjectBuilder();
+ Iterator<Entry<String, String>> it = additional_inf.entrySet().iterator();
+ while(it.hasNext()) {
+ Map.Entry<String, String> add_inf = (Map.Entry<String, String>)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<String[]> additional_info;
+ // ArrayList<String[]> additional_info;
+
+ HashMap<String, String > 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<String[]>();
+ // additional_info = new ArrayList<String[]>();
+
+ 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<additional_info.size();i++) {
@@ -179,12 +190,28 @@ public class EvelHeartbeatField extends EvelHeader { .add("value", addl_info[1]).build();
builder.add(obj);
}
- evelstate.add("additionalFields", builder);
+ evelHeatbeat.add("additionalFields", builder);
}
-
+ */
+
+ if(additional_inf != null) {
+ JsonArrayBuilder builder = Json.createArrayBuilder();
+ Iterator<Entry<String, String>> it = additional_inf.entrySet().iterator();
+ while(it.hasNext()) {
+ Map.Entry<String, String> add_inf = (Map.Entry<String, String>)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<String,String> 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<String[]> additional_info;
+ //ArrayList<String[]> ipTosList;
+ Map<String,String> additional_inf;
+
+ Map<String,String> 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<String[]>();
+ additional_inf = new HashMap<String,String>();
}
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<String,String>();
+ }
+
+ 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<additional_info.size();i++) {
- String[] addl_info = additional_info.get(i);
- JsonObject obj = Json.createObjectBuilder()
- .add("name", addl_info[0])
- .add("value", addl_info[1]).build();
- builder.add(obj);
- }
- evelmf.add("additionalFields", builder);
- }
+
+
+ /***************************************************************************/
+ /* Optional fields. */
+ /***************************************************************************/
+ // additional fields
+ if( additional_inf != null )
+ {
+ JsonObjectBuilder builder = Json.createObjectBuilder();
+ // JsonArrayBuilder builder = Json.createArrayBuilder();
+ for(Map.Entry<String, String> 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<String[]> additional_info; + HashMap<String, String > additional_inf; + + + /***************************************************************************/ + /* Optional fields */ + /***************************************************************************/ + + EvelOptionString newState; + EvelOptionString oldState; + EvelOptionString changeContact; + EvelOptionString stateInterface; + + + ArrayList<javax.json.JsonObject> additional_objects; + Map<String,Map<String,String>> 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<String[]>(); +// 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<String,String> mymap = null; + + try{ + + if( evelmap == null) + evelmap = new HashMap<String,Map<String,String>>(); + + if( evelmap.containsKey(hashname) ) + { + mymap = evelmap.get(hashname); + } + else + { + mymap = new HashMap<String,String>(); + 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<javax.json.JsonObject>(); + + 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<String[]>(); + 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<additional_info.size();i++) { +// String[] addl_info = additional_info.get(i); +// JsonObject obj1 = Json.createObjectBuilder() +// .add("name", addl_info[0]) +// .add("value", addl_info[1]).build(); +// builder.add(obj1); +// } +// obj.add("additionalFields", builder); +// } + + + if(additional_inf != null) { + JsonObjectBuilder builder = Json.createObjectBuilder(); + // JsonArrayBuilder builder = Json.createArrayBuilder(); + Iterator<Entry<String, String>> it = additional_inf.entrySet().iterator(); + while(it.hasNext()) { + Map.Entry<String, String> add_inf = (Map.Entry<String, String>)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<additional_objects.size();i++) { + JsonObject jobj = additional_objects.get(i); + builder.add(jobj); + } + obj.add("jsonObjects",builder); + } + + + + if( evelmap != null && evelmap.size() > 0) + { + JsonArrayBuilder builder = Json.createArrayBuilder(); + for(Map.Entry<String, Map<String,String>> entry : evelmap.entrySet()){ + LOGGER.debug(MessageFormat.format("Key : {0} and Value: {1}", entry.getKey(), entry.getValue())); + Map<String,String> item = entry.getValue(); + + JsonObjectBuilder obj1 = Json.createObjectBuilder() + .add( "name", entry.getKey()); + // JsonArrayBuilder builder2 = Json.createArrayBuilder(); + JsonObjectBuilder builder2 = Json.createObjectBuilder(); + for(Map.Entry<String, String> 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<String,String> additional_info;
+
+
+
Map<String,Map<String,String>> 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<String,String>();
+ additional_info = new HashMap<String, String>();
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<String, String> 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<String, String> 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<String[]> additional_info; + HashMap<String, String > 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<Entry<String, String>> it = additional_inf.entrySet().iterator(); + while(it.hasNext()) { + Map.Entry<String, String> add_inf = (Map.Entry<String, String>)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<CUSTOM_MEASUREMENT> 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<MEASUREMENT_IPMI_PROCESSOR> ipmiprocessor;
+
+ public class MEASUREMENT_IPMI_PROCESSOR {
+ public String processorIdentifier;
+ public EvelOptionDouble processorThermalControlPercent;
+ public EvelOptionDouble processorDTSthermalMargin;
+
+ ArrayList<Processor_DIMMaggregate_Thermal_Margin> 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<Processor_DIMMaggregate_Thermal_Margin>();
+ 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<MEASUREMENT_IPMI_PROCESSOR>();
+ LOGGER.debug("Allocate new IPMI_PROCESSOR");
+ }
+
+ ipmiprocessor.add(mIP);
+
+ EVEL_EXIT();
+ }
+
+
+
+
+
+
+ ArrayList<IPMIglobalAggregateTemperatureMargin> 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<IPMIglobalAggregateTemperatureMargin>();
+ LOGGER.debug("Allocate new IPMIglobalAggregateTemperatureMargin");
+ }
+
+ ipmiglobalAggregateTemperatureMarginArray.add(ipmiGlobalAgg);
+
+ EVEL_EXIT();
+ }
+
+
+
+ ArrayList<IPMIpowerSupply> 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<IPMIpowerSupply>();
+ LOGGER.debug("Allocate new IPMIpowerSupply");
+ }
+
+ ipmipowerSupply.add(ipmipower);
+
+ EVEL_EXIT();
+ }
+
+
+
+
+
+ ArrayList<IPMIbattery> 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<IPMIbattery>();
+ LOGGER.debug("Allocate new IPMIbattery");
+ }
+
+ ipmibattery.add(imibatt);
+
+ EVEL_EXIT();
+ }
+
+
+
+ ArrayList<IPMINIC> 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<IPMINIC>();
+ LOGGER.debug("Allocate new IPMINIC");
+ }
+
+ ipmiNIC.add(ipmiNic);
+
+ EVEL_EXIT();
+ }
+
+
+
+ ArrayList<IPMIHSBP> 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<IPMIHSBP>();
+ LOGGER.debug("Allocate new IPMIHSBP");
+ }
+
+ ipmiHSBP.add(ipmiHsbp);
+
+ EVEL_EXIT();
+ }
+
+
+
+
+ ArrayList<IPMIbaseboardTemperature> 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<IPMIbaseboardTemperature>();
+ LOGGER.debug("Allocate new IPMIbaseboardTemperature");
+ }
+
+ ipmibaseboardTemperature.add(ipmibaseboardTemp);
+
+ EVEL_EXIT();
+ }
+
+
+
+
+ ArrayList<IPMIbaseboardvoltageResulator> 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<IPMIbaseboardvoltageResulator>();
+ LOGGER.debug("Allocate new IPMIbaseboardvoltageResulator");
+ }
+
+ ipmiBaseboardvoltageResulator.add(ipmiBaseboardvoltageRes);
+
+ EVEL_EXIT();
+ }
+
+
+
+
+ ArrayList<IPMIfan> 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<IPMIfan>();
+ LOGGER.debug("Allocate new IPMIfan");
+ }
+
+ ipmiFan.add(ipmiF);
+
+ EVEL_EXIT();
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// ArrayList<MEASUREMENT_IPMI_PERCENT_USAGE> ipmi_percentage;
+// ArrayList<MEASUREMENT_IPMI_VOLTAGE> ipmi_voltage;
+//
+// ArrayList<MEASUREMENT_IPMI_TEMPARATURE> ipmi_temparature;
+// ArrayList<MEASUREMENT_IPMI_FAN> ipmi_fan;
+// ArrayList<MEASUREMENT_IPMI_CFM> ipmi_cfm;
+// ArrayList<MEASUREMENT_IPMI_WATTS> 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<MEASUREMENT_IPMI_TEMPARATURE>();
+// 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<MEASUREMENT_IPMI_FAN>();
+// 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<MEASUREMENT_IPMI_CFM>();
+// 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<MEASUREMENT_IPMI_WATTS>();
+// 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<MEASUREMENT_IPMI_VOLTAGE>();
+// 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<MEASUREMENT_IPMI_PERCENT_USAGE>();
+// 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<MEASUREMENT_IPMI>();
+ 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<String[]> additional_info;
+ // ArrayList<String[]> additional_info;
+
+ HashMap<String, String > additional_inf;
+
ArrayList<MEASUREMENT_GROUP> additional_measurements;
ArrayList<javax.json.JsonObject> additional_objects;
ArrayList<MEASUREMENT_CODEC_USE> codec_usage;
EvelOptionInt concurrent_sessions;
EvelOptionInt configured_entities;
ArrayList<MEASUREMENT_CPU_USE> cpu_usage;
+ //VES6.0 Added field 14/07/2018
+ ArrayList<MEASUREMENT_HUGE_PAGE> huge_pages;
+ ArrayList<MEASUREMENT_LOAD> loads;
+ ArrayList<MEASUREMENT_PROCESS_STATS> process_stats;
+ ArrayList<MEASUREMENT_IPMI> ipmis;
+ ArrayList<MACHINE_CHECK_EXCEPTION> machineCheckException;
+
+
+
+
ArrayList<MEASUREMENT_DISK_USE> 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<MEASUREMENT_VNIC_PERFORMANCE> vnic_usage;
+ ArrayList<MEASUREMENT_NIC_PERFORMANCE> 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<String[]>();
+ additional_inf = new HashMap<String, String >();
}
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<MEASUREMENT_IPMI>();
+ LOGGER.debug("Allocate new ipmis");
+ }
+
+ ipmis.add(ipmi);
+
+ EVEL_EXIT();
+ return ipmi;
+ }
+
+
+
+ /*
+ *
+ */
+
+
+
+
+
+
+
+
+
+
/**************************************************************************//**
* Set the Concurrent Sessions property of the Measurement.
*
@@ -601,8 +1689,556 @@ public class EvelScalingMeasurement extends EvelHeader { 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 id ASCIIZ string with the CPU's identifier.
+ * @param usage CPU utilization.
+ *****************************************************************************/
+ public MEASUREMENT_PROCESS_STATS evel_measurement_new_process_stats_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_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( process_stats == null ){
+ process_stats = new ArrayList<MEASUREMENT_PROCESS_STATS>();
+ LOGGER.debug("Allocate Process_Stats");
+ }
+
+ process_stats.add(process_stat);
+
+ EVEL_EXIT();
+ return process_stat;
+ }
+
+
+
+
+
+
+ /**************************************************************************//**
+ * 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.
+ *
+ * @param cpu_use Pointer to the CPU Use.
+ * @param val double
+ *****************************************************************************/
+
+
+ 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<MEASUREMENT_LOAD>();
+ 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<MACHINE_CHECK_EXCEPTION>();
+ 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<MEASUREMENT_HUGE_PAGE>();
+ 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
@@ -640,7 +2276,16 @@ public class EvelScalingMeasurement extends EvelHeader { 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<MEASUREMENT_CPU_USE>();
LOGGER.debug("Allocate new cpu usage");
@@ -651,6 +2296,131 @@ public class EvelScalingMeasurement extends EvelHeader { 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
@@ -806,7 +2576,7 @@ public class EvelScalingMeasurement extends EvelHeader { EVEL_EXIT();
}
-
+
/**************************************************************************//**
* Add an additional Memory usage value name/value pair to the Measurement.
*
@@ -822,7 +2592,7 @@ public class EvelScalingMeasurement extends EvelHeader { * @return Returns pointer to memory use structure in measurements
*****************************************************************************/
public MEASUREMENT_MEM_USE evel_measurement_new_mem_use_add(
- String id, String vmidentifier, double membuffsz)
+ String vmidentifier, double membuffsz)
{
MEASUREMENT_MEM_USE mem_use = null;
EVEL_ENTER();
@@ -831,16 +2601,16 @@ public class EvelScalingMeasurement extends EvelHeader { /* Check assumptions. */
/***************************************************************************/
assert(event_domain == EvelHeader.DOMAINS.EVEL_DOMAIN_MEASUREMENT);
- assert(id != null);
+ // 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));
+ 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.id = id;
mem_use.vmid = vmidentifier;
mem_use.membuffsz = membuffsz;
mem_use.memcache = new EvelOptionDouble();
@@ -849,6 +2619,17 @@ public class EvelScalingMeasurement extends EvelHeader { 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);
@@ -972,7 +2753,159 @@ public class EvelScalingMeasurement extends EvelHeader { 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 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 mem_use Pointer to the Memory Use.
+ * @param val double
+ *****************************************************************************/
+ public void evel_measurement_mem_use_memorySharedAvg_set(MEASUREMENT_MEM_USE mem_use,
+ double val)
+ {
+ EVEL_ENTER();
+ mem_use.memorySharedAvg.SetValuePr(val, "Space used for caching swapped pages in the host cache in kibibytes");
+ EVEL_EXIT();
+ }
+
+ /**************************************************************************//**
+ * 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 mem_use Pointer to the Memory Use.
+ * @param val double
+ *****************************************************************************/
+ public void evel_measurement_mem_use_memorySwapInAvg_set(MEASUREMENT_MEM_USE mem_use,
+ double val)
+ {
+ EVEL_ENTER();
+ mem_use.memorySwapInAvg.SetValuePr(val, "Amount of memory swapped-in from host cache in kibibytes.");
+ EVEL_EXIT();
+ }
+
+ /**************************************************************************//**
+ * 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 mem_use Pointer to the Memory Use.
+ * @param val double
+ *****************************************************************************/
+ public void evel_measurement_mem_use_memorySwapInRateAvg_set(MEASUREMENT_MEM_USE mem_use,
+ double val)
+ {
+ EVEL_ENTER();
+ 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 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 mem_use Pointer to the Memory Use.
+ * @param val double
+ *****************************************************************************/
+ public void evel_measurement_mem_use_memorySwapOutAvg_set(MEASUREMENT_MEM_USE mem_use,
+ double val)
+ {
+ EVEL_ENTER();
+ mem_use.memorySwapOutAvg.SetValuePr(val, "Amount of memory swapped-out to host cache in kibibytes.");
+ EVEL_EXIT();
+ }
+
+ /**************************************************************************//**
+ * 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 mem_use Pointer to the Memory Use.
+ * @param val double
+ *****************************************************************************/
+ public void evel_measurement_mem_use_memorySwapOutRateAvg_set(MEASUREMENT_MEM_USE mem_use,
+ double val)
+ {
+ EVEL_ENTER();
+ 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 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 mem_use Pointer to the Memory Use.
+ * @param val double
+ *****************************************************************************/
+ public void evel_measurement_mem_use_memorySwapUsedAvg_set(MEASUREMENT_MEM_USE mem_use,
+ double val)
+ {
+ EVEL_ENTER();
+ mem_use.memorySwapUsedAvg.SetValuePr(val, "Space used for caching swapped pages in the host cache in kibibytes.");
+ EVEL_EXIT();
+ }
+
+
/**************************************************************************//**
* Add an additional Disk usage value name/value pair to the Measurement.
*
@@ -1044,6 +2977,27 @@ public class EvelScalingMeasurement extends EvelHeader { 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();
+
+
+ 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<MEASUREMENT_DISK_USE>();
@@ -1057,7 +3011,235 @@ public class EvelScalingMeasurement extends EvelHeader { EVEL_EXIT();
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 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_diskBusResets_set(MEASUREMENT_DISK_USE disk_use,
+ double val)
+ {
+ EVEL_ENTER();
+ disk_use.diskBusResets.SetValuePr(val,"Disk Bus Resets");
+ EVEL_EXIT();
+ }
+ /**************************************************************************//**
+ * 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_diskCommandsAborted_set(MEASUREMENT_DISK_USE disk_use,
+ double val)
+ {
+ EVEL_ENTER();
+ disk_use.diskCommandsAborted.SetValuePr(val,"Disk ioload set");
+ EVEL_EXIT();
+ }
+ /**************************************************************************//**
+ * 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 disk_use Pointer to the Disk Use.
+ * @param val double
+ *****************************************************************************/
+ public void evel_measurement_disk_use_diskCommandsAvg_set(MEASUREMENT_DISK_USE disk_use,
+ double val)
+ {
+ EVEL_ENTER();
+ disk_use.diskCommandsAvg.SetValuePr(val,"Average number of commands per second");
+ EVEL_EXIT();
+ }
+ /**************************************************************************//**
+ * 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 disk_use Pointer to the Disk Use.
+ * @param val double
+ *****************************************************************************/
+ public void evel_measurement_disk_use_diskTime_set(MEASUREMENT_DISK_USE disk_use,
+ double val)
+ {
+ EVEL_ENTER();
+ disk_use.diskTime.SetValuePr(val,"Total time spent on disk cache reads/writes in nanoseconds");
+ EVEL_EXIT();
+ }
+ /**************************************************************************//**
+ * 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 disk_use Pointer to the Disk Use.
+ * @param val double
+ *****************************************************************************/
+ public void evel_measurement_disk_use_diskTotalReadLatencyAvg_set(MEASUREMENT_DISK_USE disk_use,
+ double val)
+ {
+ EVEL_ENTER();
+ 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 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 disk_use Pointer to the Disk Use.
+ * @param val double
+ *****************************************************************************/
+ public void evel_measurement_disk_use_diskTotalWriteLatencyAvg_set(MEASUREMENT_DISK_USE disk_use,
+ double val)
+ {
+ EVEL_ENTER();
+ 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();
+ }
+ /**************************************************************************//**
+ * 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 disk_use Pointer to the Disk Use.
+ * @param val double
+ *****************************************************************************/
+ public void evel_measurement_disk_use_diskWriteCommandsAvg_set(MEASUREMENT_DISK_USE disk_use,
+ double val)
+ {
+ EVEL_ENTER();
+ disk_use.diskWriteCommandsAvg.SetValuePr(val,"Average number of write commands issued per second to the disk during the collection interval.");
+ EVEL_EXIT();
+ }
/**************************************************************************//**
* 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<MEASUREMENT_VNIC_PERFORMANCE>();
+ vnic_usage = new ArrayList<MEASUREMENT_NIC_PERFORMANCE>();
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<MEASUREMENT_VNIC_PERFORMANCE>();
+ vnic_usage = new ArrayList<MEASUREMENT_NIC_PERFORMANCE>();
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<additional_info.size();i++) {
- String[] addl_info = additional_info.get(i);
- JsonObject obj = Json.createObjectBuilder()
- .add("name", addl_info[0])
- .add("value", addl_info[1]).build();
- builder.add(obj);
- }
- evelmeasmt.add("additionalFields", builder);
- }
+// if( additional_info != null )
+// {
+// JsonArrayBuilder builder = Json.createArrayBuilder();
+// for(int i=0;i<additional_info.size();i++) {
+// String[] addl_info = additional_info.get(i);
+// JsonObject obj = Json.createObjectBuilder()
+// .add("name", addl_info[0])
+// .add("value", addl_info[1]).build();
+// builder.add(obj);
+// }
+// evelmeasmt.add("additionalFields", builder);
+// }
+
+ if(additional_inf != null) {
+ JsonObjectBuilder builder = Json.createObjectBuilder();
+ //JsonArrayBuilder builder = Json.createArrayBuilder();
+ Iterator<Entry<String, String>> it = additional_inf.entrySet().iterator();
+ while(it.hasNext()) {
+ Map.Entry<String, String> add_inf = (Map.Entry<String, String>)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;i<loads.size();i++) {
+ load = loads.get(i);
+ JsonObjectBuilder obj = Json.createObjectBuilder();
+ // .add("loadIdentifier", load.loadIdentifier);
+ load.longTerm.encJsonValue(obj,"longTerm");
+ load.midTerm.encJsonValue(obj,"midTerm");
+ load.shortTerm.encJsonValue(obj,"shortTerm");
+ builder.add(obj.build());
+
+ }
+ evelmeasmt.add("loadArray", builder);
+ }
+
+ /***************************************************************************/
+ /* process_stats */
+ /***************************************************************************/
+ if(this.process_stats!=null && this.process_stats.size()>0) {
+
+ JsonArrayBuilder builder = Json.createArrayBuilder();
+ for(int i=0;i<this.process_stats.size();i++) {
+ process_stats = this.process_stats.get(i);
+ JsonObjectBuilder obj = Json.createObjectBuilder()
+ .add("processIdentifier", process_stats.processIdentifier);
+ process_stats.forkRate.encJsonValue(obj, "forkRate");
+ process_stats.psStateBlocked.encJsonValue(obj, "psStateBlocked");
+ process_stats.psStatePaging.encJsonValue(obj, "psStatePaging");
+ process_stats.psStateRunning.encJsonValue(obj, "psStateRunning");
+ process_stats.psStateSleeping.encJsonValue(obj, "psStateSleeping");
+ process_stats.psStateStopped.encJsonValue(obj, "psStateStopped");
+ process_stats.psStateZombie.encJsonValue(obj, "psStateZombie");
+
+ builder.add(obj.build());
+
+
+
+ }
+ evelmeasmt.add("processStatsArray", builder);
+ }
+
+ /***************************************************************************/
+ /* MACHINE_Check_Exception */
+ /***************************************************************************/
+ if( machineCheckException != null && machineCheckException.size()>0) {
+ JsonArrayBuilder builder = Json.createArrayBuilder();
+ for(int i=0;i<machineCheckException.size();i++) {
+ check_exception = machineCheckException.get(i);
+ JsonObjectBuilder obj = Json.createObjectBuilder()
+ .add( "vmIdentifier", check_exception.processIdentifier);
+ check_exception.correctedMemoryErrors.encJsonValue(obj, "correctedMemoryErrors");
+ check_exception.correctedMemoryErrors_In1Hr.encJsonValue(obj, "correctedMemoryErrorsIn1Hr");
+ check_exception.uncorrectedMemoryErrors.encJsonValue(obj, "uncorrectedMemoryErrors");
+ check_exception.uncorrectedMemoryErrors_In1Hr.encJsonValue(obj, "uncorrectedMemoryErrorsIn1Hr");
+
+ builder.add(obj.build());
+
+ }
+ evelmeasmt.add("machineCheckExceptionArray", builder);
+ }
+
+
+ /***************************************************************************/
+ /* MACHINE_Check_Exception */
+ /***************************************************************************/
+ if( huge_pages != null && huge_pages.size()>0) {
+ JsonArrayBuilder builder = Json.createArrayBuilder();
+ for(int i=0;i<huge_pages.size();i++) {
+ hugePage = huge_pages.get(i);
+ JsonObjectBuilder obj = Json.createObjectBuilder();
+ obj.add( "hugePagesIdentifier", hugePage.hugePagesIdentifier);
+ obj.add( "bytesUsed", hugePage.bytesUsed);
+
+
+
+ obj.add("bytesFree", hugePage.bytesFree.value);
+ obj.add("vmPageNumberUsed", hugePage.vmPageNumberUsed.value);
+ obj.add( "vmPageNumberFree", hugePage.vmPageNumberFree.value);
+ obj.add( "percentUsed", hugePage.percentUsed.value);
+ obj.add( "percentFree", hugePage.percentFree.value);
+
+// obj.add( "bytesFree", hugePage.bytesFree);
+// obj.add( "vmPageNumberUsed", hugePage.vmPageNumberUsed);
+// obj.add( "vmPageNumberFree", hugePage.vmPageNumberFree);
+// obj.add( "percentUsed", hugePage.percentUsed);
+// obj.add( "percentFree", hugePage.percentFree);
+
+
+// hugePage.correctedMemoryErrors.encJsonValue(obj, "correctedMemoryErrors");
+// hugePage.correctedMemoryErrors_In1Hr.encJsonValue(obj, "correctedMemoryErrorsIn1Hr");
+// hugePage.uncorrectedMemoryErrors.encJsonValue(obj, "uncorrectedMemoryErrors");
+// hugePage.uncorrectedMemoryErrors_In1Hr.encJsonValue(obj, "uncorrectedMemoryErrorsIn1Hr");
+
+ builder.add(obj.build());
+
+ }
+ evelmeasmt.add("hugePagesArray", builder);
+ }
+
/***************************************************************************/
/* CPU Use list. */
/***************************************************************************/
@@ -3366,14 +5893,224 @@ public class EvelScalingMeasurement extends EvelHeader { cpu_use.steal.encJsonValue(obj,"cpuUsageSteal");
cpu_use.sys.encJsonValue(obj,"cpuUsageSystem");
cpu_use.user.encJsonValue(obj,"cpuUsageUser");
- cpu_use.wait.encJsonValue(obj,"cpuWait");
-
+ cpu_use.wait.encJsonValue(obj,"cpuWait");
+ /*********************
+ * VES6.0 added fields 14/07/2018
+ */
+ cpu_use.cpuCapacityContention.encJsonValue(obj,"cpuCapacityContention");
+ cpu_use.cpuDemandAvg.encJsonValue(obj,"cpuDemandAvg");
+ cpu_use.cpuDemandMhz.encJsonValue(obj,"cpuDemandMhz");
+ cpu_use.cpuDemandPct.encJsonValue(obj,"cpuDemandPct");
+ cpu_use.cpuLatencyAvg.encJsonValue(obj,"cpuLatencyAvg");
+ cpu_use.cpuOverheadAvg.encJsonValue(obj,"cpuOverheadAvg");
+ cpu_use.cpuSwapWaitTime.encJsonValue(obj,"cpuSwapWaitTime");
builder.add(obj.build());
}
evelmeasmt.add("cpuUsageArray", builder);
}
-
+ if(ipmis != null && ipmis.size() > 0) {
+ JsonObjectBuilder builder1 = Json.createObjectBuilder();
+ JsonArrayBuilder builder = Json.createArrayBuilder();
+ System.out.println("ipmis size---"+ ipmis.size());
+ for(int i=0;i<ipmis.size();i++) {
+ ipmij = ipmis.get(i);
+ // JsonObjectBuilder obj= null;
+ JsonObjectBuilder obj = Json.createObjectBuilder();
+ ipmij.exitAirTemperature.encJsonValue(obj, "exitAirTemperature");
+ ipmij.frontPanelTemperature.encJsonValue(obj, "frontPanelTemperature");
+ ipmij.ioModuleTemperature.encJsonValue(obj, "ioModuleTemperature");
+ ipmij.systemAirflow.encJsonValue(obj, "systemAirflow");
+
+
+ if(ipmij.ipmiprocessor != null && ipmij.ipmiprocessor.size() > 0 ) {
+ JsonArrayBuilder ipmi_processor_builder = Json.createArrayBuilder();
+ for(int j=0; j<ipmij.ipmiprocessor.size();j++) {
+ ipmiProcessorJson = ipmij.ipmiprocessor.get(j);
+ JsonObjectBuilder obj1 = Json.createObjectBuilder().add("processorIdentifier", ipmiProcessorJson.processorIdentifier);
+ ipmiProcessorJson.processorDTSthermalMargin.encJsonValue(obj1 , "processorDTSthermalMargin");
+ ipmiProcessorJson.processorThermalControlPercent.encJsonValue(obj1, "processorThermalControlPercent");
+ if(ipmiProcessorJson.processorDIMMaggregateThermalMargin != null &&
+ ipmiProcessorJson.processorDIMMaggregateThermalMargin.size() > 0) {
+ JsonArrayBuilder ipmi_procesor_DTS_thermal_margin = Json.createArrayBuilder();
+ for( int k=0 ;k<ipmiProcessorJson.processorDIMMaggregateThermalMargin.size();k++) {
+
+ ipmiProcessorDIMMagregatejson = ipmiProcessorJson.processorDIMMaggregateThermalMargin.get(k);
+ JsonObjectBuilder obj2 = Json.createObjectBuilder().add("processorDIMMaggregateThermalMarginIdentifier", ipmiProcessorDIMMagregatejson.processorDIMMaggregateThermalMarginIdentifier)
+ .add("processorDIMMaggregateThermalMargin", ipmiProcessorDIMMagregatejson.processorDIMMaggregateThermalMargin);
+
+ ipmi_procesor_DTS_thermal_margin.add(obj2.build());
+ }
+ obj1.add("processorDIMMaggregateThermalMargin", ipmi_procesor_DTS_thermal_margin );
+
+ }
+
+ ipmi_processor_builder.add(obj1.build());
+
+ }
+ // obj.add("ipmiProcessorArray", ipmi_processor_builder);
+ builder1.add("ipmiProcessorArray", ipmi_processor_builder);
+ }
+
+
+ if(ipmij.ipmiglobalAggregateTemperatureMarginArray != null &&
+ ipmij.ipmiglobalAggregateTemperatureMarginArray.size()>0) {
+
+ JsonArrayBuilder ipmi_global_aggregate_tepmerature_margin_array = Json.createArrayBuilder();
+ for(int j=0; j<ipmij.ipmiglobalAggregateTemperatureMarginArray.size();j++) {
+ ipmiGlobalAggTempMarginJson = ipmij.ipmiglobalAggregateTemperatureMarginArray.get(j);
+ JsonObjectBuilder obj1 = Json.createObjectBuilder().add("globalAggregateTemperatureMarginIdentifier", ipmiGlobalAggTempMarginJson.globalAggregateTemperatureMarginIdentifier);
+ ipmiGlobalAggTempMarginJson.globalAggregateTemeratureMargin.encJsonValue(obj1, "globalAggregateTemeratureMargin");
+
+ ipmi_global_aggregate_tepmerature_margin_array.add(obj1.build());
+ }
+
+ // obj.add("globalAggregateTemperatureMarginArray", ipmi_global_aggregate_tepmerature_margin_array );
+ builder1.add("globalAggregateTemperatureMarginArray", ipmi_global_aggregate_tepmerature_margin_array);
+ }
+
+
+
+ if(ipmij.ipmipowerSupply != null &&
+ ipmij.ipmipowerSupply.size()>0) {
+
+ JsonArrayBuilder ipmi_power_supply_array = Json.createArrayBuilder();
+ for(int j=0; j<ipmij.ipmipowerSupply.size();j++) {
+ ipmiPowerSupplyJson = ipmij.ipmipowerSupply.get(j);
+ JsonObjectBuilder obj1 = Json.createObjectBuilder().add("powerSupplyIdentifier", ipmiPowerSupplyJson.powerSupplyIdentifier);
+ ipmiPowerSupplyJson.powerSupplycurrentOutputPercent.encJsonValue(obj1, "powerSupplycurrentOutputPercent");
+ ipmiPowerSupplyJson.powerSupplyInputPower.encJsonValue(obj1, "powerSupplyInputPower");
+ ipmiPowerSupplyJson.powerSupplyTemperature.encJsonValue(obj1, "powerSupplyTemperature");
+
+ ipmi_power_supply_array.add(obj1.build());
+ }
+
+ // obj.add("ipmiPowerSupplyArray", ipmi_power_supply_array );
+ builder1.add("ipmiPowerSupplyArray", ipmi_power_supply_array);
+ }
+
+ if(ipmij.ipmibattery != null && ipmij.ipmibattery.size()>0) {
+
+ JsonArrayBuilder ipmi_battery_array = Json.createArrayBuilder();
+ for(int j=0; j<ipmij.ipmibattery.size();j++) {
+ ipmiBatteryJson = ipmij.ipmibattery.get(j);
+ JsonObjectBuilder obj1 = Json.createObjectBuilder().add("batteryIdentifier", ipmiBatteryJson.batteryIdentifier);
+ ipmiBatteryJson.batteryType.encJsonValue(obj1, "batteryType");
+ ipmiBatteryJson.batteryVoltageLevel.encJsonValue(obj1, "batteryVoltageLevel");
+
+
+ ipmi_battery_array.add(obj1.build());
+ }
+
+ // obj.add("ipmiBatteryArray", ipmi_battery_array );
+ builder1.add("ipmiBatteryArray", ipmi_battery_array);
+
+
+ }
+
+
+ if(ipmij.ipmiNIC != null && ipmij.ipmiNIC.size()>0) {
+
+ JsonArrayBuilder ipmi_Nic_array = Json.createArrayBuilder();
+ for(int j=0; j<ipmij.ipmiNIC.size();j++) {
+ ipmiNicJson = ipmij.ipmiNIC.get(j);
+ JsonObjectBuilder obj1 = Json.createObjectBuilder().add("nicIdentifier", ipmiNicJson.nic_Identifier);
+ ipmiNicJson.nic_Temperature.encJsonValue(obj1, "nicIdentifier");
+
+
+
+ ipmi_Nic_array.add(obj1.build());
+ }
+
+ // obj.add("ipmiNicArray", ipmi_Nic_array );
+ builder1.add("ipmiNicArray", ipmi_Nic_array);
+
+ }
+ if(ipmij.ipmiHSBP != null && ipmij.ipmiHSBP.size()>0) {
+
+ JsonArrayBuilder ipmi_HSBP_array = Json.createArrayBuilder();
+ for(int j=0; j<ipmij.ipmiHSBP.size();j++) {
+ ipmiHsbpJson = ipmij.ipmiHSBP.get(j);
+ JsonObjectBuilder obj1 = Json.createObjectBuilder().add("hsbpIdentifier", ipmiHsbpJson.hsbpIdentifier);
+ ipmiHsbpJson.hsbpTemperature.encJsonValue(obj1, "hsbpTemperature");
+
+
+
+ ipmi_HSBP_array.add(obj1.build());
+ }
+
+ // obj.add("ipmiHsbpArray", ipmi_HSBP_array );
+ builder1.add("ipmiHsbpArray", ipmi_HSBP_array);
+
+ }
+
+
+ if(ipmij.ipmibaseboardTemperature!= null && ipmij.ipmibaseboardTemperature.size()>0) {
+
+ JsonArrayBuilder ipmi_baseboard_Temperature_array = Json.createArrayBuilder();
+ for(int j=0; j<ipmij.ipmibaseboardTemperature.size();j++) {
+ ipmiBaseBoardTempJson = ipmij.ipmibaseboardTemperature.get(j);
+ JsonObjectBuilder obj1 = Json.createObjectBuilder().add("baseboardTemperatureIdentifier", ipmiBaseBoardTempJson.baseboardTemperatureIdentifier);
+ ipmiBaseBoardTempJson.baseboardTemperature.encJsonValue(obj1, "baseboardTemperature");
+
+
+
+ ipmi_baseboard_Temperature_array.add(obj1.build());
+ }
+
+ // obj.add("ipmiBaseboardTemperatureArray", ipmi_baseboard_Temperature_array );
+ builder1.add("ipmiBaseboardTemperatureArray", ipmi_baseboard_Temperature_array);
+
+ }
+
+ if(ipmij.ipmiBaseboardvoltageResulator!= null && ipmij.ipmiBaseboardvoltageResulator.size()>0) {
+
+ JsonArrayBuilder ipmi_Baseboardvoltage_Resulator = Json.createArrayBuilder();
+ for(int j=0; j<ipmij.ipmiBaseboardvoltageResulator.size();j++) {
+ ipmiBaseboardVoltageResultatorJson = ipmij.ipmiBaseboardvoltageResulator.get(j);
+ JsonObjectBuilder obj1 = Json.createObjectBuilder().add("baseboardVoltageRegulatorIdentifier",
+ ipmiBaseboardVoltageResultatorJson.baseboardVoltageRegulatorIdentifier);
+ ipmiBaseboardVoltageResultatorJson.voltageRegulatorTemperature.encJsonValue(obj1, "baseboardTemperature");
+
+
+
+ ipmi_Baseboardvoltage_Resulator.add(obj1.build());
+ }
+
+ // obj.add("ipmiBaseboardVoltageRegulatorArray", ipmi_Baseboardvoltage_Resulator );
+ builder1.add("ipmiBaseboardVoltageRegulatorArray", ipmi_Baseboardvoltage_Resulator);
+
+ }
+
+ if(ipmij.ipmiFan!= null && ipmij.ipmiFan.size()>0) {
+
+ JsonArrayBuilder ipmi_Fan = Json.createArrayBuilder();
+ for(int j=0; j<ipmij.ipmiFan.size();j++) {
+ ipmifanjson = ipmij.ipmiFan.get(j);
+ JsonObjectBuilder obj1 = Json.createObjectBuilder().add("fanIdentifier",
+ ipmifanjson.fanIdentifier);
+ ipmifanjson.fanSpeed.encJsonValue(obj1, "fanSpeed");
+
+
+
+ ipmi_Fan.add(obj1.build());
+ }
+
+ // obj.add("ipmiFanArray", ipmi_Fan );
+ builder1.add("ipmiFanArray", ipmi_Fan);
+
+ }
+
+
+
+
+
+
+ builder.add(obj.build());
+ }
+ //evelmeasmt.add("ipmi", builder) ;
+ evelmeasmt.add("ipmi", builder1) ;
+ }
/***************************************************************************/
/* Disk Use list. */
@@ -3426,6 +6163,24 @@ public class EvelScalingMeasurement extends EvelHeader { disk_use.timewritelast.encJsonValue(obj,"diskTimeWriteLast");
disk_use.timewritemax.encJsonValue(obj,"diskTimeWriteMax");
disk_use.timewritemin.encJsonValue(obj,"diskTimeWriteMin");
+
+ disk_use.diskTime.encJsonValue(obj, "diskTime");
+ disk_use.diskFlushRequests.encJsonValue(obj, "diskFlushRequests");
+ disk_use.diskFlushTime.encJsonValue(obj, "diskFlushTime");
+ disk_use.diskCommandsAvg.encJsonValue(obj, "diskCommandsAvg");
+ disk_use.diskReadCommandsAvg.encJsonValue(obj, "diskReadCommandsAvg");
+ disk_use.diskWriteCommandsAvg.encJsonValue(obj, "diskWriteCommandsAvg");
+ disk_use.diskCommandsAborted.encJsonValue(obj, "diskCommandsAborted");
+ disk_use.diskBusResets.encJsonValue(obj, "diskBusResets");
+ disk_use.diskTotalReadLatencyAvg.encJsonValue(obj, "diskTotalReadLatencyAvg");
+ disk_use.diskTotalWriteLatencyAvg.encJsonValue(obj, "diskTotalWriteLatencyAvg");
+
+ disk_use.diskWeightedIoTimeAvg.encJsonValue(obj, "diskWeightedIoTimeAvg");
+ disk_use.diskWeightedIoTimeLast.encJsonValue(obj, "diskWeightedIoTimeLast");
+ disk_use.diskWeightedIoTimeMax.encJsonValue(obj, "diskWeightedIoTimeMax");
+ disk_use.diskWeightedIoTimeMin.encJsonValue(obj, "diskWeightedIoTimeMin");
+
+
builder.add(obj.build());
}
@@ -3484,52 +6239,67 @@ public class EvelScalingMeasurement extends EvelHeader { {
JsonArrayBuilder builder = Json.createArrayBuilder();
for(int i=0;i<vnic_usage.size();i++) {
- vnic_use = vnic_usage.get(i);
+ nic_use = vnic_usage.get(i);
JsonObjectBuilder obj = Json.createObjectBuilder()
- .add( "vNicIdentifier", vnic_use.vnic_id)
- .add( "valuesAreSuspect",vnic_use.valuesaresuspect);
+ .add( "nicIdentifier", nic_use.vnic_id)
+ .add( "valuesAreSuspect",nic_use.valuesaresuspect);
/*********************************************************************/
/* Optional fields. */
/*********************************************************************/
- vnic_use.recvd_bcast_packets_acc.encJsonValue(obj,"receivedBroadcastPacketsAccumulated");
- vnic_use.recvd_bcast_packets_delta.encJsonValue(obj,"receivedBroadcastPacketsDelta");
- vnic_use.recvd_discarded_packets_acc.encJsonValue(obj,"receivedDiscardedPacketsAccumulated");
- vnic_use.recvd_discarded_packets_delta.encJsonValue(obj,"receivedDiscardedPacketsDelta");
- vnic_use.recvd_error_packets_acc.encJsonValue(obj,"receivedErrorPacketsAccumulated");
- vnic_use.recvd_error_packets_delta.encJsonValue(obj,"receivedErrorPacketsDelta");
-
- vnic_use.recvd_mcast_packets_acc.encJsonValue(obj,"receivedMulticastPacketsAccumulated");
- vnic_use.recvd_mcast_packets_delta.encJsonValue(obj,"receivedMulticastPacketsDelta");
- vnic_use.recvd_octets_acc.encJsonValue(obj,"receivedOctetsAccumulated");
- vnic_use.recvd_octets_delta.encJsonValue(obj,"receivedOctetsDelta");
-
- vnic_use.recvd_total_packets_acc.encJsonValue(obj,"receivedTotalPacketsAccumulated");
- vnic_use.recvd_total_packets_delta.encJsonValue(obj,"receivedTotalPacketsDelta");
- vnic_use.recvd_ucast_packets_acc.encJsonValue(obj,"receivedUnicastPacketsAccumulated");
- vnic_use.recvd_ucast_packets_delta.encJsonValue(obj,"receivedUnicastPacketsDelta");
-
- vnic_use.tx_bcast_packets_acc.encJsonValue(obj,"transmittedBroadcastPacketsAccumulated");
- vnic_use.tx_bcast_packets_delta.encJsonValue(obj,"transmittedBroadcastPacketsDelta");
- vnic_use.tx_discarded_packets_acc.encJsonValue(obj,"transmittedDiscardedPacketsAccumulated");
- vnic_use.tx_discarded_packets_delta.encJsonValue(obj,"transmittedDiscardedPacketsDelta");
-
- vnic_use.tx_error_packets_acc.encJsonValue(obj,"transmittedErrorPacketsAccumulated");
- vnic_use.tx_error_packets_delta.encJsonValue(obj,"transmittedErrorPacketsDelta");
- vnic_use.tx_mcast_packets_acc.encJsonValue(obj,"transmittedMulticastPacketsAccumulated");
- vnic_use.tx_mcast_packets_delta.encJsonValue(obj,"transmittedMulticastPacketsDelta");
-
- vnic_use.tx_octets_acc.encJsonValue(obj,"transmittedOctetsAccumulated");
- vnic_use.tx_octets_delta.encJsonValue(obj,"transmittedOctetsDelta");
- vnic_use.tx_total_packets_acc.encJsonValue(obj,"transmittedTotalPacketsAccumulated");
- vnic_use.tx_total_packets_delta.encJsonValue(obj,"transmittedTotalPacketsDelta");
- vnic_use.tx_ucast_packets_acc.encJsonValue(obj,"transmittedUnicastPacketsAccumulated");
- vnic_use.tx_ucast_packets_delta.encJsonValue(obj,"transmittedUnicastPacketsDelta");
+ nic_use.recvd_bcast_packets_acc.encJsonValue(obj,"receivedBroadcastPacketsAccumulated");
+ nic_use.recvd_bcast_packets_delta.encJsonValue(obj,"receivedBroadcastPacketsDelta");
+ nic_use.recvd_discarded_packets_acc.encJsonValue(obj,"receivedDiscardedPacketsAccumulated");
+ nic_use.recvd_discarded_packets_delta.encJsonValue(obj,"receivedDiscardedPacketsDelta");
+ nic_use.recvd_error_packets_acc.encJsonValue(obj,"receivedErrorPacketsAccumulated");
+ nic_use.recvd_error_packets_delta.encJsonValue(obj,"receivedErrorPacketsDelta");
+
+ nic_use.recvd_mcast_packets_acc.encJsonValue(obj,"receivedMulticastPacketsAccumulated");
+ nic_use.recvd_mcast_packets_delta.encJsonValue(obj,"receivedMulticastPacketsDelta");
+ nic_use.recvd_octets_acc.encJsonValue(obj,"receivedOctetsAccumulated");
+ nic_use.recvd_octets_delta.encJsonValue(obj,"receivedOctetsDelta");
+
+ nic_use.recvd_total_packets_acc.encJsonValue(obj,"receivedTotalPacketsAccumulated");
+ nic_use.recvd_total_packets_delta.encJsonValue(obj,"receivedTotalPacketsDelta");
+ nic_use.recvd_ucast_packets_acc.encJsonValue(obj,"receivedUnicastPacketsAccumulated");
+ nic_use.recvd_ucast_packets_delta.encJsonValue(obj,"receivedUnicastPacketsDelta");
+
+ nic_use.tx_bcast_packets_acc.encJsonValue(obj,"transmittedBroadcastPacketsAccumulated");
+ nic_use.tx_bcast_packets_delta.encJsonValue(obj,"transmittedBroadcastPacketsDelta");
+ nic_use.tx_discarded_packets_acc.encJsonValue(obj,"transmittedDiscardedPacketsAccumulated");
+ nic_use.tx_discarded_packets_delta.encJsonValue(obj,"transmittedDiscardedPacketsDelta");
+
+ nic_use.tx_error_packets_acc.encJsonValue(obj,"transmittedErrorPacketsAccumulated");
+ nic_use.tx_error_packets_delta.encJsonValue(obj,"transmittedErrorPacketsDelta");
+ nic_use.tx_mcast_packets_acc.encJsonValue(obj,"transmittedMulticastPacketsAccumulated");
+ nic_use.tx_mcast_packets_delta.encJsonValue(obj,"transmittedMulticastPacketsDelta");
+
+ nic_use.tx_octets_acc.encJsonValue(obj,"transmittedOctetsAccumulated");
+ nic_use.tx_octets_delta.encJsonValue(obj,"transmittedOctetsDelta");
+ nic_use.tx_total_packets_acc.encJsonValue(obj,"transmittedTotalPacketsAccumulated");
+ nic_use.tx_total_packets_delta.encJsonValue(obj,"transmittedTotalPacketsDelta");
+ nic_use.tx_ucast_packets_acc.encJsonValue(obj,"transmittedUnicastPacketsAccumulated");
+ nic_use.tx_ucast_packets_delta.encJsonValue(obj,"transmittedUnicastPacketsDelta");
+
+ //VES6.0 added fields 19July
+ nic_use.administrativeState.encJsonValue(obj, "administrativeState");
+ nic_use.administrativeState.encJsonValue(obj, "administrativeState");
+ nic_use.operationalState.encJsonValue(obj, "operationalState");
+ nic_use.receivedPercentDiscard.encJsonValue(obj, "receivedPercentDiscard");
+ nic_use.receivedPercentError.encJsonValue(obj, "receivedPercentError");
+ nic_use.receivedUtilization.encJsonValue(obj, "receivedUtilization");
+ nic_use.speed.encJsonValue(obj, "speed");
+ nic_use.transmittedPercentDiscard.encJsonValue(obj, "transmittedPercentDiscard");
+ nic_use.transmittedPercentError.encJsonValue(obj, "transmittedPercentError");
+ nic_use.transmittedUtilization.encJsonValue(obj, "transmittedUtilization");
+
+
+
builder.add(obj.build());
}
- evelmeasmt.add("vNicPerformanceArray", builder);
+ evelmeasmt.add("nicPerformanceArray", builder);
}
@@ -3543,9 +6313,9 @@ public class EvelScalingMeasurement extends EvelHeader { for(int i=0;i<mem_usage.size();i++) {
mem_use = mem_usage.get(i);
JsonObjectBuilder obj = Json.createObjectBuilder()
- .add( "memIdentifier", mem_use.id)
+ // .add( "memIdentifier", mem_use.id)
.add( "vmIdentifier", mem_use.vmid)
- .add( "percentUsage",mem_use.membuffsz);
+ .add( "percentMemoryUsage",mem_use.membuffsz);
mem_use.memcache.encJsonValue(obj,"memoryCached");
mem_use.memconfig.encJsonValue(obj,"memoryConfigured");
@@ -3556,37 +6326,38 @@ public class EvelScalingMeasurement extends EvelHeader { builder.add(obj.build());
}
- evelmeasmt.add("memUsageArray", builder);
+ evelmeasmt.add("memoryUsageArray", builder);
}
media_ports_in_use.encJsonValue(evelmeasmt, "numberOfMediaPortsInUse");
- vnfc_scaling_metric.encJsonValue(evelmeasmt, "vnfcScalingMetric");
+ vnfc_scaling_metric.encJsonValue(evelmeasmt, "nfcScalingMetric");
/***************************************************************************/
/* myerrors list. */
/***************************************************************************/
- if (errstat == true && myerrors != null)
- {
- evelmeasmt.add("receiveDiscards", myerrors.receive_discards);
- evelmeasmt.add("receivemyerrors", myerrors.receive_myerrors);
- evelmeasmt.add("transmitDiscards", myerrors.transmit_discards);
- evelmeasmt.add("transmitmyerrors", myerrors.transmit_myerrors);
- }
+ // if (errstat == true && myerrors != null)
+ // {
+ // evelmeasmt.add("receiveDiscards", myerrors.receive_discards);
+ // evelmeasmt.add("receivemyerrors", myerrors.receive_myerrors);
+ // evelmeasmt.add("transmitDiscards", myerrors.transmit_discards);
+ // evelmeasmt.add("transmitmyerrors", myerrors.transmit_myerrors);
+ // }
/***************************************************************************/
/* Feature Utilization list. */
/***************************************************************************/
if( feature_usage != null && feature_usage.size() > 0 )
{
- JsonArrayBuilder builder = Json.createArrayBuilder();
+ JsonObjectBuilder builder = Json.createObjectBuilder();
+ // JsonArrayBuilder builder = Json.createArrayBuilder();
for(int i=0;i<feature_usage.size();i++) {
feature_use = feature_usage.get(i);
- JsonObjectBuilder obj = Json.createObjectBuilder()
- .add( "featureIdentifier", feature_use.feature_id)
- .add( "featureUtilization", feature_use.feature_utilization);
+// JsonObjectBuilder obj = Json.createObjectBuilder()
+// .add( "featureIdentifier", feature_use.feature_id)
+// .add( "featureUtilization", feature_use.feature_utilization);
- builder.add(obj.build());
+ builder.add(feature_use.feature_id, feature_use.feature_utilization+"");
}
evelmeasmt.add("featureUsageArray", builder);
}
@@ -3597,14 +6368,15 @@ public class EvelScalingMeasurement extends EvelHeader { /***************************************************************************/
if( codec_usage != null && codec_usage.size() > 0 )
{
- JsonArrayBuilder builder = Json.createArrayBuilder();
+ //JsonObjectBuilder builder = Json.createObjectBuilder();
+ JsonArrayBuilder builder = Json.createArrayBuilder();
for(int i=0;i<codec_usage.size();i++) {
codec_use = codec_usage.get(i);
JsonObjectBuilder obj = Json.createObjectBuilder()
.add( "codecIdentifier", codec_use.codec_id)
.add( "numberInUse", codec_use.number_in_use);
- builder.add(obj.build());
+ builder.add(obj);
}
evelmeasmt.add("codecUsageArray", builder);
}
@@ -3620,16 +6392,19 @@ public class EvelScalingMeasurement extends EvelHeader { meas_group = additional_measurements.get(i);
JsonObjectBuilder obj = Json.createObjectBuilder()
.add( "name", meas_group.name);
- JsonArrayBuilder builder2 = Json.createArrayBuilder();
+ JsonObjectBuilder builder2 = Json.createObjectBuilder();
+
for(int j=0;j<meas_group.measurements.size();j++) {
custom_meas = meas_group.measurements.get(j);
- JsonObjectBuilder obj2 = Json.createObjectBuilder()
- .add("name",custom_meas.name)
- .add("value",custom_meas.value);
- builder2.add(obj2.build());
+// JsonObjectBuilder obj2 = Json.createObjectBuilder()
+// .add("name",custom_meas.name)
+// .add("value",custom_meas.value);
+ builder2.add(custom_meas.name, custom_meas.value);
}
- obj.add("arrayOfFields", builder2);
+ obj.add("hashMap", builder2);
builder.add(obj.build());
+
+
}
evelmeasmt.add("additionalMeasurements", builder);
}
@@ -3651,7 +6426,7 @@ public class EvelScalingMeasurement extends EvelHeader { /* Although optional, we always generate the version. Note that this */
/* closes the object, too. */
/***************************************************************************/
- evelmeasmt.add("measurementsForVfScalingVersion", version);
+ evelmeasmt.add("measurementFieldsVersion", version);
EVEL_EXIT();
@@ -3672,7 +6447,7 @@ public class EvelScalingMeasurement extends EvelHeader { JsonObject obj = Json.createObjectBuilder()
.add("event", Json.createObjectBuilder()
.add( "commonEventHeader",eventHeaderObject() )
- .add( "measurementsForVfScalingFields",evelScalingMeasurementObject() )
+ .add( "measurementFields",evelScalingMeasurementObject() )
).build();
EVEL_EXIT();
@@ -3682,4 +6457,4 @@ public class EvelScalingMeasurement extends EvelHeader { }
-}
+}
\ No newline at end of file diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelSipSignaling.java b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelSipSignaling.java index a4a3b21..f720a36 100644 --- a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelSipSignaling.java +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelSipSignaling.java @@ -471,8 +471,8 @@ public class EvelSipSignaling extends EvelHeader { JsonObjectBuilder evelSipSignalingObject()
{
- double version = major_version+(double)minor_version/10;
-
+ // double version = major_version+(double)minor_version/10;
+ String version = "3.0";
EVEL_ENTER();
/***************************************************************************/
@@ -486,8 +486,8 @@ public class EvelSipSignaling 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 evelsip = Json.createObjectBuilder()
.add("correlator", correlator)
@@ -495,8 +495,8 @@ public class EvelSipSignaling extends EvelHeader { .add("localPort", local_port)
.add("remoteIpAddress", remote_ip_address)
.add("remotePort", remote_port)
- .add("vendorVnfNamedFields", vnfnamedobj);
-
+ .add("vendorNfNameFields", vnfnamedobj);
+
/***************************************************************************/
/* Optional fields. */
@@ -508,15 +508,16 @@ public class EvelSipSignaling extends EvelHeader { // additional fields
if( additional_info != null )
{
- JsonArrayBuilder builder = Json.createArrayBuilder();
+ JsonObjectBuilder builder = Json.createObjectBuilder();
+ //JsonArrayBuilder builder = Json.createArrayBuilder();
for(int i=0;i<additional_info.size();i++) {
String[] addl_info = additional_info.get(i);
- JsonObject obj = Json.createObjectBuilder()
- .add("name", addl_info[0])
- .add("value", addl_info[1]).build();
- builder.add(obj);
+// JsonObject obj = Json.createObjectBuilder()
+// .add("name", addl_info[0])
+// .add("value", addl_info[1]).build();
+ builder.add(addl_info[0], addl_info[1]);
}
- evelsip.add("additionalFields", builder);
+ evelsip.add("additionalInformation", builder);
}
@@ -524,7 +525,7 @@ public class EvelSipSignaling extends EvelHeader { /* Although optional, we always generate the version. Note that this */
/* closes the object, too. */
/***************************************************************************/
- evelsip.add("signalingFieldsVersion", version);
+ evelsip.add("sipSignalingFieldsVersion", version);
EVEL_EXIT();
@@ -545,7 +546,7 @@ public class EvelSipSignaling extends EvelHeader { JsonObject obj = Json.createObjectBuilder()
.add("event", Json.createObjectBuilder()
.add( "commonEventHeader",eventHeaderObject() )
- .add( "signalingFields",evelSipSignalingObject() )
+ .add( "sipSignalingFields",evelSipSignalingObject() )
).build();
EVEL_EXIT();
diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelStateChange.java b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelStateChange.java index 555e700..90df4d6 100644 --- a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelStateChange.java +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/EvelStateChange.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;
@@ -58,11 +62,13 @@ public class EvelStateChange extends EvelHeader { EVEL_ENTITY_STATE new_state;
EVEL_ENTITY_STATE old_state;
String state_interface;
+
/***************************************************************************/
/* Optional fields */
/***************************************************************************/
- ArrayList<String[]> additional_info;
+ // ArrayList<String[]> additional_info;
+ HashMap<String, String > 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<String[]>();
+ 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<additional_info.size();i++) {
@@ -224,6 +230,23 @@ public class EvelStateChange extends EvelHeader { builder.add(obj);
}
evelstate.add("additionalFields", builder);
+ } */
+
+
+ if(additional_inf != null) {
+ //JsonArrayBuilder builder = Json.createArrayBuilder();
+ JsonObjectBuilder builder = Json.createObjectBuilder();
+ Iterator<Entry<String, String>> it = additional_inf.entrySet().iterator();
+ while(it.hasNext()) {
+ Map.Entry<String, String> add_inf = (Map.Entry<String, String>)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<String, String > 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<Entry<String, String>> it = additional_inf.entrySet().iterator();
+ while(it.hasNext()) {
+ Map.Entry<String, String> add_inf = (Map.Entry<String, String>)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<String,String> hashMap;
+
}
PERF_COUNTER additionalParameters;
@@ -94,7 +104,10 @@ public class EvelThresholdCross extends EvelHeader { /***************************************************************************/
/* Optional fields */
/***************************************************************************/
- ArrayList<String[]> additional_info;
+ //ArrayList<String[]> additional_info;
+ Map<String,String> additional_inf;
+
+
EvelOptionString alertValue;
ArrayList<String> 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<String[]>();
+ // additional_info = new ArrayList<String[]>();
+ additional_inf = new HashMap<String,String>();
}
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<String[]>();
+ additionalParameters.hashMap = new HashMap<String,String>();
+ }
- 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<Entry<String, String>> it = additionalParameters.hashMap.entrySet().iterator();
+ while(it.hasNext()) {
+ Map.Entry<String, String> add_inf = (Map.Entry<String, String>)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<alertidList.size();i++) {
+// String addl_info = alertidList.get(i);
+// JsonObject obj = Json.createObjectBuilder()
+// .add("item",addl_info).build();
+// builder.add(obj);
+// }
+// evelrep.add("associatedAlertIdList", builder);
+//
+// }
+
+
if( alertidList != null && alertidList.size() > 0)
{
JsonArrayBuilder builder = Json.createArrayBuilder();
for(int i=0;i<alertidList.size();i++) {
String addl_info = alertidList.get(i);
- JsonObject obj = Json.createObjectBuilder()
- .add("item",addl_info).build();
- builder.add(obj);
+ builder.add( addl_info);
+ //srikant send string array instedof itme and strting
+ // JsonObject obj = Json.createObjectBuilder()
+ // .add("item",addl_info).build();
+ // builder.add(obj);
}
evelrep.add("associatedAlertIdList", builder);
+
}
+
- dataCollector.encJsonValue(evelrep, "dataCollector");
- elementType.encJsonValue(evelrep, "elementType");
- interfaceName.encJsonValue(evelrep, "interfaceName");
- networkService.encJsonValue(evelrep, "networkService");
- possibleRootCause.encJsonValue(evelrep, "possibleRootCause");
+
- evelrep.add( "thresholdCrossingFieldsVersion", version);
-
- if( additional_info != null )
- {
- JsonArrayBuilder builder = Json.createArrayBuilder();
- for(int i=0;i<additional_info.size();i++) {
- String[] addl_info = additional_info.get(i);
- JsonObject obj = Json.createObjectBuilder()
- .add("name", addl_info[0])
- .add("value", addl_info[1]).build();
- builder.add(obj);
- }
- evelrep.add("additionalFields", builder);
+
+
+
+
+ if(additional_inf != null) {
+ //JsonArrayBuilder builder = Json.createArrayBuilder();
+ JsonObjectBuilder builder = Json.createObjectBuilder();
+ Iterator<Entry<String, String>> it = additional_inf.entrySet().iterator();
+ while(it.hasNext()) {
+ Map.Entry<String, String> add_inf = (Map.Entry<String, String>)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<additional_info.size();i++) {
String[] addl_info = additional_info.get(i);
- JsonObject obj = Json.createObjectBuilder()
- .add("name", addl_info[0])
- .add("value", addl_info[1]).build();
- builder.add(obj);
+// JsonObject obj = Json.createObjectBuilder()
+// .add("name", addl_info[0])
+// .add("value", addl_info[1]).build();
+ builder.add(addl_info[0], addl_info[1]);
}
- evelvq.add("additionalFields", builder);
+ evelvq.add("additionalInformation", builder);
}
@@ -630,8 +697,30 @@ public class EvelVoiceQuality extends EvelHeader { vQMetrics.packetLossPercent.encJsonValue(obj,"packetLossPercent");
vQMetrics.rFactor.encJsonValue(obj,"rFactor");
vQMetrics.roundTripDelay.encJsonValue(obj,"roundTripDelay");
+
+ /*
+ * Ves6.0 AddedFields 15/07/2018
+ * */
+
+ vQMetrics.endpointAverageJitter.encJsonValue(obj, "endpointAverageJitter");
+ vQMetrics.endpointMaxJitter.encJsonValue(obj, "endpointMaxJitter");
+ vQMetrics.endpointRtpOctetsLost.encJsonValue(obj, "endpointRtpOctetsLost");
+ vQMetrics.endpointRtpPacketsLost.encJsonValue(obj, "endpointRtpPacketsLost");
+ vQMetrics.localAverageJitter.encJsonValue(obj, "localAverageJitter");
+ vQMetrics.localMaxJitter.encJsonValue(obj, "endpointRtpOctetsLost");
+ System.out.println("local aveg jitter buffer delay...");
+ vQMetrics.localAverageJitterBufferDelay.encJsonValue(obj, "localAverageJitterBufferDelay");
+
+ vQMetrics.localMaxJitterBufferDelay.encJsonValue(obj, "localMaxJitterBufferDelay");
+ vQMetrics.localRtpOctetsLost.encJsonValue(obj, "localRtpOctetsLost");
+ vQMetrics.localRtpPacketsLost.encJsonValue(obj, "localRtpPacketsLost");
+ vQMetrics.oneWayDelay.encJsonValue(obj, "oneWayDelay");
+
+
evelvq.add("endOfCallVqmSummaries", obj);
+ System.out.println("local aveg jitter buffer delay...2"+ obj);
+ System.out.println("local aveg jitter buffer delay..."+ evelvq);
}
diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/Main.java b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/Main.java new file mode 100644 index 0000000..83f97e1 --- /dev/null +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/Main.java @@ -0,0 +1,64 @@ +package evel_javalibrary.att.com.loadbalance; +/**************************************************************************//** + * @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.Level; + +import evel_javalibrary.att.com.AgentMain; +//import evel_javalibrary.att.com.MeasureData; +//import evel_javalibrary.att.com.heartBeatData; + + + + + +public class Main { + + public static void main(String[] args) { + // TODO Auto-generated method stub + + try { + AgentMain.evel_initialize("http://127.0.0.1", 30000, + null,null, + "will", + "pill", + null, null, null, + Level.TRACE); + }catch(Exception e) { + e.printStackTrace(); + return; + } + MeasureData mdataThread = new MeasureData(); + mdataThread.start(); + + heartBeatData hbDataThread = new heartBeatData(); + hbDataThread.start(); + + faultData flDataThread = new faultData(); + flDataThread.start(); + + } + +} + diff --git a/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/MeasureData.java b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/MeasureData.java new file mode 100644 index 0000000..38c517a --- /dev/null +++ b/veslibrary/ves_javalibrary/evel_javalib2/src/main/java/evel_javalibrary/att/com/loadbalance/MeasureData.java @@ -0,0 +1,375 @@ +package evel_javalibrary.att.com.loadbalance; +/**************************************************************************//** + * @file + * Measurement class + * + * This file implements the Measurement 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 CPU, Memory, Disk Measurements to Collector. + * + * 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.BufferedReader; +import java.io.File; +import java.io.InputStreamReader; +import java.nio.charset.Charset; +import java.nio.file.Files; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import org.apache.log4j.Level; + +import evel_javalibrary.att.com.AgentMain; +import evel_javalibrary.att.com.EvelBatch; +import evel_javalibrary.att.com.EvelScalingMeasurement; + +public class MeasureData extends Thread{ + static HashMap<String, String> hm = new HashMap<>(); + static HashMap<String, String> vpp_metrics = new HashMap<>(); + + static HashMap<String, String> 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<String, String> 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<String, String> read_vpp_metrics(String linkStart) { + Process p; + + String s=""; + HashMap<String, String> 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<String, String> read_common_config_file() { + + List<String> list = new ArrayList<String>(); + + + 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<String, String> read_interface_config_file() { + + List<String> list = new ArrayList<String>(); + HashMap<String, String> 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<String, String> read_meas_config_file() { + + List<String> list = new ArrayList<String>(); + + 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<String, String> read_meas_traffic() { + Process p; + List<String> vpp_params = new ArrayList(); + String s=""; + // HashMap<String, String> 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<String, String> fault_config = new HashMap<>(); + static HashMap<String, String> interface_config = new HashMap<>(); + + static HashMap<String, String> 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<String, String> 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<String, String> read_fault_config_file() { + + List<String> list = new ArrayList<String>(); + + List<String> list_interface = new ArrayList<String>(); + + 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<String, String> hm = new HashMap<>(); + static HashMap<String, String> 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<String, String> read_hb_config_file() { + + List<String> list = new ArrayList<String>(); + + 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); - - } } |