geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [08/21] incubator-geode git commit: GEODE-1781: repackage internal statistics classes and refactor statistics tests
Date Tue, 16 Aug 2016 01:27:07 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6a9444a5/geode-core/src/main/java/com/gemstone/gemfire/internal/statistics/platform/WindowsSystemStats.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/statistics/platform/WindowsSystemStats.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/statistics/platform/WindowsSystemStats.java
new file mode 100644
index 0000000..b0a128f
--- /dev/null
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/statistics/platform/WindowsSystemStats.java
@@ -0,0 +1,269 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+package com.gemstone.gemfire.internal.statistics.platform;
+
+import com.gemstone.gemfire.*;
+import com.gemstone.gemfire.internal.Assert;
+import com.gemstone.gemfire.internal.statistics.StatisticsTypeFactoryImpl;
+
+/**
+ * <P>This class provides the interface for statistics about the 
+ * Windows machine a GemFire system is running on.
+ */
+public class WindowsSystemStats
+{
+  private final static int committedMemoryInUseINT = 0;
+  private final static int eventsINT = 1;
+  private final static int interruptsINT = 2;
+  private final static int mutexesINT = 3;
+  private final static int processesINT = 4;
+  private final static int processorQueueLengthINT = 5;
+  private final static int registryQuotaInUseINT = 6;
+  private final static int sharedMemorySectionsINT = 7;
+  private final static int semaphoresINT = 8;
+  private final static int threadsINT = 9;
+  private final static int dgramsReceivedINT = 10;
+  private final static int dgramsNoPortINT = 11;
+  private final static int dgramsReceivedErrorsINT = 12;
+  private final static int dgramsSentINT = 13;
+  private final static int loopbackPacketsINT = 14;
+  private final static int loopbackBytesINT = 15;
+  private final static int netPacketsReceivedINT = 16;
+  private final static int netBytesReceivedINT = 17;
+  private final static int netPacketsSentINT = 18;
+  private final static int netBytesSentINT = 19;
+
+
+  private final static int availableMemoryLONG = 0;
+  private final static int cacheFaultsLONG = 1;
+  private final static int cacheSizeLONG = 2;
+  private final static int cacheSizePeakLONG = 3;
+  private final static int committedMemoryLONG = 4;
+  private final static int committedMemoryLimitLONG = 5;
+  private final static int contextSwitchesLONG = 6;
+  private final static int demandZeroFaultsLONG = 7;
+  private final static int pageFaultsLONG = 8;
+  private final static int pageReadsLONG = 9;
+  private final static int pagesLONG = 10;
+  private final static int pageWritesLONG = 11;
+  private final static int pagesInputLONG = 12;
+  private final static int pagesOutputLONG = 13;
+  private final static int systemCallsLONG = 14;
+
+  private final static int cpuActiveDOUBLE = 0;
+  private final static int cpuIdleDOUBLE = 1;
+  private final static int cpuInterruptDOUBLE = 2;
+  private final static int cpuSystemDOUBLE = 3;
+  private final static int cpuUserDOUBLE = 4;
+
+  private final static StatisticsType myType;
+
+  private static void checkOffset(String name, int offset) {
+    int id = myType.nameToId(name);
+    Assert.assertTrue(offset == id, "Expected the offset for " + name + " to be " + offset + " but it was " + id);
+  }
+
+  static {
+    StatisticsTypeFactory f = StatisticsTypeFactoryImpl.singleton();
+    myType = f.createType("WindowsSystemStats",
+                          "Statistics on a Microsoft Windows machine.",
+                          new StatisticDescriptor[] {
+                            f.createIntGauge("committedMemoryInUse",
+                                                "This represents the percentage of available virtual memory in use. This is an instantaneous value, not an average.",
+                                                "%"),
+                            f.createIntGauge("events",
+                                                "The number of events in the computer at the time of data collection.  Notice that this is an instantaneous count, not an average over the time interval.  An event is used when two or more threads wish to synchronize execution.",
+                                                "items"),
+                            f.createIntCounter("interrupts",
+                                                "The total number of harware interrupts on the computer. Some devices that may generate interrupts are the system timer, the mouse, data communication lines, network interface cards and other peripheral devices.  This counter provides an indication of how busy these devices are on a computer-wide basis.",
+                                                "operations", false),
+                            f.createIntGauge("mutexes",
+                                                "The number of mutexes in the computer at the time of data collection.  This is an instantaneous count, not an average over the time interval.  Mutexes are used by threads to assure only one thread is executing some section of code.",
+                                                "items"),
+                            f.createIntGauge("processes",
+                                                "The number of processes in the computer at the time of data collection.  Notice that this is an instantaneous count, not an average over the time interval.  Each process represents the running of a program.",
+                                                "processes"),
+                            f.createIntGauge("processorQueueLength",
+                                                "The instantaneous length of the processor queue in units of threads. All processors use a single queue in which threads wait for processor cycles.  This length does not include the threads that are currently executing.  A sustained processor queue length greater than two generally indicates processor congestion.  This is an instantaneous count, not an average over the time interval",
+                                                "threads"),
+                            f.createIntGauge("registryQuotaInUse",
+                                                "The percentage of the Total Registry Quota Allowed currently in use by the system.",
+                                                "%"),
+                            f.createIntGauge("sharedMemorySections",
+                                                "The number of sections in the computer at the time of data collection.  Notice that this is an instantaneous count, not an average over the time interval. A section is a portion of virtual memory created by a process for storing data.  A process may share sections with other processes.",
+                                                "items"),
+                            f.createIntGauge("semaphores",
+                                                "The number of semaphores in the computer at the time of data collection.  Notice that this is an instantaneous count, not an average over the time interval.  Threads use semaphores to obtain exclusive access to data structures that they share with other threads.",
+                                                "items"),
+                            f.createIntGauge("threads",
+                                                "The number of threads in the computer at the time of data collection.  Notice that this is an instantaneous count, not an average over the time interval.  A thread is the basic executable entity that can execute instructions in a processor.",
+                                                "threads"),
+                            f.createIntCounter(
+                                    "dgramsReceived",
+                                    "The number of datagrams received on the VM's machine.",
+                                    "datagrams/sec"),
+                            f.createIntCounter(
+                                    "dgramsNoPort",
+                                    "The number of incoming datagrams that were discarded due to invalid headers",
+                                    "datagrams/sec"),
+                            f.createIntCounter(
+                                    "dgramsReceivedErrors",
+                                    "The number of received UDP datagrams that could not be delivered for reasons other than the lack of an application at the destination port",
+                                    "datagrams"),
+                            f.createIntCounter(
+                                    "dgramsSent",
+                                    "The number of datagrams sent on the VM's machine",
+                                    "datagrams/sec"),
+
+                            f.createIntCounter(
+                                "loopbackPackets",
+                                "The number of packets sent/received on the loopback interface",
+                                "packets"),
+                            f.createIntCounter(
+                                "loopbackBytes",
+                                "The number of bytes sent/received on the loopback interface",
+                                "bytes"),
+                            f.createIntCounter("netPacketsReceived",
+                                "The number of network packets received (total excluding loopback)",
+                                "packets"),
+                            f.createIntCounter("netBytesReceived",
+                                "The number of network bytes received (total excluding loopback)",
+                                "bytes"),
+                            f.createIntCounter("netPacketsSent",
+                                "The number of network packets sent (total excluding loopback)",
+                                "packets"),
+                            f.createIntCounter("netBytesSent",
+                                "The number of network bytes sent (total excluding loopback)",
+                                "bytes"),
+
+                            f.createLongGauge("availableMemory",
+                                                "The size, in bytes, of the virtual memory currently on the Zeroed, Free, and Standby lists.  Zeroed and Free memory is ready for use, with Zeroed memory cleared to zeros.  Standby memory is memory removed from a process's Working Set but still available.  Notice that this is an instantaneous count, not an average over the time interval.",
+                                                "bytes", true),
+                            f.createLongCounter("cacheFaults",
+                                                "Incremented whenever the Cache manager does not find a file's page in the immediate Cache and must ask the memory manager to locate the page elsewhere in memory or on the disk so that it can be loaded into the immediate Cache.",
+                                                "operations", false),
+                            f.createLongGauge("cacheSize",
+                                                "Measures the number of bytes currently in use by the system Cache.  The system Cache is used to buffer data retrieved from disk or LAN.  The system Cache uses memory not in use by active processes in the computer.",
+                                                "bytes"),
+                            f.createLongGauge("cacheSizePeak",
+                                                "Measures the maximum number of bytes used by the system Cache.  The system Cache is used to buffer data retrieved from disk or LAN.  The system Cache uses memory not in use by active processes in the computer.",
+                                                "bytes"),
+                            f.createLongGauge("committedMemory",
+                                                "The size of virtual memory, in bytes, that has been Committed (as opposed to simply reserved).  Committed memory must have backing (i.e., disk) storage available, or must be assured never to need disk storage (because main memory is large enough to hold it.)  Notice that this is an instantaneous count, not an average over the time interval.",
+                                                "bytes"),
+                            f.createLongGauge("committedMemoryLimit",
+                                                "The size, in bytes, of virtual memory that can be committed without having to extend the paging file(s).  If the paging file(s) can be extended, this is a soft limit. Note that this value will change if the paging file is extended.",
+                                                "bytes"),
+                            f.createLongCounter("contextSwitches",
+                                                "The number of times this thread has lost the cpu to another thread.  Thread switches can occur either inside of a single process or across processes.  A thread switch may be caused either by one thread asking another for information, or by a thread being preempted by another, higher priority thread becoming ready to run.  Unlike some early operating systems, Windows uses process boundaries for subsystem protection in addition to the traditional protection of User and Privileged modes. These subsystem processes provide additional protection. Therefore, some work done by Windows on behalf of an application may appear in other subsystem processes in addition to the Privileged Time in the application. Switching to the subsystem process causes one Context Switch in the application thread.  Switching back causes another Context Switch in the subsystem thread.",
+                                                "operations", false),
+                            f.createLongCounter("demandZeroFaults",
+                                                "The total number of page faults for pages that must be filled with zeros before the fault is satisfied.  If the Zeroed list is not empty, the fault can be resolved by removing a page from the Zeroed list.",
+                                                "operations", false),
+                            f.createLongCounter("pageFaults",
+                                                "The total number of Page Faults by the threads executing in this process. A page fault occurs when a thread refers to a virtual memory page that is not in its working set in main memory. This will not cause the page to be fetched from disk if it is on the standby list and hence already in main memory, or if it is in use by another process with whom the page is shared.",
+                                                "operations", false),
+                            f.createLongCounter("pageReads",
+                                                "The number of page read operations done by the process since it was last started. These operations involve actual disk reads and not reads from the shared page cache",
+                                                "operations", false),
+                            f.createLongCounter("pages",
+                                                "The total number of pages read from the disk or written to the disk to resolve memory references to pages that were not in memory at the time of the reference. This is the sum of pagesInput and the pagesOutput. This counter includes paging traffic on behalf of the system Cache to access file data for applications.  This value also includes the pages to/from non-cached mapped memory files.  This is the primary counter to observe if you are concerned about excessive memory pressure (that is, thrashing), and the excessive paging that may result.",
+                                                "pages", false),
+                            f.createLongCounter("pageWrites",
+                                                "The number of pages written by the process since it was last started. These page writes are actual disk writes and not just writes into the shared page cache. Unless a large data load is in process, the number should be low for all processes except the Stone's AIO page server process.",
+                                                "operations", false),
+                            f.createLongCounter("pagesInput",
+                                                "The total number of pages read from the disk to resolve memory references to pages that were not in memory at the time of the reference.  This counter includes paging traffic on behalf of the system Cache to access file data for applications.  This is an important counter to observe if you are concerned about excessive memory pressure (that is, thrashing), and the excessive paging that may result",
+                                                "pages", false),
+                            f.createLongCounter("pagesOutput",
+                                                "A count of the total number of pages that are written to disk because the pages have been modified in main memory",
+                                                "pages", false),
+                            f.createLongCounter("systemCalls",
+                                                "The total number of calls to Windows system service routines on the computer.  These routines perform all of the basic scheduling and synchronization of activities on the computer, and provide access to non-graphical devices, memory management, and name space management.",
+                                                "operations"),
+
+
+
+                            f.createDoubleGauge("cpuActive",
+                                                "The percentage of time spent doing useful work by all processors.  On a multi-processor system, if all processors are always busy this is 100%.",
+                                                "%"),
+                            f.createDoubleGauge("cpuIdle",
+                                                "The percentage of time the machine's processors spent idle.",
+                                                "%", true),
+                            f.createDoubleGauge("cpuInterrupt",
+                                                "The percentage of time spent receiving and servicing interrupts on all the processors on the machine. This value is an indirect indicator of the activity of devices that generate interrupts, such as the system clock, the mouse, disk drivers, data communication lines, network interface cards and other peripheral devices. These devices normally interrupt the processor when they have completed a task or require attention.  Normal thread execution is suspended during interrupts.  Most system clocks interrupt the processor every 10 milliseconds, creating a background of interrupt activity. ",
+                                                "%"),
+                            f.createDoubleGauge("cpuSystem",
+                                                "The percentage of time spent in privileged mode by all processors.  On a multi-processor system, if all processors are always in privileged mode this is 100%.  When a Windows system service is called, the service will often run in privileged mode in order to gain access to system-private data.  Such data is protected from access by threads executing in user mode.  Calls to the system may be explicit, or they may be implicit such as when a page fault or an interrupt occurs.  Unlike some early operating systems, Windows uses process boundaries for subsystem protection in addition to the traditional protection of user and privileged modes. These subsystem processes provide additional protection. Therefore, some work done by Windows on behalf of an application may appear in other subsystem processes in addition to the cpuSystem in the application process.",
+                                                "%"),
+                            f.createDoubleGauge("cpuUser",
+                                                "The percentage of time spent executing code in user mode on all the processor's on the machine.",
+                                                "%")
+                          });
+    checkOffset("committedMemoryInUse", committedMemoryInUseINT);
+    checkOffset("events", eventsINT);
+    checkOffset("interrupts", interruptsINT);
+    checkOffset("mutexes", mutexesINT);
+    checkOffset("processes", processesINT);
+    checkOffset("processorQueueLength", processorQueueLengthINT);
+    checkOffset("registryQuotaInUse", registryQuotaInUseINT);
+    checkOffset("sharedMemorySections", sharedMemorySectionsINT);
+    checkOffset("semaphores", semaphoresINT);
+    checkOffset("threads", threadsINT);
+    checkOffset("dgramsReceived", dgramsReceivedINT);
+    checkOffset("dgramsNoPort", dgramsNoPortINT);
+    checkOffset("dgramsReceivedErrors", dgramsReceivedErrorsINT);
+    checkOffset("dgramsSent", dgramsSentINT);
+
+    checkOffset("loopbackPackets", loopbackPacketsINT);
+    checkOffset("loopbackBytes", loopbackBytesINT);
+    checkOffset("netPacketsReceived", netPacketsReceivedINT);
+    checkOffset("netBytesReceived", netBytesReceivedINT);
+    checkOffset("netPacketsSent", netPacketsSentINT);
+    checkOffset("netBytesSent", netBytesSentINT);
+    
+    checkOffset("availableMemory", availableMemoryLONG);
+    checkOffset("cacheFaults", cacheFaultsLONG);
+    checkOffset("cacheSize", cacheSizeLONG);
+    checkOffset("cacheSizePeak", cacheSizePeakLONG);
+    checkOffset("committedMemory", committedMemoryLONG);
+    checkOffset("committedMemoryLimit", committedMemoryLimitLONG);
+    checkOffset("contextSwitches", contextSwitchesLONG);
+    checkOffset("demandZeroFaults", demandZeroFaultsLONG);
+    checkOffset("pageFaults", pageFaultsLONG);
+    checkOffset("pageReads", pageReadsLONG);
+    checkOffset("pages", pagesLONG);
+    checkOffset("pageWrites", pageWritesLONG);
+    checkOffset("pagesInput", pagesInputLONG);
+    checkOffset("pagesOutput", pagesOutputLONG);
+    checkOffset("systemCalls", systemCallsLONG);
+
+    checkOffset("cpuActive", cpuActiveDOUBLE);
+    checkOffset("cpuIdle", cpuIdleDOUBLE);
+    checkOffset("cpuInterrupt", cpuInterruptDOUBLE);
+    checkOffset("cpuSystem", cpuSystemDOUBLE);
+    checkOffset("cpuUser", cpuUserDOUBLE);
+  }
+
+  private WindowsSystemStats() {
+    // no instances allowed
+  }
+  public static StatisticsType getType() {
+    return myType;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6a9444a5/geode-core/src/main/java/com/gemstone/gemfire/internal/stats50/Atomic50StatisticsImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/stats50/Atomic50StatisticsImpl.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/stats50/Atomic50StatisticsImpl.java
index f374394..cff9142 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/stats50/Atomic50StatisticsImpl.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/stats50/Atomic50StatisticsImpl.java
@@ -19,6 +19,10 @@ package com.gemstone.gemfire.internal.stats50;
 import com.gemstone.gemfire.*;
 import com.gemstone.gemfire.internal.*;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
+import com.gemstone.gemfire.internal.statistics.StatisticsImpl;
+import com.gemstone.gemfire.internal.statistics.StatisticsManager;
+import com.gemstone.gemfire.internal.statistics.StatisticsTypeImpl;
+
 import java.util.concurrent.atomic.AtomicIntegerArray; // don't use backport here!
 import java.util.concurrent.atomic.AtomicLongArray; // don't use backport here!
 import java.util.concurrent.ConcurrentLinkedQueue; // don't use backport here!

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6a9444a5/geode-core/src/main/java/com/gemstone/gemfire/internal/stats50/VMStats50.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/stats50/VMStats50.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/stats50/VMStats50.java
index 6f2eea6..e5b55f4 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/stats50/VMStats50.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/stats50/VMStats50.java
@@ -43,8 +43,8 @@ import com.gemstone.gemfire.StatisticsTypeFactory;
 import com.gemstone.gemfire.SystemFailure;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.ClassPathLoader;
-import com.gemstone.gemfire.internal.StatisticsTypeFactoryImpl;
-import com.gemstone.gemfire.internal.VMStatsContract;
+import com.gemstone.gemfire.internal.statistics.StatisticsTypeFactoryImpl;
+import com.gemstone.gemfire.internal.statistics.VMStatsContract;
 import com.gemstone.gemfire.internal.logging.LogService;
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6a9444a5/geode-core/src/main/java/com/gemstone/gemfire/management/internal/beans/MemberMBeanBridge.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/beans/MemberMBeanBridge.java b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/beans/MemberMBeanBridge.java
index 89cc4f0..08260d3 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/beans/MemberMBeanBridge.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/beans/MemberMBeanBridge.java
@@ -47,6 +47,14 @@ import com.gemstone.gemfire.internal.offheap.MemoryAllocator;
 import com.gemstone.gemfire.internal.offheap.OffHeapMemoryStats;
 import com.gemstone.gemfire.internal.process.PidUnavailableException;
 import com.gemstone.gemfire.internal.process.ProcessUtils;
+import com.gemstone.gemfire.internal.statistics.GemFireStatSampler;
+import com.gemstone.gemfire.internal.statistics.HostStatHelper;
+import com.gemstone.gemfire.internal.statistics.platform.LinuxSystemStats;
+import com.gemstone.gemfire.internal.statistics.platform.ProcessStats;
+import com.gemstone.gemfire.internal.statistics.platform.SolarisSystemStats;
+import com.gemstone.gemfire.internal.statistics.StatSamplerStats;
+import com.gemstone.gemfire.internal.statistics.VMStatsContract;
+import com.gemstone.gemfire.internal.statistics.platform.WindowsSystemStats;
 import com.gemstone.gemfire.internal.stats50.VMStats50;
 import com.gemstone.gemfire.internal.tcp.ConnectionTable;
 import com.gemstone.gemfire.management.*;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6a9444a5/geode-core/src/test/java/com/gemstone/gemfire/GemFireTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/GemFireTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/GemFireTestCase.java
deleted file mode 100644
index 337f971..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/GemFireTestCase.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package com.gemstone.gemfire;
-
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.ConfigurationProperties.*;
-import static org.junit.Assert.assertTrue;
-
-/**
- * This is an abstract superclass for classes that test GemFire.  It
- * has setUp() and tearDown() methods that create and initialize a
- * GemFire connection.
- *
- *
- */
-public abstract class GemFireTestCase {
-
-  @Rule
-  public TestName testName = new TestName();
-
-  @Before
-  public void setUp() throws Exception {
-    Properties p = new Properties();
-    // make it a loner
-    p.setProperty(MCAST_PORT, "0");
-    p.setProperty(LOCATORS, "");
-    p.setProperty(NAME, getName());
-    DistributedSystem.connect(p);
-  }
-
-  @After
-  public void tearDown() throws Exception {
-    DistributedSystem ds = InternalDistributedSystem.getAnyInstance();
-    if (ds != null) {
-      ds.disconnect();
-    }
-  }
-
-  protected String getName() {
-    return testName.getMethodName();
-  }
-  
-  /**
-   * Strip the package off and gives just the class name.
-   * Needed because of Windows file name limits.
-   */
-  private String getShortClassName() {
-    return getClass().getSimpleName();
-  }
-  
-  /**
-   * Returns a unique name for this test method.  It is based on the
-   * name of the class as well as the name of the method.
-   */
-  protected String getUniqueName() {
-    return getShortClassName() + "_" + getName();
-  }
-
-  /**
-   * Assert an Invariant condition on an object.
-   * @param inv the Invariant to assert. If null, this method just returns
-   * @param obj the Object to assert the Invariant on.
-   */
-  protected void assertInvariant(Invariant inv, Object obj) {
-    if (inv == null) return;
-    InvariantResult result = inv.verify(obj);
-    assertTrue(result.message, result.valid);
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6a9444a5/geode-core/src/test/java/com/gemstone/gemfire/Invariant.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/Invariant.java b/geode-core/src/test/java/com/gemstone/gemfire/Invariant.java
deleted file mode 100644
index 1c712d2..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/Invariant.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package com.gemstone.gemfire;
-
-/**
- * Interface used for testing an invariant
- *
- */
-public interface Invariant {
-  /**
-   * @return error message, or null if verification passes
-   */
-  public InvariantResult verify(Object obj);  
-}
-
-
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6a9444a5/geode-core/src/test/java/com/gemstone/gemfire/InvariantResult.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/InvariantResult.java b/geode-core/src/test/java/com/gemstone/gemfire/InvariantResult.java
deleted file mode 100644
index 272e026..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/InvariantResult.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package com.gemstone.gemfire;
-
-/** 
-* Used as result of verifying an Invariant
-* @see Invariant
-*
-*/
-public class InvariantResult {
-  public String message;
-  public boolean valid;
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6a9444a5/geode-core/src/test/java/com/gemstone/gemfire/LocalStatisticsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/LocalStatisticsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/LocalStatisticsJUnitTest.java
deleted file mode 100644
index ab5b8e1..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/LocalStatisticsJUnitTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package com.gemstone.gemfire;
-
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.experimental.categories.Category;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.ConfigurationProperties.*;
-
-/**
- * Tests the functionality of JOM {@link Statistics}.
- */
-@Category(IntegrationTest.class)
-public class LocalStatisticsJUnitTest extends StatisticsTestCase {
-
-  /**
-   * Returns a distributed system configured to not use shared
-   * memory.
-   */
-  protected DistributedSystem getSystem() {
-    if (this.system == null) {
-      Properties props = new Properties();
-      props.setProperty(STATISTIC_SAMPLING_ENABLED, "true");
-      props.setProperty(STATISTIC_ARCHIVE_FILE, "StatisticsTestCase-localTest.gfs");
-      props.setProperty(MCAST_PORT, "0");
-      props.setProperty(LOCATORS, "");
-      props.setProperty(NAME, getName());
-      this.system = DistributedSystem.connect(props);
-    }
-
-    return this.system;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6a9444a5/geode-core/src/test/java/com/gemstone/gemfire/StatisticsTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/StatisticsTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/StatisticsTestCase.java
deleted file mode 100644
index 03b5e16..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/StatisticsTestCase.java
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package com.gemstone.gemfire;
-
-import static org.junit.Assert.*;
-
-import com.gemstone.gemfire.distributed.DistributedSystem;
-
-import java.util.*;
-
-import org.junit.Test;
-
-/**
- * Tests the functionality of {@link Statistics}.  Uses a
- * subclass to tests JOM-only statistics.
- */
-public abstract class StatisticsTestCase extends GemFireTestCase {
-
-  /** The distributed system used in this test */
-  protected DistributedSystem system;
-
-  private StatisticsFactory factory() {
-    return system;
-  }
-
-  /**
-   * Creates the distributed system
-   * @throws Exception 
-   */
-  @Override
-  public void setUp() throws Exception {
-    this.system = getSystem();
-  }
-
-  /**
-   * Closes the distributed system
-   * @throws Exception 
-   */
-  @Override
-  public void tearDown() throws Exception {
-    this.system.disconnect();
-    this.system = null;
-  }
-
-  /**
-   * Returns the distributed system used when creating statistics.  It
-   * determines whether or not shared memory is used.
-   */
-  protected abstract DistributedSystem getSystem();
-
-  ////////  Test methods
-
-  /**
-   * Tests <code>int</code> statistics
-   */
-  @Test
-  public void testIntStatistics() {
-    String statName1 = "one";
-    String statName2 = "two";
-    String statName3 = "three";
-    String[] statNames = { statName1, statName2, statName3 };
-
-    StatisticsType type =
-      factory().createType(this.getUniqueName(), "", new
-        StatisticDescriptor[] {
-          factory().createIntGauge(statName1, "ONE", "x"),
-          factory().createIntGauge(statName2, "TWO", "x"),
-          factory().createIntGauge(statName3, "THREE", "x")
-      });
-
-    Statistics stats = factory().createAtomicStatistics(type, "Display");
-    stats.setInt(statName1, 0);
-    stats.setInt(statName2, 0);
-    stats.setInt(statName3, 0);
-
-    for (int j = 0; j < statNames.length; j++) {
-      String statName = statNames[j];
-      for (int i = 0; i < 10; i++) {
-        stats.setInt(statName, i);
-        stats.incInt(statName, 1);
-        assertEquals(i + 1, stats.getInt(statName));
-      }
-    }
-  }
-
-  /**
-   * Tests <code>long</code> statistics
-   */
-  @Test
-  public void testLongStatistics() {
-    String statName1 = "one";
-    String statName2 = "two";
-    String statName3 = "three";
-    String[] statNames = { statName1, statName2, statName3 };
-
-    StatisticsType type =
-      factory().createType(this.getUniqueName(), "", new
-        StatisticDescriptor[] {
-          factory().createLongGauge(statName1, "ONE", "x"),
-          factory().createLongGauge(statName2, "TWO", "x"),
-          factory().createLongGauge(statName3, "THREE", "x")
-      });
-
-    Statistics stats = factory().createAtomicStatistics(type, "Display");
-    stats.setLong(statName1, 0L);
-    stats.setLong(statName2, 0L);
-    stats.setLong(statName3, 0L);
-
-    Random random = new Random();
-
-    // Set/get some random long values
-    for (int i = 0; i < 100; i++) {
-      for (int j = 0; j < statNames.length; j++) {
-        String statName = statNames[j];
-        long value = random.nextLong();
-        stats.setLong(statName, value);
-        assertEquals(value, stats.getLong(statName));
-      }
-    }
-
-    // Increment by some random values
-    for (int i = 0; i < 100; i++) {
-      for (int j = 0; j < statNames.length; j++) {
-        String statName = statNames[j];
-        long inc = random.nextLong();
-        long before = stats.getLong(statName);
-        stats.incLong(statName, inc);
-        assertEquals(before + inc, stats.getLong(statName));
-      }
-    }
-  }
-
-  /**
-   * Tests <code>double</code> statistics
-   */
-  @Test
-  public void testDoubleStatistics() {
-    String statName1 = "one";
-    String statName2 = "two";
-    String statName3 = "three";
-    String[] statNames = { statName1, statName2, statName3 };
-
-    StatisticsType type =
-      factory().createType(this.getUniqueName(), "", new
-        StatisticDescriptor[] {
-          factory().createDoubleGauge(statName1, "ONE", "x"),
-          factory().createDoubleGauge(statName2, "TWO", "x"),
-          factory().createDoubleGauge(statName3, "THREE", "x")
-      });
-
-    Statistics stats = factory().createAtomicStatistics(type, "Display");
-    stats.setDouble(statName1, 0.0);
-    stats.setDouble(statName2, 0.0);
-    stats.setDouble(statName3, 0.0);
-
-    Random random = new Random();
-
-    // Set/get some random double values
-    for (int i = 0; i < 100; i++) {
-      for (int j = 0; j < statNames.length; j++) {
-        String statName = statNames[j];
-        double value = random.nextDouble();
-        stats.setDouble(statName, value);
-        assertEquals(value, stats.getDouble(statName), 0.0);
-      }
-    }
-
-    // Increment by some random values
-    for (int i = 0; i < 100; i++) {
-      for (int j = 0; j < statNames.length; j++) {
-        String statName = statNames[j];
-        double inc = random.nextDouble();
-        double before = stats.getDouble(statName);
-        stats.incDouble(statName, inc);
-        assertEquals(before + inc, stats.getDouble(statName), 0.0);
-      }
-    }
-  }
-
-  /**
-   * Tests that accessing an <code>int</code> stat throws the
-   * appropriate exceptions.
-   */
-  @Test
-  public void testAccessingIntStat() {
-    String statName1 = "one";
-
-    StatisticsType type =
-      factory().createType(this.getUniqueName(), "", new
-        StatisticDescriptor[] {
-          factory().createIntGauge(statName1, "ONE", "x"),
-      });
-
-    Statistics stats = factory().createAtomicStatistics(type, "Display");
-
-    stats.getInt(statName1);
-    try {
-      stats.getDouble(statName1);
-      fail("Should have thrown an IllegalArgumentException");
-
-    } catch (IllegalArgumentException ex) {
-      // pass...
-    }
-    try {
-      stats.getLong(statName1);
-      fail("Should have thrown an IllegalArgumentException");
-
-    } catch (IllegalArgumentException ex) {
-      // pass...
-    }
-
-    stats.setInt(statName1, 4);
-    try {
-      stats.setDouble(statName1, 4.0);
-      fail("Should have thrown an IllegalArgumentException");
-
-    } catch (IllegalArgumentException ex) {
-      // pass...
-    }
-    try {
-      stats.setLong(statName1, 4L);
-      fail("Should have thrown an IllegalArgumentException");
-
-    } catch (IllegalArgumentException ex) {
-      // pass...
-    }
-
-    stats.incInt(statName1, 4);
-    try {
-      stats.incDouble(statName1, 4.0);
-      fail("Should have thrown an IllegalArgumentException");
-
-    } catch (IllegalArgumentException ex) {
-      // pass...
-    }
-    try {
-      stats.incLong(statName1, 4L);
-      fail("Should have thrown an IllegalArgumentException");
-
-    } catch (IllegalArgumentException ex) {
-      // pass...
-    }
-  }
-
-  /**
-   * Tests that accessing a <code>long</code> stat throws the
-   * appropriate exceptions.
-   */
-  @Test
-  public void testAccessingLongStat() {
-    String statName1 = "one";
-
-    StatisticsType type =
-      factory().createType(this.getUniqueName(), "", new
-        StatisticDescriptor[] {
-          factory().createLongGauge(statName1, "ONE", "x"),
-      });
-
-    Statistics stats = factory().createAtomicStatistics(type, "Display");
-
-    stats.getLong(statName1);
-    try {
-      stats.getDouble(statName1);
-      fail("Should have thrown an IllegalArgumentException");
-
-    } catch (IllegalArgumentException ex) {
-      // pass...
-    }
-    try {
-      stats.getInt(statName1);
-      fail("Should have thrown an IllegalArgumentException");
-
-    } catch (IllegalArgumentException ex) {
-      // pass...
-    }
-
-    stats.setLong(statName1, 4L);
-    try {
-      stats.setDouble(statName1, 4.0);
-      fail("Should have thrown an IllegalArgumentException");
-
-    } catch (IllegalArgumentException ex) {
-      // pass...
-    }
-    try {
-      stats.setInt(statName1, 4);
-      fail("Should have thrown an IllegalArgumentException");
-
-    } catch (IllegalArgumentException ex) {
-      // pass...
-    }
-
-    stats.incLong(statName1, 4L);
-    try {
-      stats.incDouble(statName1, 4.0);
-      fail("Should have thrown an IllegalArgumentException");
-
-    } catch (IllegalArgumentException ex) {
-      // pass...
-    }
-    try {
-      stats.incInt(statName1, 4);
-      fail("Should have thrown an IllegalArgumentException");
-
-    } catch (IllegalArgumentException ex) {
-      // pass...
-    }
-  }
-
-  /**
-   * Tests that accessing an <code>double</code> stat throws the
-   * appropriate exceptions.
-   */
-  @Test
-  public void testAccessingDoubleStat() {
-    String statName1 = "one";
-
-    StatisticsType type =
-      factory().createType(this.getUniqueName(), "", new
-        StatisticDescriptor[] {
-          factory().createDoubleGauge(statName1, "ONE", "x"),
-      });
-
-    Statistics stats = factory().createStatistics(type, "Display");
-
-    stats.getDouble(statName1);
-    try {
-      stats.getInt(statName1);
-      fail("Should have thrown an IllegalArgumentException");
-
-    } catch (IllegalArgumentException ex) {
-      // pass...
-    }
-    try {
-      stats.getLong(statName1);
-      fail("Should have thrown an IllegalArgumentException");
-
-    } catch (IllegalArgumentException ex) {
-      // pass...
-    }
-
-    stats.setDouble(statName1, 4.0);
-    try {
-      stats.setInt(statName1, 4);
-      fail("Should have thrown an IllegalArgumentException");
-
-    } catch (IllegalArgumentException ex) {
-      // pass...
-    }
-    try {
-      stats.setLong(statName1, 4L);
-      fail("Should have thrown an IllegalArgumentException");
-
-    } catch (IllegalArgumentException ex) {
-      // pass...
-    }
-
-    stats.incDouble(statName1, 4.0);
-    try {
-      stats.incInt(statName1, 4);
-      fail("Should have thrown an IllegalArgumentException");
-
-    } catch (IllegalArgumentException ex) {
-      // pass...
-    }
-    try {
-      stats.incLong(statName1, 4L);
-      fail("Should have thrown an IllegalArgumentException");
-
-    } catch (IllegalArgumentException ex) {
-      // pass...
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6a9444a5/geode-core/src/test/java/com/gemstone/gemfire/StatisticsTypeJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/StatisticsTypeJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/StatisticsTypeJUnitTest.java
deleted file mode 100644
index 1d221a2..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/StatisticsTypeJUnitTest.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package com.gemstone.gemfire;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-
-/**
- * Tests the functionality of the {@link StatisticsType} class.
- *
- *
- */
-@Category(IntegrationTest.class)
-public class StatisticsTypeJUnitTest extends GemFireTestCase {
-
-  private StatisticsFactory factory() {
-    return InternalDistributedSystem.getAnyInstance();
-  }
-  
-  /**
-   * Get the offset of an unknown statistic
-   */
-  @Test
-  public void testNameToIdUnknownStatistic() {
-    StatisticDescriptor[] stats = {
-      factory().createIntGauge("test", "TEST", "ms")
-    };
-
-    StatisticsType type = factory().createType("testNameToIdUnknownStatistic", "TEST", stats);
-    assertEquals(0, type.nameToId("test"));
-    try {
-      type.nameToId("Fred");
-      fail("Should have thrown an IllegalArgumentException");
-
-    } catch (IllegalArgumentException ex) {
-      // pass...
-    }
-  }
-
-  @Test
-  public void testNameToDescriptorUnknownStatistic() {
-    StatisticDescriptor[] stats = {
-      factory().createIntGauge("test", "TEST", "ms")
-    };
-
-    StatisticsType type = factory().createType("testNameToDescriptorUnknownStatistic", "TEST", stats);
-    assertEquals("test", type.nameToDescriptor("test").getName());
-    try {
-      type.nameToDescriptor("Fred");
-      fail("Should have thrown an IllegalArgumentException");
-
-    } catch (IllegalArgumentException ex) {
-      // pass...
-    }
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6a9444a5/geode-core/src/test/java/com/gemstone/gemfire/admin/internal/MemberHealthEvaluatorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/admin/internal/MemberHealthEvaluatorJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/admin/internal/MemberHealthEvaluatorJUnitTest.java
index 6791dcc..8863059 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/admin/internal/MemberHealthEvaluatorJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/admin/internal/MemberHealthEvaluatorJUnitTest.java
@@ -28,8 +28,8 @@ import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.admin.GemFireHealth;
 import com.gemstone.gemfire.admin.GemFireHealthConfig;
-import com.gemstone.gemfire.internal.GemFireStatSampler;
-import com.gemstone.gemfire.internal.ProcessStats;
+import com.gemstone.gemfire.internal.statistics.GemFireStatSampler;
+import com.gemstone.gemfire.internal.statistics.platform.ProcessStats;
 import com.gemstone.gemfire.internal.PureJavaMode;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6a9444a5/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsDUnitTest.java
index baad698..c3a490f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsDUnitTest.java
@@ -67,9 +67,9 @@ import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
-import com.gemstone.gemfire.internal.GemFireStatSampler;
-import com.gemstone.gemfire.internal.LocalStatListener;
-import com.gemstone.gemfire.internal.StatisticsImpl;
+import com.gemstone.gemfire.internal.statistics.GemFireStatSampler;
+import com.gemstone.gemfire.internal.statistics.LocalStatListener;
+import com.gemstone.gemfire.internal.statistics.StatisticsImpl;
 import com.gemstone.gemfire.internal.cache.DistributedRegion;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.PartitionedRegion;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6a9444a5/geode-core/src/test/java/com/gemstone/gemfire/codeAnalysis/decode/CompiledClass.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/codeAnalysis/decode/CompiledClass.java b/geode-core/src/test/java/com/gemstone/gemfire/codeAnalysis/decode/CompiledClass.java
index 9e03956..43175f6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/codeAnalysis/decode/CompiledClass.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/codeAnalysis/decode/CompiledClass.java
@@ -177,7 +177,7 @@ public class CompiledClass implements Comparable {
       // in junit
       String name = fullyQualifiedName().replace('/', '.');
       if (name.startsWith("com.gemstone.gemfire.internal.shared.NativeCallsJNAImpl")
-          || name.startsWith("com.gemstone.gemfire.internal.HostStatHelper")) {
+          || name.startsWith("com.gemstone.gemfire.internal.statistics.HostStatHelper")) {
         return false;
       }
       try {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6a9444a5/geode-core/src/test/java/com/gemstone/gemfire/internal/DataSerializableJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/DataSerializableJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/DataSerializableJUnitTest.java
index 273d3c6..13ab363 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/DataSerializableJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/DataSerializableJUnitTest.java
@@ -64,6 +64,7 @@ import com.gemstone.gemfire.DataSerializable;
 import com.gemstone.gemfire.DataSerializer;
 import com.gemstone.gemfire.Instantiator;
 import com.gemstone.gemfire.SystemFailure;
+import com.gemstone.gemfire.internal.statistics.StatArchiveWriter;
 import com.gemstone.gemfire.internal.tcp.ByteBufferInputStream;
 import com.gemstone.gemfire.test.junit.categories.UnitTest;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6a9444a5/geode-core/src/test/java/com/gemstone/gemfire/internal/GemFireStatSamplerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/GemFireStatSamplerJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/GemFireStatSamplerJUnitTest.java
deleted file mode 100644
index ef07633..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/GemFireStatSamplerJUnitTest.java
+++ /dev/null
@@ -1,612 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package com.gemstone.gemfire.internal;
-
-import com.gemstone.gemfire.Statistics;
-import com.gemstone.gemfire.StatisticsType;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
-import com.gemstone.gemfire.internal.GemFireStatSampler.LocalStatListenerImpl;
-import com.gemstone.gemfire.internal.cache.control.HeapMemoryMonitor;
-import com.gemstone.gemfire.internal.logging.LogService;
-import com.gemstone.gemfire.internal.statistics.SampleCollector;
-import com.gemstone.gemfire.internal.statistics.StatArchiveHandler;
-import com.gemstone.gemfire.internal.statistics.StatArchiveHandlerConfig;
-import com.gemstone.gemfire.internal.stats50.VMStats50;
-import com.gemstone.gemfire.internal.util.StopWatch;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.apache.logging.log4j.Logger;
-import org.junit.*;
-import org.junit.experimental.categories.Category;
-import org.junit.rules.TestName;
-
-import java.io.File;
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Properties;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import static com.gemstone.gemfire.distributed.ConfigurationProperties.*;
-import static org.junit.Assert.*;
-import static org.junit.Assume.assumeFalse;
-
-/**
- * Integration tests for GemFireStatSampler.
- *
- * @since GemFire 7.0
- */
-@Category(IntegrationTest.class)
-public class GemFireStatSamplerJUnitTest extends StatSamplerTestCase {
-  
-  private static final Logger logger = LogService.getLogger();
-  
-  private static final int STAT_SAMPLE_RATE = 1000;
-
-  @Rule
-  public TestName testName = new TestName();
-  
-  private DistributedSystem system;
-  private File testDir = new File(getClass().getSimpleName());
-
-  @BeforeClass
-  public static void beforeClass() throws Exception {
-    final String dirName = GemFireStatSamplerJUnitTest.class.getSimpleName();
-    final File dir = new File(dirName);
-    if (dir.exists()) {
-      FileUtil.delete(dir);
-    }
-  }
-
-  @Before
-  public void setUp() throws Exception {
-    if (!this.testDir.exists()) {
-      this.testDir.mkdir();
-    }
-    assertTrue(this.testDir.exists());
-  }
-
-  /**
-   * Removes the loner DistributedSystem at the end of each test.
-   */
-  @After
-  public void tearDown() throws Exception {
-    System.clearProperty(GemFireStatSampler.TEST_FILE_SIZE_LIMIT_IN_KB_PROPERTY);
-    disconnect();
-  }
-
-  /**
-   * Tests the majority of getters and the basic functionality of the sampler.
-   * 
-   * This test is skipped when running on Windows 7 because ProcessStats is not created for this OS. See #45395.
-   */
-  @Test
-  public void testBasics() throws Exception {
-    final String osName = System.getProperty("os.name", "unknown");
-    assumeFalse(osName.equals("Windows 7"));
-
-    connect(createGemFireProperties());
-
-    GemFireStatSampler statSampler = getGemFireStatSampler();
-    assertTrue(statSampler.waitForInitialization(5000));
-
-    assertEquals(0, statSampler.getArchiveFileSizeLimit());
-    assertEquals(0, statSampler.getArchiveDiskSpaceLimit());
-    assertEquals(STAT_SAMPLE_RATE, statSampler.getSampleRate());
-    assertEquals(true, statSampler.isSamplingEnabled());
-
-    int statsCount = statSampler.getStatisticsManager().getStatisticsCount();
-
-    assertEquals(statsCount, statSampler.getStatisticsModCount());
-    assertEquals(statsCount, statSampler.getStatisticsManager().getStatisticsCount());
-    assertEquals(statsCount, statSampler.getStatistics().length);
-
-    assertEquals(getStatisticsManager().getId(), statSampler.getSystemId());
-    assertTrue(statSampler.getSystemStartTime() < System.currentTimeMillis());
-    assertEquals(SocketCreator.getHostName(SocketCreator.getLocalHost()),
-                 statSampler.getSystemDirectoryPath());
-
-    AllStatistics allStats = new AllStatistics(statSampler);
-
-    VMStatsContract vmStats = statSampler.getVMStats();
-    assertNotNull(vmStats);
-    assertTrue(vmStats instanceof VMStats50);
-    /* NOTE: VMStats50 is not an instance of Statistics but instead its
-     * instance contains 3 instances of Statistics:
-     * 1) vmStats
-     * 2) heapMemStats
-     * 3) nonHeapMemStats
-     */
-
-    Method getProcessStats = getGemFireStatSampler().getClass().getMethod("getProcessStats");
-    assertNotNull(getProcessStats);
-
-    ProcessStats processStats = statSampler.getProcessStats();
-    if (osName.equals("SunOS")) {
-      assertNotNull(processStats);
-      assertTrue(PureJavaMode.osStatsAreAvailable());
-      assertTrue(allStats.containsStatisticsType("SolarisProcessStats"));
-      assertTrue(allStats.containsStatisticsType("SolarisSystemStats"));
-    } else if (osName.startsWith("Windows")) {
-      // fails on Windows 7: 45395 "ProcessStats are not created on Windows 7"
-      assertNotNull("ProcessStats were not created on " + osName, processStats);
-      assertTrue(PureJavaMode.osStatsAreAvailable());
-      assertTrue(allStats.containsStatisticsType("WindowsProcessStats"));
-      assertTrue(allStats.containsStatisticsType("WindowsSystemStats"));
-    } else if (osName.startsWith("Linux")) {
-      assertNotNull(processStats);
-      assertTrue(PureJavaMode.osStatsAreAvailable());
-      assertTrue(allStats.containsStatisticsType("LinuxProcessStats"));
-      assertTrue(allStats.containsStatisticsType("LinuxSystemStats"));
-    } else if (osName.equals("Mac OS X")) {
-      assertNull(processStats);
-      assertFalse(PureJavaMode.osStatsAreAvailable());
-      assertFalse(allStats.containsStatisticsType("OSXProcessStats"));
-      assertFalse(allStats.containsStatisticsType("OSXSystemStats"));
-    } else {
-      assertNull(processStats);
-    }
-
-    String productDesc = statSampler.getProductDescription();
-    assertTrue(productDesc.contains(GemFireVersion.getGemFireVersion()));
-    assertTrue(productDesc.contains(GemFireVersion.getBuildId()));
-    assertTrue(productDesc.contains(GemFireVersion.getSourceDate()));
-  }
-
-  /**
-   * Tests that the configured archive file is created and exists.
-   */
-  @Test
-  public void testArchiveFileExists() throws Exception {
-    final String dir = this.testDir.getName();
-    final String archiveFileName = dir + File.separator + this.testName + ".gfs";
-    
-    final File archiveFile1 = new File(dir + File.separator + this.testName + ".gfs");
-    
-    Properties props = createGemFireProperties();
-    props.setProperty(STATISTIC_ARCHIVE_FILE, archiveFileName);
-    connect(props);
-
-    GemFireStatSampler statSampler = getGemFireStatSampler();
-    assertTrue(statSampler.waitForInitialization(5000));
-
-    final File archiveFile = statSampler.getArchiveFileName();
-    assertNotNull(archiveFile);
-    assertEquals(archiveFile1, archiveFile);
-
-    waitForFileToExist(archiveFile, 5000, 10);
-    
-    assertTrue("File name incorrect: archiveFile.getName()=" + archiveFile.getName() +
-        " archiveFile.getAbsolutePath()=" + archiveFile.getAbsolutePath() +
-        " getCanonicalPath()" + archiveFile.getCanonicalPath(),
-        archiveFileName.contains(archiveFile.getName()));
-  }
-
-  /**
-   * Tests the statistics sample rate within an acceptable margin of error.
-   */
-  @Test
-  public void testSampleRate() throws Exception {
-    connect(createGemFireProperties());
-
-    GemFireStatSampler statSampler = getGemFireStatSampler();
-    assertTrue(statSampler.waitForInitialization(5000));
-
-    assertEquals(STAT_SAMPLE_RATE, statSampler.getSampleRate());
-
-    assertTrue(getStatisticsManager().getStatListModCount() > 0);
-
-    List<Statistics> statistics = getStatisticsManager().getStatsList();
-    assertNotNull(statistics);
-    assertTrue(statistics.size() > 0);
-
-    StatisticsType statSamplerType = getStatisticsManager().findType("StatSampler");
-    Statistics[] statsArray = getStatisticsManager().findStatisticsByType(statSamplerType);
-    assertEquals(1, statsArray.length);
-
-    final Statistics statSamplerStats = statsArray[0];
-    final int initialSampleCount = statSamplerStats.getInt("sampleCount");
-    final int expectedSampleCount = initialSampleCount + 2;
-
-    waitForExpectedStatValue(statSamplerStats, "sampleCount", expectedSampleCount, 5000, 10);
-  }
-
-  /**
-   * Adds a LocalStatListener for an individual stat. Validates that it
-   * receives notifications. Removes the listener and validates that it
-   * was in fact removed and no longer receives notifications.
-   */
-  @Test
-  public void testLocalStatListener() throws Exception {
-    connect(createGemFireProperties());
-
-    GemFireStatSampler statSampler = getGemFireStatSampler();
-    assertTrue(statSampler.waitForInitialization(5000));
-
-    Method getLocalListeners = getGemFireStatSampler().getClass().getMethod("getLocalListeners");
-    assertNotNull(getLocalListeners);
-
-    Method addLocalStatListener = getGemFireStatSampler().getClass().getMethod("addLocalStatListener", LocalStatListener.class, Statistics.class, String.class);
-    assertNotNull(addLocalStatListener);
-
-    Method removeLocalStatListener = getGemFireStatSampler().getClass().getMethod("removeLocalStatListener", LocalStatListener.class);
-    assertNotNull(removeLocalStatListener);
-
-    // validate that there are no listeners
-    assertTrue(statSampler.getLocalListeners().isEmpty());
-
-    // add a listener for sampleCount stat in StatSampler statistics
-    StatisticsType statSamplerType = getStatisticsManager().findType("StatSampler");
-    Statistics[] statsArray = getStatisticsManager().findStatisticsByType(statSamplerType);
-    assertEquals(1, statsArray.length);
-
-    final Statistics statSamplerStats = statsArray[0];
-    final String statName = "sampleCount";
-    final AtomicInteger sampleCountValue = new AtomicInteger(0);
-    final AtomicInteger sampleCountChanged = new AtomicInteger(0);
-
-    LocalStatListener listener = new LocalStatListener() {
-      public void statValueChanged(double value) {
-        sampleCountValue.set((int)value);
-        sampleCountChanged.incrementAndGet();
-      }
-    };
-
-    statSampler.addLocalStatListener(listener, statSamplerStats, statName);
-    assertTrue(statSampler.getLocalListeners().size() == 1);
-
-    // there's a level of indirection here and some protected member fields
-    LocalStatListenerImpl lsli = (LocalStatListenerImpl)
-        statSampler.getLocalListeners().iterator().next();
-    assertEquals("sampleCount", lsli.stat.getName());
-
-    // wait for the listener to update 4 times
-    final int expectedChanges = 4;
-    boolean done = false;
-    try {
-      for (StopWatch time = new StopWatch(true); !done && time.elapsedTimeMillis() < 5000; done = (sampleCountChanged.get() >= expectedChanges)) {
-        Thread.sleep(10);
-      }
-    } catch (InterruptedException e) {
-      Thread.currentThread().interrupt();
-    }
-    assertTrue("Waiting for sampleCountChanged >= " + expectedChanges, done);
-
-    // validate that the listener fired and updated the value
-    assertTrue(sampleCountValue.get() > 0);
-    assertTrue(sampleCountChanged.get() >= expectedChanges);
-
-    // remove the listener
-    statSampler.removeLocalStatListener(listener);
-    final int expectedSampleCountValue = sampleCountValue.get();
-    final int expectedSampleCountChanged = sampleCountChanged.get();
-
-    // validate that there are no listeners now
-    assertTrue(statSampler.getLocalListeners().isEmpty());
-
-    // wait for 2 stat samples to occur
-    waitForStatSample(statSamplerStats, expectedSampleCountValue, 5000, 10);
-
-    // validate that the listener did not fire
-    assertEquals(expectedSampleCountValue, sampleCountValue.get());
-    assertEquals(expectedSampleCountChanged, sampleCountChanged.get());
-  }
-
-  /**
-   * Invokes stop() and then validates that the sampler did in fact stop.
-   */
-  @Test
-  public void testStop() throws Exception {
-    connect(createGemFireProperties());
-
-    GemFireStatSampler statSampler = getGemFireStatSampler();
-    assertTrue(statSampler.waitForInitialization(5000));
-
-    // validate the stat sampler is running
-    StatisticsType statSamplerType = getStatisticsManager().findType("StatSampler");
-    Statistics[] statsArray = getStatisticsManager().findStatisticsByType(statSamplerType);
-    assertEquals(1, statsArray.length);
-
-    final Statistics statSamplerStats = statsArray[0];
-    final int initialSampleCount = statSamplerStats.getInt("sampleCount");
-    final int expectedSampleCount = initialSampleCount + 2;
-
-    waitForStatSample(statSamplerStats, expectedSampleCount, 20000, 10);
-
-    // stop the stat sampler
-    statSampler.stop();
-
-    // validate the stat sampler has stopped
-    final int stoppedSampleCount = statSamplerStats.getInt("sampleCount");
-
-    // the following should timeout rather than complete
-    assertStatValueDoesNotChange(statSamplerStats, "sampleCount", stoppedSampleCount, 5000, 10);
-
-    assertEquals(stoppedSampleCount, statSamplerStats.getInt("sampleCount"));
-  }
-
-  /**
-   * Verifies that archive rolling works correctly when archive-file-size-limit
-   * is specified.
-   */
-  @Test
-  public void testArchiveRolling() throws Exception {
-    final String dirName = this.testDir.getName() + File.separator + this.testName;
-    new File(dirName).mkdirs();
-    final String archiveFileName = dirName + File.separator + this.testName + ".gfs";
-
-    final File archiveFile = new File(archiveFileName);
-    final File archiveFile1 = new File(dirName + File.separator + this.testName + "-01-01.gfs");
-    final File archiveFile2 = new File(dirName + File.separator + this.testName + "-01-02.gfs");
-    final File archiveFile3 = new File(dirName + File.separator + this.testName + "-01-03.gfs");
-
-    // set the system property to use KB instead of MB for file size
-    System.setProperty(HostStatSampler.TEST_FILE_SIZE_LIMIT_IN_KB_PROPERTY, "true");
-    Properties props = createGemFireProperties();
-    props.setProperty(ARCHIVE_FILE_SIZE_LIMIT, "1");
-    props.setProperty(ARCHIVE_DISK_SPACE_LIMIT, "0");
-    props.setProperty(STATISTIC_ARCHIVE_FILE, archiveFileName);
-    connect(props);
-
-    assertTrue(getGemFireStatSampler().waitForInitialization(5000));
-
-    boolean done = false;
-    try {
-      for (StopWatch time = new StopWatch(true); !done && time.elapsedTimeMillis() < 4000; done = (getSampleCollector() != null && getSampleCollector().getStatArchiveHandler() != null)) {
-        Thread.sleep(10);
-      }
-    } catch (InterruptedException e) {
-      Thread.currentThread().interrupt();
-    }
-    assertTrue("Waiting for getSampleCollector().getStatArchiveHandler() to not be null", done);  
-
-    StatArchiveHandler statArchiveHandler = getSampleCollector().getStatArchiveHandler();
-    StatArchiveHandlerConfig config = statArchiveHandler.getStatArchiveHandlerConfig();
-    assertEquals(1 * 1024, config.getArchiveFileSizeLimit());
-    
-    waitForFileToExist(archiveFile, 4000, 10);
-    waitForFileToExist(archiveFile1, 4000, 10);
-    waitForFileToExist(archiveFile2, 4000, 10);
-    waitForFileToExist(archiveFile3, 4000, 10);
-  }
-
-  /**
-   * Verifies that archive removal works correctly when archive-disk-space-limit
-   * is specified.
-   */
-  @Test
-  public void testArchiveRemoval() throws Exception {
-    final String dirName = this.testDir.getName();// + File.separator + this.testName;
-    new File(dirName).mkdirs();
-    final String archiveFileName = dirName + File.separator + this.testName + ".gfs";
-
-    final File archiveFile = new File(archiveFileName);
-    final File archiveFile1 = new File(dirName + File.separator + this.testName + "-01-01.gfs");
-    final File archiveFile2 = new File(dirName + File.separator + this.testName + "-01-02.gfs");
-    final File archiveFile3 = new File(dirName + File.separator + this.testName + "-01-03.gfs");
-    final File archiveFile4 = new File(dirName + File.separator + this.testName + "-01-04.gfs");
-
-    final int sampleRate = 1000;
-    
-    // set the system property to use KB instead of MB for file size
-    System.setProperty(HostStatSampler.TEST_FILE_SIZE_LIMIT_IN_KB_PROPERTY, "true");
-    Properties props = createGemFireProperties();
-    props.setProperty(STATISTIC_ARCHIVE_FILE, archiveFileName);
-    props.setProperty(ARCHIVE_FILE_SIZE_LIMIT, "1");
-    props.setProperty(ARCHIVE_DISK_SPACE_LIMIT, "12");
-    props.setProperty(STATISTIC_SAMPLE_RATE, String.valueOf(sampleRate));
-    connect(props);
-
-    assertTrue(getGemFireStatSampler().waitForInitialization(5000));
-
-    boolean exists1 = false;
-    boolean exists2 = false;
-    boolean exists3 = false;
-    boolean exists4 = false;
-    boolean exists = false;
-    boolean done = false;
-    try {
-      for (StopWatch time = new StopWatch(true); !done && time.elapsedTimeMillis() < 10*sampleRate;) {
-        exists1 = exists1 || archiveFile1.exists();
-        exists2 = exists2 || archiveFile2.exists();
-        exists3 = exists3 || archiveFile3.exists();
-        exists4 = exists4 || archiveFile4.exists();
-        exists = exists || archiveFile.exists();
-        done = exists1 && exists2 && exists3 && exists4 && exists;      
-        if (!done) {
-          Thread.sleep(10);
-        }
-      }
-    } catch (InterruptedException e) {
-      Thread.currentThread().interrupt();
-    }
-    assertTrue("Waiting for archive files to exist:" 
-        + " exists1=" + exists1
-        + " exists2=" + exists2
-        + " exists3=" + exists3
-        + " exists4=" + exists4
-        + " exists=" + exists, done);
-    
-    waitForFileToDelete(archiveFile1, 10*sampleRate, 10);
-  }
-
-  @Test
-  public void testLocalStatListenerRegistration() throws Exception {
-    connect(createGemFireProperties());
-
-    final GemFireStatSampler statSampler = getGemFireStatSampler();
-    statSampler.waitForInitialization(5000);
-
-    final AtomicBoolean flag = new AtomicBoolean(false);
-    final LocalStatListener listener = new LocalStatListener(){
-      public void statValueChanged(double value) {
-        flag.set(true);
-      }
-    };
-    
-    final String tenuredPoolName = HeapMemoryMonitor.getTenuredMemoryPoolMXBean().getName();
-    logger.info("TenuredPoolName: {}", tenuredPoolName);
-    
-    final List<Statistics> list = ((StatisticsManager)this.system).getStatsList();
-    assertFalse(list.isEmpty());
-
-    boolean done = false;
-    try {
-      for (StopWatch time = new StopWatch(true); !done && time.elapsedTimeMillis() < 5000;) {
-        Thread.sleep(10);
-        int i=0;
-        synchronized (list) {
-          for (Object obj : list) {
-            ++i;
-            logger.info("List:{}:{}", i, obj);
-            if (obj instanceof StatisticsImpl) {
-              StatisticsImpl si = (StatisticsImpl)obj;
-              logger.info("stat:{}", si.getTextId());
-              if (si.getTextId().contains(tenuredPoolName)) {
-                statSampler.addLocalStatListener(listener, si, "currentUsedMemory");
-                done = true;
-              }
-            }
-          }
-        }
-        //done = false;
-      }
-    } catch (InterruptedException e) {
-      Thread.currentThread().interrupt();
-    }
-    assertTrue("Waiting for " + tenuredPoolName + " statistics to be added to create listener for", done);
-    
-    assertTrue("expected at least one stat listener, found " +
-        statSampler.getLocalListeners().size(), 
-        statSampler.getLocalListeners().size() > 0);     
-    
-    long maxTenuredMemory = HeapMemoryMonitor.getTenuredMemoryPoolMXBean()
-                          .getUsage().getMax();
-
-    //byte[] bytes = new byte[1024 * 1024 * 10];
-    byte[] bytes = new byte[(int)(maxTenuredMemory*0.01)];
-    Arrays.fill(bytes, Byte.MAX_VALUE);
-
-    done = false;
-    try {
-      for (StopWatch time = new StopWatch(true); !done && time.elapsedTimeMillis() < 5000; done = (flag.get())) {
-        Thread.sleep(10);
-      }
-    } catch (InterruptedException e) {
-      Thread.currentThread().interrupt();
-    }
-    assertTrue("Waiting for listener to set flag to true", done);
-  }
-  
-  @Override
-  protected StatisticsManager getStatisticsManager() {
-    return (InternalDistributedSystem)this.system;
-  }
-
-  protected OsStatisticsFactory getOsStatisticsFactory() {
-    return (InternalDistributedSystem)this.system;
-  }
-
-  private GemFireStatSampler getGemFireStatSampler() {
-    return ((InternalDistributedSystem)this.system).getStatSampler();
-  }
-  
-  private SampleCollector getSampleCollector() {
-    return getGemFireStatSampler().getSampleCollector();
-  }
-
-  private Properties createGemFireProperties() {
-    Properties props = new Properties();
-    props.setProperty(STATISTIC_SAMPLING_ENABLED, "true"); // TODO: test true/false
-    props.setProperty(ENABLE_TIME_STATISTICS, "true"); // TODO: test true/false
-    props.setProperty(STATISTIC_SAMPLE_RATE, String.valueOf(STAT_SAMPLE_RATE));
-    props.setProperty(ARCHIVE_FILE_SIZE_LIMIT, "0");
-    props.setProperty(ARCHIVE_DISK_SPACE_LIMIT, "0");
-    props.setProperty(MCAST_PORT, "0");
-    props.setProperty(LOCATORS, "");
-    return props;
-  }
-
-  /**
-   * Creates a fresh loner DistributedSystem for each test. Note
-   * that the DistributedSystem is the StatisticsManager/Factory/etc.
-   */
-  @SuppressWarnings("deprecation")
-  private void connect(Properties props) {
-    this.system = DistributedSystem.connect(props);
-  }
-
-  @SuppressWarnings("deprecation")
-  private void disconnect() {
-    if (this.system != null) {
-      this.system.disconnect();
-      this.system = null;
-    }
-  }
-
-//  public static class AsyncInvoker {
-//    public static AsyncInvocation invokeAsync(Runnable r) {
-//      return invokeAsync(r, "run", new Object[0]);
-//    }
-//    public static AsyncInvocation invokeAsync(Callable c) {
-//      return invokeAsync(c, "call", new Object[0]);
-//    }
-//    public static AsyncInvocation invokeAsync(
-//        final Object o, final String methodName, final Object[] args) {
-//      AsyncInvocation ai =
-//        new AsyncInvocation(o, methodName, new Runnable() {
-//          public void run() {
-//            MethExecutorResult result = 
-//                MethExecutor.executeObject(o, methodName, args);
-//            if (result.exceptionOccurred()) {
-//              throw new AsyncInvocationException(result.getException());
-//            }
-//            AsyncInvocation.setReturnValue(result.getResult());
-//          }
-//      });
-//      ai.start();
-//      return ai;
-//    }
-//    
-//    public static class AsyncInvocationException extends RuntimeException {
-//      private static final long serialVersionUID = -5522299018650622945L;
-//      /**
-//       * Creates a new <code>AsyncInvocationException</code>.
-//       */
-//      public AsyncInvocationException(String message) {
-//        super(message);
-//      }
-//
-//      /**
-//       * Creates a new <code>AsyncInvocationException</code> that was
-//       * caused by a given exception
-//       */
-//      public AsyncInvocationException(String message, Throwable thr) {
-//        super(message, thr);
-//      }
-//
-//      /**
-//       * Creates a new <code>AsyncInvocationException</code> that was
-//       * caused by a given exception
-//       */
-//      public AsyncInvocationException(Throwable thr) {
-//        super(thr.getMessage(), thr);
-//      }
-//    }
-//  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6a9444a5/geode-core/src/test/java/com/gemstone/gemfire/internal/LocalStatisticsImplJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/LocalStatisticsImplJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/LocalStatisticsImplJUnitTest.java
deleted file mode 100644
index a9b1ec7..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/LocalStatisticsImplJUnitTest.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package com.gemstone.gemfire.internal;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.*;
-
-import java.util.function.DoubleSupplier;
-import java.util.function.IntSupplier;
-import java.util.function.LongSupplier;
-
-import com.gemstone.gemfire.StatisticsType;
-import com.gemstone.gemfire.internal.LocalStatisticsImpl;
-import com.gemstone.gemfire.internal.StatisticsImpl;
-import com.gemstone.gemfire.internal.StatisticsManager;
-import com.gemstone.gemfire.internal.StatisticsTypeImpl;
-import com.gemstone.gemfire.test.junit.categories.UnitTest;
-
-import org.apache.commons.lang.ObjectUtils.Null;
-import org.apache.logging.log4j.Logger;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.rules.ExpectedException;
-
-@Category(UnitTest.class)
-public class LocalStatisticsImplJUnitTest {
-  @Rule
-  public ExpectedException thrown = ExpectedException.none();
-
-  private StatisticsImpl stats;
-
-  @Before
-  public void createStats() {
-    final StatisticsTypeImpl type = mock(StatisticsTypeImpl.class);
-    when(type.getIntStatCount()).thenReturn(5);
-    when(type.getDoubleStatCount()).thenReturn(5);
-    when(type.getLongStatCount()).thenReturn(5);
-    final String textId = "";
-    final long numbericId = 0;
-    final long uniqueId = 0;
-    final int osStatFlags = 0;
-    final boolean atomicIncrements = false;
-    final StatisticsManager system = mock(StatisticsManager.class);
-    stats = new LocalStatisticsImpl(type, textId, numbericId, uniqueId, atomicIncrements, osStatFlags, system);
-  }
-
-  @Test
-  public void invokeIntSuppliersShouldUpdateStats() {
-    IntSupplier supplier1 = mock(IntSupplier.class);
-    when(supplier1.getAsInt()).thenReturn(23);
-    stats.setIntSupplier(4, supplier1);
-    assertEquals(0, stats.invokeSuppliers());
-
-    verify(supplier1).getAsInt();
-    assertEquals(23, stats.getInt(4));
-  }
-
-  @Test
-  public void invokeLongSuppliersShouldUpdateStats() {
-    LongSupplier supplier1 = mock(LongSupplier.class);
-    when(supplier1.getAsLong()).thenReturn(23L);
-    stats.setLongSupplier(4, supplier1);
-    assertEquals(0, stats.invokeSuppliers());
-
-    verify(supplier1).getAsLong();
-    assertEquals(23L, stats.getLong(4));
-  }
-
-  @Test
-  public void invokeDoubleSuppliersShouldUpdateStats() {
-    DoubleSupplier supplier1 = mock(DoubleSupplier.class);
-    when(supplier1.getAsDouble()).thenReturn(23.3);
-    stats.setDoubleSupplier(4, supplier1);
-    assertEquals(0, stats.invokeSuppliers());
-
-    verify(supplier1).getAsDouble();
-    assertEquals(23.3, stats.getDouble(4), 0.1f);
-  }
-
-  @Test
-  public void getSupplierCountShouldReturnCorrectCount() {
-    IntSupplier supplier1 = mock(IntSupplier.class);
-    stats.setIntSupplier(4, supplier1);
-    assertEquals(1, stats.getSupplierCount());
-  }
-
-  @Test
-  public void invokeSuppliersShouldCatchSupplierErrorsAndReturnCount() {
-    IntSupplier supplier1 = mock(IntSupplier.class);
-    when(supplier1.getAsInt()).thenThrow(NullPointerException.class);
-    stats.setIntSupplier(4, supplier1);
-    assertEquals(1, stats.invokeSuppliers());
-
-    verify(supplier1).getAsInt();
-  }
-
-  @Test
-  public void invokeSuppliersShouldLogErrorOnlyOnce() {
-    final Logger originalLogger = StatisticsImpl.logger;
-    try {
-      final Logger logger = mock(Logger.class);
-      StatisticsImpl.logger = logger;
-      IntSupplier supplier1 = mock(IntSupplier.class);
-      when(supplier1.getAsInt()).thenThrow(NullPointerException.class);
-      stats.setIntSupplier(4, supplier1);
-      assertEquals(1, stats.invokeSuppliers());
-      verify(logger, times(1)).warn(anyString(), anyString(), anyInt(), isA(NullPointerException.class));
-      assertEquals(1, stats.invokeSuppliers());
-      //Make sure the logger isn't invoked again
-      verify(logger, times(1)).warn(anyString(), anyString(), anyInt(), isA(NullPointerException.class));
-    } finally {
-      StatisticsImpl.logger = originalLogger;
-    }
-  }
-
-  @Test
-  public void badSupplierParamShouldThrowError() {
-    IntSupplier supplier1 = mock(IntSupplier.class);
-    when(supplier1.getAsInt()).thenReturn(23);
-    thrown.expect(IllegalArgumentException.class);
-    stats.setIntSupplier(23, supplier1);
-  }
-}


Mime
View raw message