geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tush...@apache.org
Subject [02/79] [partial] incubator-geode git commit: GEODE-12: Imported pulse from geode-1.0.0-SNAPSHOT-2.src.tar
Date Tue, 03 Nov 2015 11:25:24 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1922937f/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/AggregateStatement.java
----------------------------------------------------------------------
diff --git a/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/AggregateStatement.java
b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/AggregateStatement.java
new file mode 100644
index 0000000..0d7fa46
--- /dev/null
+++ b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/AggregateStatement.java
@@ -0,0 +1,206 @@
+/*=========================================================================
+ * Copyright (c) 2012-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.vmware.gemfire.tools.pulse.tests;
+
+public class AggregateStatement extends JMXBaseBean implements AggregateStatementMBean {
+  private String name = null;
+
+  public AggregateStatement(String name) {
+    this.name = name;
+  }
+
+  protected String getKey(String propName) {
+    return "aggregatestatement." + name + "." + propName;
+  }
+  
+  /**
+   * Query definition
+   * 
+   * @return
+   */
+  public String getQueryDefinition(){
+    return getString("queryDefinition");
+  }
+
+  /**
+   * Number of times this statement is compiled (including re compilations)
+   * 
+   * @return
+   */
+  @Override
+  public long getNumTimesCompiled(){
+    return getLong("numTimesCompiled");
+  }
+
+  /**
+   * Number of times this statement is executed
+   * 
+   * @return
+   */
+  @Override
+  public long getNumExecution(){
+    return getLong("numExecution");
+  }
+
+  /**
+   * Statements that are actively being processed during the statistics snapshot
+   * 
+   * @return
+   */
+  public long getNumExecutionsInProgress(){
+    return getLong("numExecutionsInProgress");
+  }
+
+  /**
+   * Number of times global index lookup message exchanges occurred
+   * 
+   * @return
+   */
+  public long getNumTimesGlobalIndexLookup(){
+    return getLong("numTimesGlobalIndexLookup");
+  }
+
+  /**
+   * Number of rows modified by DML operation of insert/delete/update
+   * 
+   * @return
+   */
+  public long getNumRowsModified(){
+    return getLong("numRowsModified");
+  }
+
+  /**
+   * Time spent(in milliseconds) in parsing the query string
+   * 
+   * @return
+   */
+  public long getParseTime(){
+    return getLong("parseTime");
+  }
+
+  /**
+   * Time spent (in milliseconds) mapping this statement with database object's metadata
(bind)
+   * 
+   * @return
+   */
+  public long getBindTime(){
+    return getLong("bindTime");
+  }
+
+  /**
+   * Time spent (in milliseconds) determining the best execution path for this statement
+   * (optimize)
+   * 
+   * @return
+   */
+  public long getOptimizeTime(){
+    return getLong("optimizeTime");
+  }
+
+  /**
+   * Time spent (in milliseconds) compiling details about routing information of query strings
to
+   * data node(s) (processQueryInfo)
+   * 
+   * @return
+   */
+  public long getRoutingInfoTime(){
+    return getLong("routingInfoTime");
+  }
+
+  /**
+   * Time spent (in milliseconds) to generate query execution plan definition (activation
class)
+   * 
+   * @return
+   */
+  public long getGenerateTime(){
+    return getLong("generateTime");
+  }
+
+  /**
+   * Total compilation time (in milliseconds) of the statement on this node (prepMinion)
+   * 
+   * @return
+   */
+  public long getTotalCompilationTime(){
+    return getLong("totalCompilationTime");
+  }
+
+  /**
+   * Time spent (in nanoseconds) in creation of all the layers of query processing (ac.execute)
+   * 
+   * @return
+   */
+  public long getExecutionTime(){
+    return getLong("executionTime");
+  }
+
+  /**
+   * Time to apply (in nanoseconds) the projection and additional filters. (projectrestrict)
+   * 
+   * @return
+   */
+  public long getProjectionTime(){
+    return getLong("projectionTime");
+  }
+
+  /**
+   * Total execution time (in nanoseconds) taken to process the statement on this node
+   * (execute/open/next/close)
+   * 
+   * @return
+   */
+  public long getTotalExecutionTime(){
+    return getLong("totalExecutionTime");
+  }
+
+  /**
+   * Time taken (in nanoseconds) to modify rows by DML operation of insert/delete/update
+   * 
+   * @return
+   */
+  public long getRowsModificationTime(){
+    return getLong("rowsModificationTime");
+  }
+
+  /**
+   * Number of rows returned from remote nodes (ResultHolder/Get convertibles)
+   * 
+   * @return
+   */
+  public long getQNNumRowsSeen(){
+    return getLong("qnNumRowsSeen");
+  }
+
+  /**
+   * TCP send time (in nanoseconds) of all the messages including serialization time and
queue
+   * wait time
+   * 
+   * @return
+   */
+  public long getQNMsgSendTime(){
+    return getLong("qnMsgSendTime");
+  }
+
+  /**
+   * Serialization time (in nanoseconds) for all the messages while sending to remote node(s)
+   * 
+   * @return
+   */
+  public long getQNMsgSerTime(){
+    return getLong("qnMsgSerTime");
+  }
+  
+  /**
+   * 
+   * 
+   * @return
+   */
+  public long getQNRespDeSerTime(){
+    return getLong("qnRespDeSerTime");
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1922937f/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/AggregateStatementMBean.java
----------------------------------------------------------------------
diff --git a/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/AggregateStatementMBean.java
b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/AggregateStatementMBean.java
new file mode 100644
index 0000000..1758d1e
--- /dev/null
+++ b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/AggregateStatementMBean.java
@@ -0,0 +1,157 @@
+/*=========================================================================
+ * Copyright (c) 2012-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.vmware.gemfire.tools.pulse.tests;
+
+public interface AggregateStatementMBean {
+  public static final String OBJECT_NAME = "GemFireXD:service=Statement,type=Aggregate";
+
+  /**
+   * Query definition
+   *
+   * @return
+   */
+  public String getQueryDefinition();
+
+  /**
+   * Number of times this statement is compiled (including re compilations)
+   *
+   * @return
+   */
+  public long getNumTimesCompiled();
+
+  /**
+   * Number of times this statement is executed
+   *
+   * @return
+   */
+  public long getNumExecution();
+
+  /**
+   * Statements that are actively being processed during the statistics snapshot
+   *
+   * @return
+   */
+  public long getNumExecutionsInProgress();
+
+  /**
+   * Number of times global index lookup message exchanges occurred
+   *
+   * @return
+   */
+  public long getNumTimesGlobalIndexLookup();
+
+  /**
+   * Number of rows modified by DML operation of insert/delete/update
+   *
+   * @return
+   */
+  public long getNumRowsModified();
+
+  /**
+   * Time spent(in milliseconds) in parsing the query string
+   *
+   * @return
+   */
+  public long getParseTime();
+
+  /**
+   * Time spent (in milliseconds) mapping this statement with database object's metadata
(bind)
+   *
+   * @return
+   */
+  public long getBindTime();
+
+  /**
+   * Time spent (in milliseconds) determining the best execution path for this statement
+   * (optimize)
+   *
+   * @return
+   */
+  public long getOptimizeTime();
+
+  /**
+   * Time spent (in milliseconds) compiling details about routing information of query strings
to
+   * data node(s) (processQueryInfo)
+   *
+   * @return
+   */
+  public long getRoutingInfoTime();
+
+  /**
+   * Time spent (in milliseconds) to generate query execution plan definition (activation
class)
+   *
+   * @return
+   */
+  public long getGenerateTime();
+
+  /**
+   * Total compilation time (in milliseconds) of the statement on this node (prepMinion)
+   *
+   * @return
+   */
+  public long getTotalCompilationTime();
+
+  /**
+   * Time spent (in nanoseconds) in creation of all the layers of query processing (ac.execute)
+   *
+   * @return
+   */
+  public long getExecutionTime();
+
+  /**
+   * Time to apply (in nanoseconds) the projection and additional filters. (projectrestrict)
+   *
+   * @return
+   */
+  public long getProjectionTime();
+
+  /**
+   * Total execution time (in nanoseconds) taken to process the statement on this node
+   * (execute/open/next/close)
+   *
+   * @return
+   */
+  public long getTotalExecutionTime();
+
+  /**
+   * Time taken (in nanoseconds) to modify rows by DML operation of insert/delete/update
+   *
+   * @return
+   */
+  public long getRowsModificationTime();
+
+  /**
+   * Number of rows returned from remote nodes (ResultHolder/Get convertibles)
+   *
+   * @return
+   */
+  public long getQNNumRowsSeen();
+
+  /**
+   * TCP send time (in nanoseconds) of all the messages including serialization time and
queue
+   * wait time
+   *
+   * @return
+   */
+  public long getQNMsgSendTime();
+
+  /**
+   * Serialization time (in nanoseconds) for all the messages while sending to remote node(s)
+   *
+   * @return
+   */
+  public long getQNMsgSerTime();
+
+  /**
+   *
+   *
+   * @return
+   */
+  public long getQNRespDeSerTime();
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1922937f/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/DataBrowserResultLoader.java
----------------------------------------------------------------------
diff --git a/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/DataBrowserResultLoader.java
b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/DataBrowserResultLoader.java
new file mode 100644
index 0000000..93560a0
--- /dev/null
+++ b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/DataBrowserResultLoader.java
@@ -0,0 +1,73 @@
+/*=========================================================================
+ * Copyright (c) 2012-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.vmware.gemfire.tools.pulse.tests;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+public class DataBrowserResultLoader {
+  private static DataBrowserResultLoader dbResultLoader = new DataBrowserResultLoader();
+
+  public static DataBrowserResultLoader getInstance() {
+    return dbResultLoader;
+  }
+
+  public String load(String queryString) throws IOException {
+
+    URL url = null;
+    InputStream inputStream = null;
+    BufferedReader streamReader = null;
+    String inputStr = null;
+    StringBuilder sampleQueryResultResponseStrBuilder = null;
+
+    try {
+      ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+
+      if (queryString.equals(PulseTests.QUERY_TYPE_ONE)) {
+        url = classLoader.getResource("testQueryResultClusterSmall.txt");
+      } else if (queryString.equals(PulseTests.QUERY_TYPE_TWO)) {
+        url = classLoader.getResource("testQueryResultSmall.txt");
+      } else if (queryString.equals(PulseTests.QUERY_TYPE_THREE)) {
+        url = classLoader.getResource("testQueryResult.txt");
+      } else if (queryString.equals(PulseTests.QUERY_TYPE_FOUR)) {
+        url = classLoader.getResource("testQueryResultWithStructSmall.txt");
+      } else if (queryString.equals(PulseTests.QUERY_TYPE_FIVE)) {
+        url = classLoader.getResource("testQueryResultClusterWithStruct.txt");
+      } else if (queryString.equals(PulseTests.QUERY_TYPE_SIX)) {
+        url = classLoader.getResource("testQueryResultHashMapSmall.txt");
+      } else if (queryString.equals(PulseTests.QUERY_TYPE_SEVENE)) {
+        url = classLoader.getResource("testQueryResult1000.txt");
+      } else {
+        url = classLoader.getResource("testQueryResult.txt");
+      }
+
+      File sampleQueryResultFile = new File(url.getPath());
+      inputStream = new FileInputStream(sampleQueryResultFile);
+      streamReader = new BufferedReader(new InputStreamReader(inputStream,
+          "UTF-8"));
+      sampleQueryResultResponseStrBuilder = new StringBuilder();
+
+      while ((inputStr = streamReader.readLine()) != null) {
+        sampleQueryResultResponseStrBuilder.append(inputStr);
+      }
+
+      // close stream reader
+      streamReader.close();
+
+    } catch (IOException ex) {
+      ex.printStackTrace();
+    }
+
+    return sampleQueryResultResponseStrBuilder.toString();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1922937f/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/GemFireXDAggregateTable.java
----------------------------------------------------------------------
diff --git a/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/GemFireXDAggregateTable.java
b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/GemFireXDAggregateTable.java
new file mode 100644
index 0000000..50f4f9e
--- /dev/null
+++ b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/GemFireXDAggregateTable.java
@@ -0,0 +1,35 @@
+/*=========================================================================
+ * Copyright (c) 2012-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.vmware.gemfire.tools.pulse.tests;
+
+import javax.management.NotificationBroadcasterSupport;
+
+public class GemFireXDAggregateTable extends NotificationBroadcasterSupport
+    implements GemFireXDAggregateTableMBean {
+  private String name = null;
+
+  public GemFireXDAggregateTable(String name) {
+    this.name = name;
+  }
+
+  private String getKey(String propName) {
+    return "table." + name + "." + propName;
+  }
+
+  @Override
+  public long getEntrySize() {
+    return Long.parseLong(JMXProperties.getInstance().getProperty(
+        getKey("EntrySize")));
+  }
+
+  @Override
+  public int getNumberOfRows() {
+    return Integer.parseInt(JMXProperties.getInstance().getProperty(
+        getKey("NumberOfRows")));
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1922937f/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/GemFireXDAggregateTableMBean.java
----------------------------------------------------------------------
diff --git a/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/GemFireXDAggregateTableMBean.java
b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/GemFireXDAggregateTableMBean.java
new file mode 100644
index 0000000..1cb2ce4
--- /dev/null
+++ b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/GemFireXDAggregateTableMBean.java
@@ -0,0 +1,17 @@
+/*=========================================================================
+ * Copyright (c) 2012-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.vmware.gemfire.tools.pulse.tests;
+
+public interface GemFireXDAggregateTableMBean {
+  public static final String OBJECT_NAME = "GemFireXD:service=Table,type=Aggregate,table=";
+  
+  public long getEntrySize();
+
+  public int getNumberOfRows();
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1922937f/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/GemFireXDCluster.java
----------------------------------------------------------------------
diff --git a/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/GemFireXDCluster.java
b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/GemFireXDCluster.java
new file mode 100644
index 0000000..fbc7a06
--- /dev/null
+++ b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/GemFireXDCluster.java
@@ -0,0 +1,84 @@
+/*=========================================================================
+ * Copyright (c) 2012-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.vmware.gemfire.tools.pulse.tests;
+
+import javax.management.NotificationBroadcasterSupport;
+import javax.management.openmbean.CompositeData;
+import javax.management.openmbean.CompositeDataSupport;
+import javax.management.openmbean.CompositeType;
+import javax.management.openmbean.OpenDataException;
+import javax.management.openmbean.OpenType;
+import javax.management.openmbean.SimpleType;
+
+public class GemFireXDCluster extends NotificationBroadcasterSupport implements
+    GemFireXDClusterMBean {
+  private String name = null;
+
+  private static String[] itemNames = { "connectionsAttempted",
+      "connectionsActive", "connectionsClosed", "connectionsFailed" };;
+  private static String[] itemDescriptions = { "connectionsAttempted",
+      "connectionsActive", "connectionsClosed", "connectionsFailed" };
+  private static OpenType[] itemTypes = { SimpleType.LONG, SimpleType.LONG,
+      SimpleType.LONG, SimpleType.LONG };
+  private static CompositeType networkServerClientConnectionStats = null;
+
+  static {
+    try {
+      networkServerClientConnectionStats = new CompositeType(
+          "NetworkServerClientConnectionStats",
+          "Network Server Client Connection Stats Information", itemNames,
+          itemDescriptions, itemTypes);
+
+    } catch (OpenDataException e) {
+      e.printStackTrace();
+    }
+  }
+
+  public GemFireXDCluster(String name) {
+    this.name = name;
+  }
+
+  private String getKey(String propName) {
+    return "gemfirexd." + name + "." + propName;
+  }
+
+  @Override
+  public int getProcedureCallsCompleted() {
+    return Integer.parseInt(JMXProperties.getInstance().getProperty(
+        getKey("ProcedureCallsCompleted")));
+  }
+
+  @Override
+  public int getProcedureCallsInProgress() {
+    return Integer.parseInt(JMXProperties.getInstance().getProperty(
+        getKey("ProcedureCallsInProgress")));
+  }
+
+  @Override
+  public CompositeData getNetworkServerClientConnectionStats() {
+    String value = JMXProperties.getInstance().getProperty(
+        getKey("NetworkServerClientConnectionStats"), "");
+    String[] values = value.split(",");
+    Long[] itemValues = new Long[values.length];
+    for (int i = 0; i < values.length; i++) {
+      itemValues[i] = Long.parseLong(values[i]);
+    }
+
+    CompositeData nscCompData;
+    try {
+      nscCompData = new CompositeDataSupport(
+          networkServerClientConnectionStats, itemNames, itemValues);
+    } catch (OpenDataException e) {
+      e.printStackTrace();
+      nscCompData = null;
+    }
+    return nscCompData;
+
+  }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1922937f/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/GemFireXDClusterMBean.java
----------------------------------------------------------------------
diff --git a/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/GemFireXDClusterMBean.java
b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/GemFireXDClusterMBean.java
new file mode 100644
index 0000000..9536ae2
--- /dev/null
+++ b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/GemFireXDClusterMBean.java
@@ -0,0 +1,21 @@
+/*=========================================================================
+ * Copyright (c) 2012-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.vmware.gemfire.tools.pulse.tests;
+
+import javax.management.openmbean.CompositeData;
+
+public interface GemFireXDClusterMBean {
+  public static final String OBJECT_NAME = "GemFireXD:service=Cluster";
+
+  public int getProcedureCallsCompleted();
+
+  public int getProcedureCallsInProgress();
+
+  public CompositeData getNetworkServerClientConnectionStats();
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1922937f/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/GemFireXDMember.java
----------------------------------------------------------------------
diff --git a/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/GemFireXDMember.java
b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/GemFireXDMember.java
new file mode 100644
index 0000000..0a317d0
--- /dev/null
+++ b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/GemFireXDMember.java
@@ -0,0 +1,69 @@
+/*=========================================================================
+ * Copyright (c) 2012-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.vmware.gemfire.tools.pulse.tests;
+
+import javax.management.openmbean.CompositeData;
+import javax.management.openmbean.CompositeDataSupport;
+import javax.management.openmbean.CompositeType;
+import javax.management.openmbean.OpenDataException;
+import javax.management.openmbean.OpenType;
+import javax.management.openmbean.SimpleType;
+
+public class GemFireXDMember extends JMXBaseBean implements
+    GemFireXDMemberMBean {
+  private String name = null;
+
+  private static String[] itemNames = { "connectionsAttempted",
+      "connectionsActive", "connectionsClosed", "connectionsFailed" };;
+  private static String[] itemDescriptions = { "connectionsAttempted",
+      "connectionsActive", "connectionsClosed", "connectionsFailed" };
+  private static OpenType[] itemTypes = { SimpleType.LONG, SimpleType.LONG,
+      SimpleType.LONG, SimpleType.LONG };
+  private static CompositeType networkServerClientConnectionStats = null;
+
+  static {
+    try {
+      networkServerClientConnectionStats = new CompositeType(
+          "NetworkServerClientConnectionStats",
+          "Network Server Client Connection Stats Information", itemNames,
+          itemDescriptions, itemTypes);
+
+    } catch (OpenDataException e) {
+      e.printStackTrace();
+    }
+  }
+
+  public GemFireXDMember(String name) {
+    this.name = name;
+  }
+
+  @Override
+  protected String getKey(String propName) {
+    return "gemfirexdmember." + name + "." + propName;
+  }
+
+  @Override
+  public boolean getDataStore() {
+    return getBoolean("DataStore");
+  }
+
+  @Override
+  public CompositeData getNetworkServerClientConnectionStats() {
+    Long[] itemValues = getLongArray("NetworkServerClientConnectionStats");
+    CompositeData nscCompData;
+    try {
+      nscCompData = new CompositeDataSupport(
+          networkServerClientConnectionStats, itemNames, itemValues);
+    } catch (OpenDataException e) {
+      e.printStackTrace();
+      nscCompData = null;
+    }
+    return nscCompData;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1922937f/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/GemFireXDMemberMBean.java
----------------------------------------------------------------------
diff --git a/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/GemFireXDMemberMBean.java
b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/GemFireXDMemberMBean.java
new file mode 100644
index 0000000..f49bdcf
--- /dev/null
+++ b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/GemFireXDMemberMBean.java
@@ -0,0 +1,20 @@
+/*=========================================================================
+ * Copyright (c) 2012-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.vmware.gemfire.tools.pulse.tests;
+
+import javax.management.openmbean.CompositeData;
+
+public interface GemFireXDMemberMBean {
+
+  public static final String OBJECT_NAME = "GemFireXD:group=DEFAULT,type=Member";
+
+  public boolean getDataStore();
+
+  public CompositeData getNetworkServerClientConnectionStats();
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1922937f/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/JMXBaseBean.java
----------------------------------------------------------------------
diff --git a/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/JMXBaseBean.java b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/JMXBaseBean.java
new file mode 100644
index 0000000..5f31b22
--- /dev/null
+++ b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/JMXBaseBean.java
@@ -0,0 +1,56 @@
+/*=========================================================================
+ * Copyright (c) 2012-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.vmware.gemfire.tools.pulse.tests;
+
+public abstract class JMXBaseBean {
+
+  protected abstract String getKey(String propName);
+
+  protected String getString(String key) {
+    return JMXProperties.getInstance().getProperty(getKey(key));
+  }
+
+  protected String[] getStringArray(String key) {
+    return JMXProperties.getInstance().getProperty(getKey(key), "").split(" ");
+  }
+
+  protected boolean getBoolean(String key) {
+    return Boolean.parseBoolean(JMXProperties.getInstance().getProperty(
+        getKey(key)));
+  }
+
+  protected int getInt(String key) {
+    return Integer.parseInt(JMXProperties.getInstance()
+        .getProperty(getKey(key)));
+  }
+
+  protected long getLong(String key) {
+    return Long.parseLong(JMXProperties.getInstance().getProperty(getKey(key)));
+  }
+
+  protected Long[] getLongArray(String key) {
+    String value = JMXProperties.getInstance().getProperty(getKey(key), "");
+    String[] values = value.split(",");
+    Long[] longValues = new Long[values.length];
+    for (int i = 0; i < values.length; i++) {
+      longValues[i] = Long.parseLong(values[i]);
+    }
+    return longValues;
+  }
+
+  protected double getDouble(String key) {
+    return Double.parseDouble(JMXProperties.getInstance().getProperty(
+        getKey(key)));
+  }
+
+  protected float getFloat(String key) {
+    return Float.parseFloat(JMXProperties.getInstance()
+        .getProperty(getKey(key)));
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1922937f/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/JMXProperties.java
----------------------------------------------------------------------
diff --git a/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/JMXProperties.java b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/JMXProperties.java
new file mode 100644
index 0000000..cb83613
--- /dev/null
+++ b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/JMXProperties.java
@@ -0,0 +1,36 @@
+/*=========================================================================
+ * Copyright (c) 2012-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.vmware.gemfire.tools.pulse.tests;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.Properties;
+
+public class JMXProperties extends Properties {
+  private static final long serialVersionUID = -6210901350494570026L;
+
+  private static JMXProperties props = new JMXProperties();
+
+  public static JMXProperties getInstance() {
+    return props;
+  }
+
+  public void load(String propFile) throws IOException {
+    if (propFile != null) {
+      FileInputStream fin;
+      fin = new FileInputStream(new File(propFile));
+      if (fin != null) {
+        clear();
+        load(fin);
+      }
+
+      fin.close();
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1922937f/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/Member.java
----------------------------------------------------------------------
diff --git a/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/Member.java b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/Member.java
new file mode 100644
index 0000000..812e055
--- /dev/null
+++ b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/Member.java
@@ -0,0 +1,178 @@
+/*=========================================================================
+ * Copyright (c) 2012-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.vmware.gemfire.tools.pulse.tests;
+
+public class Member extends JMXBaseBean implements MemberMBean {
+  private String name = null;
+
+  public Member(String name) {
+    this.name = name;
+  }
+
+  protected String getKey(String propName) {
+    return "member." + name + "." + propName;
+  }
+
+  @Override
+  public boolean getManager() {
+    return getBoolean("manager");
+  }
+
+  @Override
+  public int getTotalRegionCount() {
+    return getInt("totalRegionCount");
+  }
+
+  @Override
+  public boolean getLocator() {
+    return getBoolean("locator");
+  }
+
+  @Override
+  public long getTotalDiskUsage() {
+    return getLong("totalDiskUsage");
+  }
+
+  @Override
+  public boolean getServer() {
+    return getBoolean("sever");
+  }
+
+  @Override
+  public String[] getGroups() {
+    return getStringArray("Groups");
+  }
+
+  @Override
+  /*public String[] getRedundancyZone() {
+    return getStringArray("RedundancyZone");
+  }*/
+  public String getRedundancyZone() {
+    return getString("RedundancyZone");
+  }
+
+  @Override
+  public long getTotalFileDescriptorOpen() {
+    return getLong("totalFileDescriptorOpen");
+  }
+
+  @Override
+  public double getLoadAverage() {
+    return getDouble("loadAverage");
+  }
+
+  @Override
+  public float getDiskWritesRate() {
+    return getFloat("diskWritesRate");
+  }
+
+  @Override
+  public long getJVMPauses() {
+    return getLong("JVMPauses");
+  }
+
+  @Override
+  public long getCurrentHeapSize() {
+    return getLong("currentHeapSize");
+  }
+
+  @Override
+  public long getMaximumHeapSize() {
+    return getLong("maximumHeapSize");
+  }
+
+  @Override
+  public long getUsedMemory() {
+    return getLong("UsedMemory");
+  }
+
+  @Override
+  public long getMaxMemory() {
+    return getLong("MaxMemory");
+  }
+
+  @Override
+  public int getNumThreads() {
+    return getInt("numThreads");
+  }
+
+  @Override
+  public long getMemberUpTime() {
+    return getLong("memberUpTime");
+  }
+
+  @Override
+  public String getHost() {
+    return getString("host");
+  }
+
+  @Override
+  public long getTotalBytesOnDisk() {
+    return getLong("totalBytesOnDisk");
+  }
+
+  @Override
+  public float getCpuUsage() {
+    return getFloat("cpuUsage");
+  }
+
+  @Override
+  public String getMember() {
+    return getString("member");
+  }
+
+  @Override
+  public String getId() {
+    return getString("id");
+  }
+
+  @Override
+  public float getAverageReads() {
+    return getFloat("averageReads");
+  }
+
+  @Override
+  public float getAverageWrites() {
+    return getFloat("averageWrites");
+  }
+
+  @Override
+  public int getPort() {
+    return getInt("port");
+  }
+
+  @Override
+  public long getFoo() {
+    return getLong("foo");
+  }
+
+  @Override
+  public long getOffHeapFreeSize() {
+    return getLong("OffHeapFreeSize");
+  }
+
+  @Override
+  public long getOffHeapUsedSize() {
+    return getLong("OffHeapUsedSize");
+  }
+
+  @Override
+  public long getOffHeapFreeMemory() {
+    return getLong("OffHeapFreeMemory");
+  }
+
+  @Override
+  public long getOffHeapUsedMemory() {
+    return getLong("OffHeapUsedMemory");
+  }
+
+  @Override
+  public String getVersion() {
+    return getString("Version");
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1922937f/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/MemberMBean.java
----------------------------------------------------------------------
diff --git a/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/MemberMBean.java b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/MemberMBean.java
new file mode 100644
index 0000000..bc849ba
--- /dev/null
+++ b/pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/MemberMBean.java
@@ -0,0 +1,75 @@
+/*=========================================================================
+ * Copyright (c) 2012-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.vmware.gemfire.tools.pulse.tests;
+
+public interface MemberMBean {
+  public static final String OBJECT_NAME = "GemFire:type=Member";
+
+  public boolean getManager();
+
+  public int getTotalRegionCount();
+
+  public boolean getLocator();
+
+  public long getTotalDiskUsage();
+
+  public boolean getServer();
+
+  public String[] getGroups();
+
+  //public String[] getRedundancyZone();
+  public String getRedundancyZone();
+
+  public long getTotalFileDescriptorOpen();
+
+  public double getLoadAverage();
+
+  public float getDiskWritesRate();
+
+  public long getJVMPauses();
+
+  public long getCurrentHeapSize();
+
+  public long getMaximumHeapSize();
+
+  public long getUsedMemory();
+
+  public long getMaxMemory();
+
+  public int getNumThreads();
+
+  public long getMemberUpTime();
+
+  public String getHost();
+
+  public long getTotalBytesOnDisk();
+
+  public float getCpuUsage();
+
+  public String getMember();
+
+  public String getId();
+
+  public float getAverageReads();
+
+  public float getAverageWrites();
+
+  public int getPort();
+
+  public long getFoo();
+
+  public long getOffHeapFreeSize();
+
+  public long getOffHeapUsedSize();
+
+  public long getOffHeapFreeMemory();
+
+  public long getOffHeapUsedMemory();
+
+  public String getVersion();
+}


Mime
View raw message