geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [20/24] incubator-geode git commit: GEODE-1781: refactor internal statistics classes
Date Thu, 18 Aug 2016 16:30:54 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/750996a0/geode-core/src/main/java/com/gemstone/gemfire/internal/HostStatHelper.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/HostStatHelper.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/HostStatHelper.java
deleted file mode 100644
index 7ff0b1b..0000000
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/HostStatHelper.java
+++ /dev/null
@@ -1,289 +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.*;
-//import com.gemstone.gemfire.util.*;
-import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-
-/**
- * Provides native methods which fetch operating system statistics.
- */
-public class HostStatHelper {
-  static final int SOLARIS_CODE = 1; // Sparc Solaris
-  static final int WINDOWS_CODE = 2;
-  static final int LINUX_CODE = 3; // x86 Linux
-  static final int OSX_CODE = 4;  // Mac OS X
-
-  static final int PROCESS_STAT_FLAG = 1;
-  static final int SYSTEM_STAT_FLAG = 2;
-  
-  static final int osCode;
-
-  static {
-    String osName = System.getProperty("os.name", "unknown");
-    if (! PureJavaMode.osStatsAreAvailable()) {
-      throw new RuntimeException(LocalizedStrings.HostStatHelper_HOSTSTATHELPER_NOT_ALLOWED_IN_PURE_JAVA_MODE.toLocalizedString());
-    } else if (osName.equals("SunOS")) {
-      osCode = SOLARIS_CODE;
-    } else if (osName.startsWith("Windows")) {
-      osCode = WINDOWS_CODE;
-    } else if (osName.startsWith("Linux")) {
-      osCode = LINUX_CODE;
-    } else if (osName.equals("Mac OS X")) { 
-      osCode = OSX_CODE;
-    } else {
-      throw new InternalGemFireException(LocalizedStrings.HostStatHelper_UNSUPPORTED_OS_0_SUPPORTED_OSS_ARE_SUNOSSPARC_SOLARIS_LINUXX86_AND_WINDOWS.toLocalizedString(osName));
-    }
-  }
-  public static boolean isWindows() {
-    return osCode == WINDOWS_CODE;
-  }
-  public static boolean isUnix() {
-    return osCode != WINDOWS_CODE;
-  }
-  public static boolean isSolaris() {
-    return osCode == SOLARIS_CODE;
-  }
-  public static boolean isLinux() {
-    return osCode == LINUX_CODE;
-  }
-  public static boolean isOSX() {
-      return osCode == OSX_CODE;
-  }
-  
-  private HostStatHelper() {
-    // instances are not allowed
-  }
-
-  static int initOSStats() {
-    if(isLinux()) {
-      return LinuxProcFsStatistics.init();
-    } else {
-      return HostStatHelper.init();
-    }
-  }
-  
-  static void closeOSStats() {
-    if(isLinux()) {
-      LinuxProcFsStatistics.close();
-    } else {
-      HostStatHelper.close();
-    }
-  }
-  
-  static void readyRefreshOSStats() {
-    if(isLinux()) {
-      LinuxProcFsStatistics.readyRefresh();
-    } else {
-      HostStatHelper.readyRefresh();
-    }
-  }
-  
-  /**
-   * Allocates and initializes any resources required to sample
-   * operating system statistics.
-   * returns 0 if initialization succeeded
-   */
-  private static native int init();
-  /**
-   * Frees up resources used by this class. Once close is called this
-   * class can no longer be used.
-   */
-  private static native void close();
-  /**
-   * Should be called before any calls to the refresh methods.
-   * On some platforms if this is not called then the refesh methods
-   * will just keep returning the same old data.
-   */
-  private static native void readyRefresh();
-  /**
-   * Refreshes the specified process stats instance by fetching
-   * the current OS values for the given stats and storing them in the instance.
-   */
-  private static void refreshProcess(LocalStatisticsImpl s) {
-    int pid = (int)s.getNumericId();
-    if(isLinux()) {
-      LinuxProcFsStatistics.refreshProcess(pid, s._getIntStorage(), s._getLongStorage(), s._getDoubleStorage());
-    } else {
-      refreshProcess(pid, s._getIntStorage(), s._getLongStorage(), s._getDoubleStorage());
-    }  
-  }
-  private static native void refreshProcess(int pid, int[] ints, long[] longs, double[] doubles);
-  /**
-   * Refreshes the specified system stats instance by fetching
-   * the current OS values for the local machine and storing them in
-   * the instance.
-   */
-  private static void refreshSystem(LocalStatisticsImpl s) {
-    if(isLinux()) {
-      LinuxProcFsStatistics.refreshSystem(s._getIntStorage(), s._getLongStorage(), s._getDoubleStorage());
-    } else {
-      refreshSystem(s._getIntStorage(), s._getLongStorage(), s._getDoubleStorage());
-    }
-  }
-  private static native void refreshSystem(int[] ints, long[] longs, double[] doubles);
-
-  /**
-   * The call should have already checked to make sure
-   * usesSystemCalls returns true.
-   */
-  public static void refresh(LocalStatisticsImpl stats) {
-    int flags = stats.getOsStatFlags();
-    if ((flags & PROCESS_STAT_FLAG) != 0) {
-      HostStatHelper.refreshProcess(stats);
-    } else if ((flags & SYSTEM_STAT_FLAG) != 0) {
-      HostStatHelper.refreshSystem(stats);
-    } else {
-      throw new RuntimeException(LocalizedStrings.HostStatHelper_UNEXPECTED_OS_STATS_FLAGS_0.toLocalizedString(Integer.valueOf(flags)));
-    }
-  }
-  
-  /**
-   * Creates and returns a {@link Statistics} with
-   * the given pid and name. The resource's stats will contain a snapshot
-   * of the current statistic values for the specified process.
-   */
-  public static Statistics newProcess(OsStatisticsFactory f, long pid, String name) {
-    Statistics stats;
-    switch (osCode) {
-    case SOLARIS_CODE:
-      stats = f.createOsStatistics(SolarisProcessStats.getType(),
-                                   name, pid, PROCESS_STAT_FLAG);
-      break;
-    case LINUX_CODE:
-      stats = f.createOsStatistics(LinuxProcessStats.getType(),
-                                   name, pid, PROCESS_STAT_FLAG);
-      break;
-    case OSX_CODE:
-        stats = f.createOsStatistics(OSXProcessStats.getType(),
-                                     name, pid, PROCESS_STAT_FLAG);
-        break;
-    case WINDOWS_CODE:
-      stats = f.createOsStatistics(WindowsProcessStats.getType(),
-                                   name, pid, PROCESS_STAT_FLAG);
-      break;
-    default:
-      throw new InternalGemFireException(LocalizedStrings.HostStatHelper_UNHANDLED_OSCODE_0_HOSTSTATHELPERNEWPROCESS.toLocalizedString(Integer.valueOf(osCode)));
-    }
-    // Note we don't call refreshProcess since we only want the manager to do that
-    return stats;
-  }
-
-  /**
-   * Creates a new <code>ProcessStats</code> instance that wraps the
-   * given <code>Statistics</code>.
-   *
-   * @see #newProcess
-   * @since GemFire 3.5
-   */
-  static ProcessStats newProcessStats(Statistics stats) {
-    switch (osCode) {
-    case SOLARIS_CODE:
-      return SolarisProcessStats.createProcessStats(stats);
-
-    case LINUX_CODE:
-      return LinuxProcessStats.createProcessStats(stats);
-
-    case WINDOWS_CODE:
-      return WindowsProcessStats.createProcessStats(stats);
-
-    case OSX_CODE:
-        return OSXProcessStats.createProcessStats(stats);
-        
-    default:
-      throw new InternalGemFireException(LocalizedStrings.HostStatHelper_UNHANDLED_OSCODE_0_HOSTSTATHELPERNEWPROCESSSTATS.toLocalizedString(Integer.valueOf(osCode)));
-    }
-  }
-
-  /**
-   * Creates and returns a {@link Statistics} with the current
-   * machine's stats. The resource's stats will contain a snapshot
-   * of the current statistic values for the local machine.
-   */
-  static void newSystem(OsStatisticsFactory f) {
-    Statistics stats;
-    switch (osCode) {
-    case SOLARIS_CODE:
-      stats = f.createOsStatistics(SolarisSystemStats.getType(),
-                                   getHostSystemName(),
-                                   getHostSystemId(),
-                                   SYSTEM_STAT_FLAG);
-      break;
-    case LINUX_CODE:
-      stats = f.createOsStatistics(LinuxSystemStats.getType(),
-                                   getHostSystemName(),
-                                   getHostSystemId(),
-                                   SYSTEM_STAT_FLAG);
-      break;
-    case WINDOWS_CODE:
-      stats = f.createOsStatistics(WindowsSystemStats.getType(),
-                                   getHostSystemName(),
-                                   getHostSystemId(),
-                                   SYSTEM_STAT_FLAG);
-      break;
-    case OSX_CODE:
-      stats = f.createOsStatistics(OSXSystemStats.getType(),
-                                     getHostSystemName(),
-                                     getHostSystemId(),
-                                     SYSTEM_STAT_FLAG);
-      break;
-    default:
-      throw new InternalGemFireException(LocalizedStrings.HostStatHelper_UNHANDLED_OSCODE_0_HOSTSTATHELPERNEWSYSTEM.toLocalizedString(Integer.valueOf(osCode)));
-    }
-    if (stats instanceof LocalStatisticsImpl) {
-      refreshSystem((LocalStatisticsImpl)stats);
-    } // otherwise its a Dummy implementation so do nothing
-  }
-
-  /**
-   * @return this machine's fully qualified hostname 
-   *         or "unknownHostName" if one cannot be found.
-   */
-  private static String getHostSystemName() {
-    String hostname = "unknownHostName";
-    try {
-      InetAddress addr = SocketCreator.getLocalHost();
-      hostname = addr.getCanonicalHostName();
-    } catch (UnknownHostException uhe) {
-    }
-    return hostname;
-  }
-  
-  /** 
-   * Generate a systemid based off of the ip address of the host.
-   * This duplicates the common implementation of 
-   * <code>long gethostid(void) </code>.
-   * Punt on the ipv6 case and just use the same algorithm.
-   * @return a psuedo unique id based on the ip address
-   */
-  private static long getHostSystemId() {
-    long id = 0L;
-    try {
-      InetAddress host = SocketCreator.getLocalHost();
-      byte[] addr = host.getAddress();
-      id = (addr[1] & 0xFFL) << 24 |  
-           (addr[0] & 0xFFL) << 16 |  
-           (addr[3] & 0xFFL) << 8  |  
-           (addr[2] & 0xFFL) << 0;
-    } catch (UnknownHostException uhe) {
-    }
-    return id;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/750996a0/geode-core/src/main/java/com/gemstone/gemfire/internal/HostStatSampler.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/HostStatSampler.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/HostStatSampler.java
deleted file mode 100644
index ff9d2fb..0000000
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/HostStatSampler.java
+++ /dev/null
@@ -1,550 +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.CancelCriterion;
-import com.gemstone.gemfire.CancelException;
-import com.gemstone.gemfire.Statistics;
-import com.gemstone.gemfire.SystemFailure;
-import com.gemstone.gemfire.distributed.internal.DistributionConfig;
-import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
-import com.gemstone.gemfire.internal.logging.LogService;
-import com.gemstone.gemfire.internal.logging.LoggingThreadGroup;
-import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage;
-import com.gemstone.gemfire.internal.logging.log4j.LogMarker;
-import com.gemstone.gemfire.internal.statistics.CallbackSampler;
-import com.gemstone.gemfire.internal.statistics.SampleCollector;
-import com.gemstone.gemfire.internal.statistics.StatArchiveHandlerConfig;
-import com.gemstone.gemfire.internal.statistics.StatisticsSampler;
-import com.gemstone.gemfire.internal.util.concurrent.StoppableCountDownLatch;
-import org.apache.logging.log4j.Logger;
-
-import java.io.File;
-import java.net.UnknownHostException;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
-/**
- * HostStatSampler implements a thread which will monitor, sample, and archive
- * statistics. It only has the common functionality that any sampler needs.
-
- */
-public abstract class HostStatSampler 
-    implements Runnable, StatisticsSampler, StatArchiveHandlerConfig {
-
-  private static final Logger logger = LogService.getLogger();
-
-  public static final String TEST_FILE_SIZE_LIMIT_IN_KB_PROPERTY = DistributionConfig.GEMFIRE_PREFIX + "stats.test.fileSizeLimitInKB";
-  public static final String OS_STATS_DISABLED_PROPERTY = "osStatsDisabled";
-
-  protected static final String INITIALIZATION_TIMEOUT_PROPERTY = DistributionConfig.GEMFIRE_PREFIX + "statSamplerInitializationTimeout";
-  protected static final int INITIALIZATION_TIMEOUT_DEFAULT = 30000;
-  protected static final long INITIALIZATION_TIMEOUT_MILLIS = 
-      Long.getLong(INITIALIZATION_TIMEOUT_PROPERTY, INITIALIZATION_TIMEOUT_DEFAULT);
-  
-  /** 
-   * Used to check if the sampler thread wake-up is delayed, and log a warning if it is delayed by longer than 
-   * the amount of milliseconds specified by this property. The value of 0 disables the check. 
-   */
-  private static final long STAT_SAMPLER_DELAY_THRESHOLD = Long.getLong(DistributionConfig.GEMFIRE_PREFIX + "statSamplerDelayThreshold", 3000);
-  private static final long STAT_SAMPLER_DELAY_THRESHOLD_NANOS = NanoTimer.millisToNanos(STAT_SAMPLER_DELAY_THRESHOLD);
-  
-  private static final int MIN_MS_SLEEP = 1;
-  
-  private static final int WAIT_FOR_SLEEP_INTERVAL = 10;
-  
-  private static Thread statThread = null;
-
-  private volatile boolean stopRequested = false;
-  
-  private final boolean osStatsDisabled = Boolean.getBoolean(OS_STATS_DISABLED_PROPERTY);
-  private final boolean fileSizeLimitInKB;
-  private final StatSamplerStats samplerStats;
-  
-  private VMStatsContract vmStats;
-  private SampleCollector sampleCollector;
-
-  /**
-   * Used to signal thread that are waiting for the stat sampler to be initialized.
-   */
-  private final StoppableCountDownLatch statSamplerInitializedLatch;
-
-  private final CancelCriterion stopper;
-
-  private final CallbackSampler callbackSampler;
-  
-  protected HostStatSampler(CancelCriterion stopper, 
-                            StatSamplerStats samplerStats) {
-    this.stopper = stopper;
-    this.statSamplerInitializedLatch = new StoppableCountDownLatch(this.stopper, 1);
-    this.samplerStats = samplerStats;
-    this.fileSizeLimitInKB = Boolean.getBoolean(TEST_FILE_SIZE_LIMIT_IN_KB_PROPERTY);
-    this.callbackSampler = new CallbackSampler(stopper, samplerStats);
-  }
-  
-  public final StatSamplerStats getStatSamplerStats() {
-    return this.samplerStats;
-  }
-  
-  /**
-   * Returns the number of times a statistics resource has been add or deleted.
-   */
-  @Override
-  public final int getStatisticsModCount() {
-    return getStatisticsManager().getStatListModCount();
-  }
-
-  /**
-   * Returns an array of all the current statistic resource instances.
-   */
-  @Override
-  public final Statistics[] getStatistics() {
-    return getStatisticsManager().getStatistics();
-  }
-
-  /**
-   * Returns a unique id for the sampler's system.
-   */
-  @Override
-  public final long getSystemId() {
-    return getStatisticsManager().getId();
-  }
-
-  /**
-   * Returns the time this sampler's system was started.
-   */
-  @Override
-  public final long getSystemStartTime() {
-    return getStatisticsManager().getStartTime();
-  }
-
-  /**
-   * Returns the path to this sampler's system directory; if it has one.
-   */
-  @Override
-  public final String getSystemDirectoryPath() {
-    try {
-      return SocketCreator.getHostName(SocketCreator.getLocalHost());
-    } catch (UnknownHostException ignore) {
-      return "";
-    }
-  }
-
-  @Override
-  public boolean waitForSample(long timeout) throws InterruptedException {
-    final long endTime = System.currentTimeMillis() + timeout;
-    final int startSampleCount = this.samplerStats.getSampleCount();
-    while (System.currentTimeMillis() < endTime && 
-        this.samplerStats.getSampleCount() <= startSampleCount) {
-      Thread.sleep(WAIT_FOR_SLEEP_INTERVAL);
-    }
-    return this.samplerStats.getSampleCount() > startSampleCount;
-  }
-
-  @Override
-  public SampleCollector waitForSampleCollector(long timeout) throws InterruptedException {
-    final long endTime = System.currentTimeMillis() + timeout;
-    while (System.currentTimeMillis() < endTime && 
-        this.sampleCollector == null || !this.sampleCollector.isInitialized()) {
-      Thread.sleep(WAIT_FOR_SLEEP_INTERVAL);
-    }
-    return this.sampleCollector;
-  }
-  
-  /**
-   * This service's main loop
-   */
-  @Override
-  public final void run() {
-    NanoTimer timer = new NanoTimer();
-
-    final boolean isDebugEnabled_STATISTICS = logger.isTraceEnabled(LogMarker.STATISTICS);
-    if (isDebugEnabled_STATISTICS) {
-      logger.trace(LogMarker.STATISTICS, "HostStatSampler started");
-    }
-    boolean latchCountedDown = false;
-    try {
-      initSpecialStats();
-      
-      this.sampleCollector = new SampleCollector(this);
-      this.sampleCollector.initialize(this, NanoTimer.getTime());
-      
-      this.statSamplerInitializedLatch.countDown();
-      latchCountedDown = true;
-
-      timer.reset();
-      // subtract getNanoRate from lastTS to force a quick initial sample
-      long nanosLastTimeStamp = timer.getLastResetTime() - getNanoRate();
-      while (!stopRequested()) {
-        SystemFailure.checkFailure();
-        if (Thread.currentThread().isInterrupted()) {
-          break;
-        }
-        final long nanosBeforeSleep = timer.getLastResetTime();
-        final long nanosToDelay = nanosLastTimeStamp + getNanoRate();
-        delay(timer, nanosToDelay);
-        nanosLastTimeStamp = timer.getLastResetTime();
-        if (!stopRequested() && isSamplingEnabled()) {
-          final long nanosTimeStamp = timer.getLastResetTime();
-          final long nanosElapsedSleeping = nanosTimeStamp - nanosBeforeSleep;
-          checkElapsedSleepTime(nanosElapsedSleeping);
-          if (stopRequested()) break;
-          sampleSpecialStats(false);
-          if (stopRequested()) break;
-          checkListeners();
-          if (stopRequested()) break;
-          
-          this.sampleCollector.sample(nanosTimeStamp);
-          
-          final long nanosSpentWorking = timer.reset();
-          accountForTimeSpentWorking(nanosSpentWorking, nanosElapsedSleeping);
-        } else if (!stopRequested() && !isSamplingEnabled()) {
-          sampleSpecialStats(true); // fixes bug 42527
-        }
-      }
-    } 
-    catch (InterruptedException ex) {
-      // Silently exit
-    }
-    catch (CancelException ex) {
-      // Silently exit
-    }
-    catch (RuntimeException ex) {
-      logger.fatal(LogMarker.STATISTICS, ex.getMessage(), ex);
-      throw ex;
-    } 
-    catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error.  We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    }
-    catch (Error ex) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above).  However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.fatal(LogMarker.STATISTICS, ex.getMessage(), ex);
-      throw ex;
-    } finally {
-      try {
-      closeSpecialStats();
-      if (this.sampleCollector != null) {
-        this.sampleCollector.close();
-      }
-      } finally {
-        if (!latchCountedDown) {
-          // Make sure the latch gets counted down since
-          // other threads wait for this to indicate that 
-          // the sampler is initialized.
-          this.statSamplerInitializedLatch.countDown();
-        }
-      }
-      if (isDebugEnabled_STATISTICS) {
-        logger.trace(LogMarker.STATISTICS, "HostStatSampler stopped");
-      }
-    }
-  }
-
-  /**
-   * Starts the main thread for this service.
-   * @throws IllegalStateException if an instance of the {@link #statThread} is still running from a previous DistributedSystem.
-   */
-  public final void start() {
-    synchronized(HostStatSampler.class) { 
-      if (statThread != null) {
-        try {
-          int msToWait = getSampleRate() + 100;
-          statThread.join(msToWait);
-        } catch (InterruptedException ex) {
-          Thread.currentThread().interrupt();
-        } 
-        if (statThread.isAlive()) {
-          throw new IllegalStateException(LocalizedStrings.HostStatSampler_STATISTICS_SAMPLING_THREAD_IS_ALREADY_RUNNING_INDICATING_AN_INCOMPLETE_SHUTDOWN_OF_A_PREVIOUS_CACHE.toLocalizedString());
-        }
-      }  
-      ThreadGroup group = 
-        LoggingThreadGroup.createThreadGroup("StatSampler Threads");
-
-      this.callbackSampler.start(getStatisticsManager(), group, getSampleRate(), TimeUnit.MILLISECONDS);
-      statThread = new Thread(group, this);
-      statThread.setName(statThread.getName() + " StatSampler");
-      statThread.setPriority(Thread.MAX_PRIORITY);
-      statThread.setDaemon(true);
-      statThread.start();
-      // fix #46310 (race between management and sampler init) by waiting for init here
-      try {
-        waitForInitialization(INITIALIZATION_TIMEOUT_MILLIS);
-      } catch (InterruptedException e) {
-        Thread.currentThread().interrupt();
-      }
-    }
-  }
-  
-  /**
-   * Tell this service's main thread to terminate.
-   */
-  public final void stop() {
-    stop(true);
-  }
-  private final void stop(boolean interruptIfAlive) {
-    synchronized (HostStatSampler.class) {
-      this.callbackSampler.stop();
-      if ( statThread == null) {
-        return; 
-      }
-
-      this.stopRequested = true;
-      synchronized (this) {
-        this.notifyAll();
-      }
-      try {
-        statThread.join(5000);
-      } catch (InterruptedException ignore) {
-        //It is important that we shutdown so we'll continue trying for another 2 seconds
-        try {
-          statThread.join(2000);
-        } catch (InterruptedException ex) {
-        } finally {
-          Thread.currentThread().interrupt();
-        }
-      } finally {
-        if ( statThread.isAlive() ) {
-          if (interruptIfAlive) {
-            // It is still alive so interrupt the thread
-            statThread.interrupt();
-            stop(false);
-          } else {
-            logger.warn(LogMarker.STATISTICS, LocalizedMessage.create(LocalizedStrings.HostStatSampler_HOSTSTATSAMPLER_THREAD_COULD_NOT_BE_STOPPED));
-          }
-        } else {
-          this.stopRequested = false;
-          statThread = null;
-        }
-      }
-    }
-  }
-  
-  public final boolean isAlive() {
-    synchronized (HostStatSampler.class) {
-      return statThread != null && statThread.isAlive();
-    }
-  }
-
-  /**
-   * Waits for the special statistics to be initialized. For tests, please
-   * use {@link #waitForInitialization(long)} instead.
-   *
-   * @see #initSpecialStats
-   * @since GemFire 3.5
-   */
-  public final void waitForInitialization() throws InterruptedException {
-    this.statSamplerInitializedLatch.await();
-  }
-  
-  /**
-   * Waits for the special statistics to be initialized. This overridden
-   * version of {@link #waitForInitialization()} should always be used
-   * within tests.
-   *
-   * @see #initSpecialStats
-   * @since GemFire 7.0
-   */
-  public final boolean waitForInitialization(long ms) throws InterruptedException {
-    return this.statSamplerInitializedLatch.await(ms);
-  }
-  
-  public final void changeArchive(File newFile) {
-    this.sampleCollector.changeArchive(newFile, NanoTimer.getTime());
-  }
-  
-  /**
-   * Returns the <code>VMStatsContract</code> for this VM.
-   *
-   * @since GemFire 3.5
-   */
-  public final VMStatsContract getVMStats() {
-    return this.vmStats;
-  }
-
-  @Override
-  public String toString() {
-    final StringBuilder sb = new StringBuilder(getClass().getName());
-    sb.append("@").append(System.identityHashCode(this));
-    return sb.toString();
-  }
-
-  protected abstract void checkListeners();
-
-  /**
-   * Gets the sample rate in milliseconds
-   */
-  protected abstract int getSampleRate();
-  
-  /**
-   * Returns true if sampling is enabled.
-   */
-  public abstract boolean isSamplingEnabled();
-  
-  /**
-   * Returns the statistics manager using this sampler.
-   */
-  protected abstract StatisticsManager getStatisticsManager();
-
-  protected OsStatisticsFactory getOsStatisticsFactory() {
-    return null;
-  }
-  
-  protected void initProcessStats(long id) {
-    // do nothing by default
-  }
-  
-  protected void sampleProcessStats(boolean prepareOnly) {
-    // do nothing by default
-  }
-  
-  protected void closeProcessStats() {
-    // do nothing by default
-  }
-
-  protected long getSpecialStatsId() {
-    return getStatisticsManager().getId();
-  }
-  
-  protected final boolean fileSizeLimitInKB() {
-    return this.fileSizeLimitInKB;
-  }
-  
-  protected final boolean osStatsDisabled() {
-    return this.osStatsDisabled;
-  }
-  
-  protected final boolean stopRequested() {
-    return stopper.isCancelInProgress() || this.stopRequested;
-  }
-
-  public final SampleCollector getSampleCollector() {
-    return this.sampleCollector;
-  }
-  
-  /**
-   * Initialize any special sampler stats
-   */
-  private synchronized void initSpecialStats() {
-    // add a vm resource
-    long id = getSpecialStatsId();
-    this.vmStats = VMStatsContractFactory.create(getStatisticsManager(), id);
-    initProcessStats(id);
-  }
-
-  /**
-   * Closes down anything initialied by initSpecialStats.
-   */
-  private synchronized void closeSpecialStats() {
-    if (this.vmStats != null) {
-      this.vmStats.close();
-    }
-    closeProcessStats();
-  }
-  
-  /**
-   * Called when this sampler has spent some time working and wants
-   * it to be accounted for.
-   */
-  private void accountForTimeSpentWorking(long nanosSpentWorking, 
-                                          long nanosSpentSleeping) {
-    this.samplerStats.tookSample(
-        nanosSpentWorking, getStatisticsManager().getStatisticsCount(), nanosSpentSleeping);
-  }
-  
-  /**
-   * @param timer a NanoTimer used to compute the elapsed delay
-   * @param nanosToDelay the timestamp to delay until it is the current time
-   */
-  private void delay(NanoTimer timer, final long nanosToDelay) throws InterruptedException {
-    timer.reset();
-    long now = timer.getLastResetTime();
-    long remainingNanos = nanosToDelay - now;
-    if (remainingNanos <= 0) {
-      remainingNanos = NanoTimer.millisToNanos(MIN_MS_SLEEP);
-    }
-    while (remainingNanos > 0 && !stopRequested()) {
-      long ms = NanoTimer.nanosToMillis(remainingNanos);
-      if (ms <= 0) {
-        Thread.yield();
-      } else {
-        if (ms > MIN_MS_SLEEP) {
-          ms -= MIN_MS_SLEEP;
-        }
-        synchronized (this) {
-          if (stopRequested()) {
-            // check stopRequested inside the sync to prevent a race in which the wait misses the stopper's notify.
-            return;
-          }
-          this.wait(ms); // spurious wakeup ok
-        }
-      }
-      timer.reset();
-      now = timer.getLastResetTime();
-      remainingNanos = nanosToDelay - now;
-    }
-  }
-  
-  private long getNanoRate() {
-    return NanoTimer.millisToNanos(getSampleRate());
-  }
-  
-  /**
-   * Collect samples of any operating system statistics
-   * 
-   * @param prepareOnly
-   *          set to true if you only want to call prepareForSample
-   */
-  private void sampleSpecialStats(boolean prepareOnly) {
-    List<Statistics> statsList = getStatisticsManager().getStatsList();
-    for (Statistics s : statsList) {
-      if (stopRequested()) return;
-      if (s instanceof StatisticsImpl) {
-        ((StatisticsImpl)s).prepareForSample();
-      }
-    }
-
-    if (!prepareOnly && this.vmStats != null) {
-      if (stopRequested()) return;
-      this.vmStats.refresh();
-    }
-    sampleProcessStats(prepareOnly);
-  }
-
-  /**
-   * Check the elapsed sleep time upon wakeup, and log a warning if it is longer than the delay
-   * threshold.
-   * 
-   * @param elapsedSleepTime duration of sleep in nanoseconds
-   */
-  private void checkElapsedSleepTime(long elapsedSleepTime) {
-    if (STAT_SAMPLER_DELAY_THRESHOLD > 0) {
-      final long wakeupDelay = elapsedSleepTime - getNanoRate();
-      if (wakeupDelay > STAT_SAMPLER_DELAY_THRESHOLD_NANOS) {
-        this.samplerStats.incJvmPauses();
-        logger.warn(LogMarker.STATISTICS, LocalizedMessage.create(LocalizedStrings.HostStatSampler_STATISTICS_SAMPLING_THREAD_DETECTED_A_WAKEUP_DELAY_OF_0_MS_INDICATING_A_POSSIBLE_RESOURCE_ISSUE, NanoTimer.nanosToMillis(wakeupDelay)));
-      }
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/750996a0/geode-core/src/main/java/com/gemstone/gemfire/internal/LinuxProcFsStatistics.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/LinuxProcFsStatistics.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/LinuxProcFsStatistics.java
deleted file mode 100644
index 3070287..0000000
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/LinuxProcFsStatistics.java
+++ /dev/null
@@ -1,783 +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.distributed.internal.DistributionConfig;
-import org.apache.logging.log4j.Logger;
-
-import java.io.*;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.NoSuchElementException;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class LinuxProcFsStatistics {
-  private enum CPU { 
-    USER, NICE, SYSTEM, IDLE, IOWAIT, IRQ, SOFTIRQ,
-    /** stands for aggregation of all columns not present in the enum list*/
-    OTHER
-  }  
-  
-  private static final int DEFAULT_PAGESIZE = 4 * 1024;
-  private static final int OneMeg = 1024 * 1024;
-  private static final String pageSizeProperty = DistributionConfig.GEMFIRE_PREFIX + "statistics.linux.pageSize";
-  private static CpuStat cpuStatSingleton;
-  private static int pageSize;
-  private static int sys_cpus;
-  private static boolean hasProcVmStat;
-  private static boolean hasDiskStats;
-  static SpaceTokenizer st;
- 
-  /** The number of non-process files in /proc */
-  private static int nonPidFilesInProc;
-
-  /** /proc/stat tokens */
-  private static final String CPU_TOKEN = "cpu ";
-  private static final String PAGE = "page ";
-  private static final String SWAP = "swap ";
-  private static final String CTXT = "ctxt ";
-  private static final String PROCESSES = "processes ";
-  
-  /** /proc/vmstat tokens */
-  private static final String PGPGIN = "pgpgin ";
-  private static final String PGPGOUT = "pgpgout ";
-  private static final String PSWPIN = "pswpin ";
-  private static final String PSWPOUT = "pswpout ";
-  
-  //Do not create instances of this class
-  private LinuxProcFsStatistics() {
-  }
-  
-  static int init() {
-    nonPidFilesInProc = getNumberOfNonProcessProcFiles();
-    sys_cpus = Runtime.getRuntime().availableProcessors();
-    pageSize = Integer.getInteger(pageSizeProperty, DEFAULT_PAGESIZE);
-    cpuStatSingleton = new CpuStat();
-    hasProcVmStat = new File("/proc/vmstat").exists();
-    hasDiskStats = new File("/proc/diskstats").exists();
-    st = new SpaceTokenizer();
-    return 0;
-  }
-
-  static void close() {
-    cpuStatSingleton = null;
-    st = null;
-  }
-  
-  static void readyRefresh() {
-  }
-  
-  /* get the statistics for the specified process. 
-   * ( pid_rssSize, pid_imageSize )
-   * vsize is assumed to be in units of kbytes
-   * System property gemfire.statistics.pagesSize can be used to configure 
-   * pageSize. This is the mem_unit member of the struct returned by sysinfo()
-   * 
-   */ 
-  static void refreshProcess(int pid, int[] ints, long[] longs, double[] doubles) {
-    //Just incase a pid is not available
-    if(pid == 0) return;
-    InputStreamReader isr = null;
-    BufferedReader br = null;
-    try {
-      File file = new File( "/proc/" + pid + "/stat" );
-      isr = new InputStreamReader( new FileInputStream( file ));
-      br = new BufferedReader(isr, 2048);
-      String line = br.readLine();
-      if ( line == null ) {
-        return;
-      }
-      st.setString(line);
-      st.skipTokens(22);
-      ints[LinuxProcessStats.imageSizeINT] = (int) (st.nextTokenAsLong() / OneMeg);
-      ints[LinuxProcessStats.rssSizeINT] = (int) ((st.nextTokenAsLong()*pageSize)/OneMeg);
-    } catch ( NoSuchElementException nsee ) {
-      // It might just be a case of the process going away while we
-      // where trying to get its stats. 
-      // So for now lets just ignore the failure and leave the stats
-      // as they are.
-    } catch ( IOException ioe ) {
-      // It might just be a case of the process going away while we
-      // where trying to get its stats. 
-      // So for now lets just ignore the failure and leave the stats
-      // as they are.
-    } finally {
-      st.releaseResources();
-      if(br != null) try { br.close(); } catch(IOException ignore) {}
-    }
-  }
-
-  static void refreshSystem(int[] ints, long[] longs, double[] doubles) {
-    ints[LinuxSystemStats.processesINT] = getProcessCount();        
-    ints[LinuxSystemStats.cpusINT] = sys_cpus;
-    InputStreamReader isr = null;
-    BufferedReader br = null;
-    try {
-      isr = new InputStreamReader( new FileInputStream( "/proc/stat" ));
-      br = new BufferedReader(isr);
-      String line = null;
-      while ( ( line = br.readLine() ) != null ) {
-        try {
-          if (line.startsWith(CPU_TOKEN)) {
-            int[] cpuData = cpuStatSingleton.calculateStats(line);
-            ints[LinuxSystemStats.cpuIdleINT]   = cpuData[CPU.IDLE.ordinal()]; 
-            ints[LinuxSystemStats.cpuNiceINT]   = cpuData[CPU.NICE.ordinal()];
-            ints[LinuxSystemStats.cpuSystemINT] = cpuData[CPU.SYSTEM.ordinal()]; 
-            ints[LinuxSystemStats.cpuUserINT]   = cpuData[CPU.USER.ordinal()];
-            ints[LinuxSystemStats.iowaitINT]    = cpuData[CPU.IOWAIT.ordinal()];
-            ints[LinuxSystemStats.irqINT]       = cpuData[CPU.IRQ.ordinal()];
-            ints[LinuxSystemStats.softirqINT]   = cpuData[CPU.SOFTIRQ.ordinal()];          
-            ints[LinuxSystemStats.cpuActiveINT] = 100 - cpuData[CPU.IDLE.ordinal()];
-            ints[LinuxSystemStats.cpuNonUserINT] = cpuData[CPU.OTHER.ordinal()]
-                                                   + cpuData[CPU.SYSTEM.ordinal()]
-                                                   + cpuData[CPU.IOWAIT.ordinal()]
-                                                   + cpuData[CPU.IRQ.ordinal()]
-                                                   + cpuData[CPU.SOFTIRQ.ordinal()];
-          } else if ( !hasProcVmStat && line.startsWith(PAGE)) {
-            int secondIndex = line.indexOf(" ", PAGE.length());
-            longs[LinuxSystemStats.pagesPagedInLONG] = SpaceTokenizer.parseAsLong(line.substring(PAGE.length(), secondIndex));
-            longs[LinuxSystemStats.pagesPagedOutLONG] = SpaceTokenizer.parseAsLong(line.substring(secondIndex+1));
-          } else if ( !hasProcVmStat && line.startsWith(SWAP)) {
-            int secondIndex = line.indexOf(" ", SWAP.length());
-            longs[LinuxSystemStats.pagesSwappedInLONG] = SpaceTokenizer.parseAsLong(line.substring(SWAP.length(), secondIndex));
-            longs[LinuxSystemStats.pagesSwappedOutLONG] = SpaceTokenizer.parseAsLong(line.substring(secondIndex+1));
-          } else if ( line.startsWith(CTXT)) {
-            longs[LinuxSystemStats.contextSwitchesLONG] = SpaceTokenizer.parseAsLong(line.substring(CTXT.length()));    
-          } else if ( line.startsWith(PROCESSES)) {
-            longs[LinuxSystemStats.processCreatesLONG] = SpaceTokenizer.parseAsInt(line.substring(PROCESSES.length()));        
-          }
-        } catch ( NoSuchElementException nsee ) {
-          //this is the result of reading a partially formed file
-          //just do not update what ever entry had the problem
-        }
-      }
-    } catch ( IOException ioe ) {
-    } finally {
-      if(br != null) try { br.close(); } catch(IOException ignore) {}
-    }
-    getLoadAvg(doubles);
-    getMemInfo(ints);
-    getDiskStats(longs);
-    getNetStats(longs);
-    if(hasProcVmStat) {
-      getVmStats(longs);
-    }
-    st.releaseResources();
-  }
-
-  // Example of /proc/loadavg
-  // 0.00 0.00 0.07 1/218 7907
-  private static void getLoadAvg(double[] doubles) {
-    InputStreamReader isr = null;
-    BufferedReader br = null;
-    try {
-      isr = new InputStreamReader( new FileInputStream( "/proc/loadavg" ));
-      br = new BufferedReader(isr, 512);
-      String line = br.readLine();
-      if ( line == null ) {
-        return;
-      }
-      st.setString(line);
-      doubles[LinuxSystemStats.loadAverage1DOUBLE] = st.nextTokenAsDouble();
-      doubles[LinuxSystemStats.loadAverage5DOUBLE]  = st.nextTokenAsDouble();
-      doubles[LinuxSystemStats.loadAverage15DOUBLE] = st.nextTokenAsDouble();
-    } catch ( NoSuchElementException nsee ) {
-    } catch (IOException ioe) {
-    } finally {
-      st.releaseResources();
-      if(br != null) try { br.close(); } catch(IOException ignore) {}
-    }
-  }
-
-  /**
-   * Returns the available system memory (free + cached).
-   * @param logger the logger
-   * @return the available memory in bytes
-   */
-  public static long getAvailableMemory(Logger logger) {
-    try {
-      BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream("/proc/meminfo")));
-      try {
-        long free = 0;
-        Pattern p = Pattern.compile("(.*)?:\\s+(\\d+)( kB)?");
-        
-        String line;
-        while ((line = br.readLine()) != null) {
-          Matcher m = p.matcher(line);
-          if (m.matches() && ("MemFree".equals(m.group(1)) || "Cached".equals(m.group(1)))) {
-            free += Long.parseLong(m.group(2));
-          }
-        }
-        
-        // convert to bytes
-        return 1024 * free;
-        
-      } finally {
-        br.close();
-      }
-    } catch (IOException e) {
-      logger.warn("Error determining free memory", e);
-      return Long.MAX_VALUE;
-    }
-  }
-  
-  // Example of /proc/meminfo
-  //          total:    used:    free:  shared: buffers:  cached:
-  //Mem:  4118380544 3816050688 302329856        0 109404160 3060326400
-  //Swap: 4194881536 127942656 4066938880
-  private static void getMemInfo(int[] ints) {
-    InputStreamReader isr = null;  
-    BufferedReader br = null;
-    try {
-      isr = new InputStreamReader( new FileInputStream( "/proc/meminfo" ));
-      br = new BufferedReader(isr);
-      //Assume all values read in are in kB, convert to MB
-      String line = null;
-      while ( (line = br.readLine()) != null) {
-        try {
-          if ( line.startsWith("MemTotal: ")) {
-            st.setString(line);
-            st.skipToken(); //Burn initial token
-            ints[LinuxSystemStats.physicalMemoryINT] = (int) (st.nextTokenAsLong() / 1024);
-          } else if ( line.startsWith("MemFree: ")) {
-            st.setString(line);
-            st.skipToken(); //Burn initial token
-            ints[LinuxSystemStats.freeMemoryINT] = (int) (st.nextTokenAsLong() / 1024);
-          } else if ( line.startsWith("SharedMem: ")) {
-           st.setString(line);
-           st.skipToken(); //Burn initial token
-           ints[LinuxSystemStats.sharedMemoryINT] = (int) (st.nextTokenAsLong() / 1024);
-          } else if ( line.startsWith("Buffers: ")) {
-            st.setString(line);
-            st.nextToken(); //Burn initial token
-            ints[LinuxSystemStats.bufferMemoryINT] = (int) (st.nextTokenAsLong() / 1024);
-          } else if ( line.startsWith("SwapTotal: ")) {
-            st.setString(line);
-            st.skipToken(); //Burn initial token
-            ints[LinuxSystemStats.allocatedSwapINT] = (int) (st.nextTokenAsLong() / 1024);
-          } else if ( line.startsWith("SwapFree: ")) {
-            st.setString(line);
-            st.skipToken(); //Burn initial token
-            ints[LinuxSystemStats.unallocatedSwapINT] = (int) (st.nextTokenAsLong() / 1024);
-          } else if ( line.startsWith("Cached: ")) {
-            st.setString(line);
-            st.skipToken(); //Burn initial token
-            ints[LinuxSystemStats.cachedMemoryINT] = (int) (st.nextTokenAsLong() / 1024);
-          } else if ( line.startsWith("Dirty: ")) {
-            st.setString(line);
-            st.skipToken(); //Burn initial token
-            ints[LinuxSystemStats.dirtyMemoryINT] = (int) (st.nextTokenAsLong() / 1024);
-          } else if ( line.startsWith("Inact_dirty: ")) { // 2.4 kernels
-            st.setString(line);
-            st.skipToken(); //Burn initial token
-            ints[LinuxSystemStats.dirtyMemoryINT] = (int) (st.nextTokenAsLong() / 1024);
-          }
-        } catch(NoSuchElementException nsee) {
-          //ignore and let that stat not to be updated this time
-        }
-      }
-    } catch ( IOException ioe ) {
-    } finally {
-      st.releaseResources();
-      if(br != null) try { br.close(); } catch(IOException ignore) {}
-    }
-  }
-
-  /*
-Inter-|   Receive                                                |  Transmit
- face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
-    lo:1908275823 326949246    0    0    0     0          0         0 1908275823 326949246    0    0    0     0       0          0
-*/
-
-  private static void getNetStats(long[] longs) {
-    InputStreamReader isr = null;
-    BufferedReader br = null;
-    try {
-      isr = new InputStreamReader( new FileInputStream( "/proc/net/dev" ));
-      br = new BufferedReader(isr);
-      br.readLine(); // Discard header info
-      br.readLine(); // Discard header info
-      long lo_recv_packets = 0, lo_recv_bytes = 0; 
-      long other_recv_packets = 0, other_recv_bytes = 0; 
-      long other_recv_errs    = 0, other_recv_drop  = 0; 
-      long other_xmit_packets = 0, other_xmit_bytes = 0; 
-      long other_xmit_errs    = 0, other_xmit_drop  = 0, other_xmit_colls = 0; 
-      String line = null;
-      while ( (line = br.readLine()) != null) {
-        int index = line.indexOf(":");
-        boolean isloopback = (line.indexOf("lo:") != -1);
-        st.setString(line.substring(index+1).trim());
-        long recv_bytes   = st.nextTokenAsLong(); 
-        long recv_packets = st.nextTokenAsLong(); 
-        long recv_errs    = st.nextTokenAsLong(); 
-        long recv_drop    = st.nextTokenAsLong(); 
-        st.skipTokens(4); //fifo, frame, compressed, multicast
-        long xmit_bytes   = st.nextTokenAsLong(); 
-        long xmit_packets = st.nextTokenAsLong(); 
-        long xmit_errs    = st.nextTokenAsLong(); 
-        long xmit_drop    = st.nextTokenAsLong(); 
-        st.skipToken(); //fifo
-        long xmit_colls   = st.nextTokenAsLong(); 
-
-        if (isloopback) {
-          lo_recv_packets = recv_packets;
-          lo_recv_bytes = recv_bytes;
-        }
-        else {
-          other_recv_packets += recv_packets; 
-          other_recv_bytes += recv_bytes;
-        }
-        other_recv_errs += recv_errs;
-        other_recv_drop += recv_drop;
-
-        if (isloopback) {
-          /* loopback_xmit_packets = xmit_packets; */
-        } else {
-          other_xmit_packets += xmit_packets;
-          other_xmit_bytes += xmit_bytes;
-        }
-        other_xmit_errs += xmit_errs;
-        other_xmit_drop += xmit_drop;
-        other_xmit_colls += xmit_colls;
-      }
-      // fix for bug 43860
-      longs[LinuxSystemStats.loopbackPacketsLONG] = lo_recv_packets;
-      longs[LinuxSystemStats.loopbackBytesLONG] = lo_recv_bytes;
-      longs[LinuxSystemStats.recvPacketsLONG] = other_recv_packets;
-      longs[LinuxSystemStats.recvBytesLONG] = other_recv_bytes;
-      longs[LinuxSystemStats.recvErrorsLONG] = other_recv_errs;
-      longs[LinuxSystemStats.recvDropsLONG] = other_recv_drop;
-      longs[LinuxSystemStats.xmitPacketsLONG] = other_xmit_packets;
-      longs[LinuxSystemStats.xmitBytesLONG] = other_xmit_bytes;
-      longs[LinuxSystemStats.xmitErrorsLONG] = other_xmit_errs;
-      longs[LinuxSystemStats.xmitDropsLONG] = other_xmit_drop;
-      longs[LinuxSystemStats.xmitCollisionsLONG] = other_xmit_colls;
-    } catch (NoSuchElementException nsee) {
-    } catch (IOException ioe) {
-    } finally {
-      st.releaseResources();
-      if(br != null) try { br.close(); } catch(IOException ignore) {}
-    }
-  }
-
-  // example of /proc/diskstats
-//    1    0 ram0 0 0 0 0 0 0 0 0 0 0 0
-//    1    1 ram1 0 0 0 0 0 0 0 0 0 0 0
-//    1    2 ram2 0 0 0 0 0 0 0 0 0 0 0
-//    1    3 ram3 0 0 0 0 0 0 0 0 0 0 0
-//    1    4 ram4 0 0 0 0 0 0 0 0 0 0 0
-//    1    5 ram5 0 0 0 0 0 0 0 0 0 0 0
-//    1    6 ram6 0 0 0 0 0 0 0 0 0 0 0
-//    1    7 ram7 0 0 0 0 0 0 0 0 0 0 0
-//    1    8 ram8 0 0 0 0 0 0 0 0 0 0 0
-//    1    9 ram9 0 0 0 0 0 0 0 0 0 0 0
-//    1   10 ram10 0 0 0 0 0 0 0 0 0 0 0
-//    1   11 ram11 0 0 0 0 0 0 0 0 0 0 0
-//    1   12 ram12 0 0 0 0 0 0 0 0 0 0 0
-//    1   13 ram13 0 0 0 0 0 0 0 0 0 0 0
-//    1   14 ram14 0 0 0 0 0 0 0 0 0 0 0
-//    1   15 ram15 0 0 0 0 0 0 0 0 0 0 0
-//    8    0 sda 1628761 56603 37715982 5690640 6073889 34091137 330349716 279787924 0 25235208 285650572
-//    8    1 sda1 151 638 45 360
-//    8    2 sda2 674840 11202608 8591346 68716852
-//    8    3 sda3 1010409 26512312 31733575 253868616
-//    8   16 sdb 12550386 47814 213085738 60429448 5529812 210792345 1731459040 1962038752 0 33797176 2024138028
-//    8   17 sdb1 12601113 213085114 216407197 1731257800
-//    3    0 hda 0 0 0 0 0 0 0 0 0 0 0
-  private static void getDiskStats(long[] longs) {
-    InputStreamReader isr = null;
-    BufferedReader br = null;
-    String line = null;
-    try {
-      if (hasDiskStats) {
-        // 2.6 kernel
-        isr = new InputStreamReader( new FileInputStream( "/proc/diskstats" ));
-      } else {
-        // 2.4 kernel
-        isr = new InputStreamReader( new FileInputStream( "/proc/partitions" ));
-      }
-      br = new BufferedReader(isr);
-      long readsCompleted = 0, readsMerged = 0; 
-      long sectorsRead    = 0, timeReading  = 0; 
-      long writesCompleted = 0, writesMerged = 0; 
-      long sectorsWritten  = 0, timeWriting = 0;
-      long iosInProgress = 0;
-      long timeIosInProgress = 0;
-      long ioTime = 0;
-      if (!hasDiskStats) {
-        br.readLine(); // Discard header info
-        br.readLine(); // Discard header info
-      }
-      while ( (line = br.readLine()) != null) {
-        st.setString(line);
-        {
-          // " 8 1 sdb" on 2.6
-          // " 8 1 452145145 sdb" on 2.4
-          String tok = st.nextToken();
-          if (tok.length() == 0 || Character.isWhitespace(tok.charAt(0))) {
-            // skip over first token since it is whitespace
-            tok = st.nextToken();
-          }
-          // skip first token it is some number
-          tok = st.nextToken();
-          // skip second token it is some number
-          tok = st.nextToken();
-          if (!hasDiskStats) {
-            // skip third token it is some number
-            tok = st.nextToken();
-          }
-          // Now tok should be the device name.
-          if (Character.isDigit(tok.charAt(tok.length()-1))) {
-            // If the last char is a digit
-            // skip this line since it is a partition of a device; not a device.
-            continue;
-          }
-        }
-        long tmp_readsCompleted = st.nextTokenAsLong(); 
-        long tmp_readsMerged = st.nextTokenAsLong(); 
-        long tmp_sectorsRead = st.nextTokenAsLong(); 
-        long tmp_timeReading = st.nextTokenAsLong();
-        if (st.hasMoreTokens()) {
-          // If we are on 2.6 then we might only have 4 longs; if so ignore this line
-          // Otherwise we should have 11 long tokens.
-          long tmp_writesCompleted = st.nextTokenAsLong();
-          long tmp_writesMerged = st.nextTokenAsLong();
-          long tmp_sectorsWritten = st.nextTokenAsLong();
-          long tmp_timeWriting = st.nextTokenAsLong();
-          long tmp_iosInProgress = st.nextTokenAsLong();
-          long tmp_timeIosInProgress = st.nextTokenAsLong();
-          long tmp_ioTime = st.nextTokenAsLong();
-          readsCompleted += tmp_readsCompleted;
-          readsMerged += tmp_readsMerged;
-          sectorsRead += tmp_sectorsRead;
-          timeReading += tmp_timeReading;
-          writesCompleted += tmp_writesCompleted;
-          writesMerged += tmp_writesMerged;
-          sectorsWritten += tmp_sectorsWritten;
-          timeWriting += tmp_timeWriting;
-          iosInProgress += tmp_iosInProgress;
-          timeIosInProgress += tmp_timeIosInProgress;
-          ioTime += tmp_ioTime;
-        }
-      } // while
-      final int SECTOR_SIZE = 512;
-      longs[LinuxSystemStats.readsCompletedLONG] = readsCompleted;
-      longs[LinuxSystemStats.readsMergedLONG] = readsMerged;
-      longs[LinuxSystemStats.bytesReadLONG] = sectorsRead * SECTOR_SIZE;
-      longs[LinuxSystemStats.timeReadingLONG] = timeReading;
-      longs[LinuxSystemStats.writesCompletedLONG] = writesCompleted;
-      longs[LinuxSystemStats.writesMergedLONG] = writesMerged;
-      longs[LinuxSystemStats.bytesWrittenLONG] = sectorsWritten * SECTOR_SIZE;
-      longs[LinuxSystemStats.timeWritingLONG] = timeWriting;
-      longs[LinuxSystemStats.iosInProgressLONG] = iosInProgress;
-      longs[LinuxSystemStats.timeIosInProgressLONG] = timeIosInProgress;
-      longs[LinuxSystemStats.ioTimeLONG] = ioTime;
-    } catch (NoSuchElementException nsee) {
-//       com.gemstone.gemfire.distributed.internal.InternalDistributedSystem.getAnyInstance().getLoggerI18n().fine("unexpected NoSuchElementException line=" + line, nsee);
-    } catch (IOException ioe) {
-    } finally {
-      st.releaseResources();
-      if(br != null) try { br.close(); } catch(IOException ignore) {}
-    }
-  }
-
-  //Example of /proc/vmstat
-  //...
-  //pgpgin 294333738
-  //pgpgout 1057420300
-  //pswpin 19422
-  //pswpout 14495
-  private static void getVmStats(long[] longs) {
-    assert hasProcVmStat != false : "getVmStats called when hasVmStat was false";
-    InputStreamReader isr = null;
-    BufferedReader br = null;
-    try {
-      isr = new InputStreamReader( new FileInputStream( "/proc/vmstat" ));
-      br = new BufferedReader(isr);
-      String line = null;
-      while((line = br.readLine()) != null) {
-        if(line.startsWith(PGPGIN)) {
-          longs[LinuxSystemStats.pagesPagedInLONG] 
-                = SpaceTokenizer.parseAsLong(line.substring(PGPGIN.length()));  
-        } else if(line.startsWith(PGPGOUT)) {
-          longs[LinuxSystemStats.pagesPagedOutLONG] 
-                = SpaceTokenizer.parseAsLong(line.substring(PGPGOUT.length())); 
-        } else if(line.startsWith(PSWPIN)) {
-          longs[LinuxSystemStats.pagesSwappedInLONG] 
-                = SpaceTokenizer.parseAsLong(line.substring(PSWPIN.length()));
-        } else if(line.startsWith(PSWPOUT)) {
-          longs[LinuxSystemStats.pagesSwappedOutLONG] 
-                = SpaceTokenizer.parseAsLong(line.substring(PSWPOUT.length()));
-        }
-      }
-    } catch (NoSuchElementException nsee) {
-    } catch (IOException ioe) {
-    } finally {
-      if(br != null) try { br.close(); } catch(IOException ignore) {}
-    }
-  }
-
-  /**
-   * Count the number of files in /proc that do not represent processes.
-   * This value is cached to make counting the number of running process a 
-   * cheap operation. The assumption is that the contents of /proc will not 
-   * change on a running system.
-   * @return the files in /proc that do NOT match /proc/[0-9]*
-   */
-  private static int getNumberOfNonProcessProcFiles() {
-    File proc = new File("/proc");
-    String[] procFiles = proc.list();
-    int count = 0;
-    if(procFiles != null) {
-      for(String filename : procFiles) {
-        char c = filename.charAt(0);
-        if(! Character.isDigit(c)) {
-          if (c == '.') {
-            // see if the next char is a digit
-            if (filename.length() > 1) {
-              char c2 = filename.charAt(1);
-              if (Character.isDigit(c2)) {
-                // for bug 42091 do not count files that begin with a '.' followed by digits
-                continue;
-              }
-            }
-          }
-          count++;
-        }
-      }
-    }
-    return count;
-  }
- 
-  /**
-   * @return the number of running processes on the system 
-   */
-  private static int getProcessCount() {
-    File proc = new File("/proc");
-    String[] procFiles = proc.list();
-    if(procFiles == null) {
-      //unknown error, continue without this stat
-      return 0;
-    }
-    return procFiles.length - nonPidFilesInProc;
-  }
-
-  //The array indices must be ordered as they appear in /proc/stats
-  //      (user)   (nice) (system) (idle)    (iowait) (irq)  (softirq)
-  // cpu  42813766 10844  8889075 1450764512 49963779 808244 3084872
-  //
-  private static class CpuStat {
-    private static boolean lastCpuStatsInvalid;
-    private static List<Long> lastCpuStats;
-
-    public CpuStat() {
-      lastCpuStatsInvalid = true;
-    }
-
-    public int[] calculateStats( String newStatLine ) {
-      st.setString(newStatLine);
-      st.skipToken(); //cpu name
-      final int MAX_CPU_STATS = CPU.values().length;
-      /* newer kernels now have 8 columns for cpu in
-       * /proc/stat (up from 7). This number may increase
-       * even further, hence we now use List in place of long[].
-       * We add up entries from all columns after 7 into CPU.OTHER
-       */
-      List<Long> newStats = new ArrayList<Long>(8);
-      List<Long> diffs = new ArrayList<Long>(8);
-      long total_change = 0;
-      int actualCpuStats = 0;
-      long unaccountedCpuUtilization = 0;
-      
-      while (st.hasMoreTokens()) {
-        newStats.add(st.nextTokenAsLong());
-        actualCpuStats++;
-      }
-      
-      if ( lastCpuStatsInvalid ) {
-        lastCpuStats = newStats;
-        lastCpuStatsInvalid = false;
-        for (int i=0; i<MAX_CPU_STATS; i++) {
-          diffs.add(0L);
-        }
-        diffs.set(CPU.IDLE.ordinal(), 100L);
-      } else {
-        for (int i=0; i<actualCpuStats; i++) {
-          diffs.add(newStats.get(i) - lastCpuStats.get(i));
-          total_change += diffs.get(i);
-          lastCpuStats.set(i, newStats.get(i));
-        }
-        if(total_change == 0) {
-          //avoid divide by zero
-          total_change = 1;
-        } 
-        for (int i = 0; i < MAX_CPU_STATS; i++) {
-          if (i < actualCpuStats) {
-            diffs.set(i, (diffs.get(i) * 100) / total_change);
-          }
-        }
-        for (int i=MAX_CPU_STATS; i<actualCpuStats; i++) {
-          unaccountedCpuUtilization += (diffs.get(i) * 100) / total_change;
-        }
-      }
-      int[] ret = new int[MAX_CPU_STATS];
-      for (int i = 0; i < MAX_CPU_STATS; i++) {
-        if (i < actualCpuStats) {
-          ret[i] = diffs.get(i).intValue();
-        }
-      }
-      ret[CPU.OTHER.ordinal()] += (int)unaccountedCpuUtilization;
-      return ret; 
-    }  
-  }
-  
-  private static class SpaceTokenizer { 
-    private String str;
-    private char[] rawChars;
-    private int beginIdx;
-    private int endIdx;
-    private int nextIdx;
-
-    protected SpaceTokenizer() {
-      endIdx = -1;
-      nextIdx = -1;
-    }
-
-    protected void releaseResources() {
-      str = null;
-      rawChars = null;
-      endIdx = -1;
-      nextIdx = -1;
-    }
-
-    private void nextIdx() {
-      int origin = nextIdx;
-      if(endIdx == rawChars.length || beginIdx == -1) {
-        endIdx = -1;
-        nextIdx = -1;
-        return;
-      }
-      endIdx = -1;
-      nextIdx = -1;
-      for(int i = origin+1; i < rawChars.length; i++) {
-        char c = rawChars[i];
-        //Add all delimiters here
-        if(c == ' ' || c == '\t' || c == '\n' || c == '\r') {
-          if(endIdx == -1) {
-            endIdx = i;	 
-          }
-        } else {
-          //this handles multiple consecutive delimiters 
-          if(endIdx != -1) {
-            nextIdx = i;
-            return;
-          }
-        }
-      }
-      if( endIdx == -1 ) {
-        //indicates we were still reading white space at the end of the string
-        endIdx = rawChars.length;
-      }
-    }
-
-    protected boolean hasMoreTokens() {
-      return endIdx != -1;
-    }
-
-    protected void setString(String data) {
-      str = data;
-      rawChars = new char[str.length()];
-      str.getChars(0, str.length(), rawChars, 0);
-      beginIdx = 0;
-      endIdx = -1;
-      nextIdx = -1;
-      nextIdx();
-    }
-
-    protected boolean skipToken() {
-      if(hasMoreTokens()) {
-        beginIdx = nextIdx;
-        nextIdx();
-        return true;
-      }
-      return false;
-    }
-    
-    protected String nextToken() {
-      if(hasMoreTokens()) {
-        final String ret = str.substring(beginIdx, endIdx);
-        beginIdx = nextIdx;
-        nextIdx();
-        return ret;
-      }
-      throw new NoSuchElementException();
-    }
-
-    protected String peekToken() {
-      if(hasMoreTokens()) {
-        return str.substring(beginIdx, endIdx);
-      }
-      throw new NoSuchElementException();
-    }
-
-    protected void skipTokens(int numberToSkip) {  
-      int remaining = numberToSkip + 1;
-      while (--remaining > 0 && skipToken());
-    }
-
-    protected static long parseAsLong(String number) {
-      long l = 0L;
-      try {
-        l = Long.parseLong(number);
-      } catch(NumberFormatException nfe) {}
-      return l;
-    }
-
-    protected static int parseAsInt(String number) {
-      int i = 0;
-      try {
-        i = Integer.parseInt(number);
-      } catch(NumberFormatException nfe) {}
-      return i;
-    }
-
-    protected int nextTokenAsInt() {
-      int i = 0;
-      try {
-        i = Integer.parseInt(nextToken());
-      } catch(NumberFormatException nfe) {}
-      return i;
-    }
-
-    protected long nextTokenAsLong() {
-      long l = 0L;
-      try {
-        l = Long.parseLong(nextToken());
-      } catch(NumberFormatException nfe) {}
-      return l;
-    }
-
-    protected double nextTokenAsDouble() {
-      double d = 0;
-      try {
-        d = Double.parseDouble(nextToken());
-      } catch(NumberFormatException nfe) {}
-      return d;
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/750996a0/geode-core/src/main/java/com/gemstone/gemfire/internal/LinuxProcessStats.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/LinuxProcessStats.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/LinuxProcessStats.java
deleted file mode 100644
index 05bc284..0000000
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/LinuxProcessStats.java
+++ /dev/null
@@ -1,79 +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.*;
-
-/**
- * <P>This class provides the interface for statistics about a
- * Linux operating system process that is using a GemFire system.
- */
-public class LinuxProcessStats
-{
-  final static int imageSizeINT = 0;
-  final static int rssSizeINT = 1;
-
-  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("LinuxProcessStats",
-                          "Statistics on a Linux process.",
-                          new StatisticDescriptor[] {
-                            f.createIntGauge("imageSize",
-                                             "The size of the process's image in megabytes.",
-                                             "megabytes"),
-                            f.createIntGauge("rssSize",
-                                             "The size of the process's resident set size in megabytes. (assumes PAGESIZE=4096, specify -Dgemfire.statistics.linux.pageSize=<pagesize> to adjust)",
-                                             "megabytes"),
-                          });
-    checkOffset("imageSize", imageSizeINT);
-    checkOffset("rssSize", rssSizeINT);
-  }
-
-  private LinuxProcessStats() {
-    // no instances allowed
-  }
-  public static StatisticsType getType() {
-    return myType;
-  }
-
-  /**
-   * Returns a <code>ProcessStats</code> that wraps Linux process
-   * <code>Statistics</code>. 
-   *
-   * @since GemFire 3.5
-   */
-  static ProcessStats createProcessStats(final Statistics stats) {
-    if (stats instanceof LocalStatisticsImpl) {
-      HostStatHelper.refresh((LocalStatisticsImpl) stats);
-    } // otherwise its a Dummy implementation so do nothing
-    return new ProcessStats(stats) {
-      @Override
-        public long getProcessSize() {
-          return stats.getInt(rssSizeINT);
-        }
-      };
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/750996a0/geode-core/src/main/java/com/gemstone/gemfire/internal/LinuxSystemStats.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/LinuxSystemStats.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/LinuxSystemStats.java
deleted file mode 100644
index 22158da..0000000
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/LinuxSystemStats.java
+++ /dev/null
@@ -1,311 +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.*;
-
-/**
- * <P>This class provides the interface for statistics about the 
- * Linux machine a GemFire system is running on.
- */
-public class LinuxSystemStats
-{
-
-  // shared fields
-  final static int allocatedSwapINT = 0;
-  final static int bufferMemoryINT = 1;
-  final static int sharedMemoryINT = 2;
-  final static int cpuActiveINT = 3;
-  final static int cpuIdleINT = 4;
-  final static int cpuNiceINT = 5;
-  final static int cpuSystemINT = 6;
-  final static int cpuUserINT = 7;
-  final static int iowaitINT = 8;
-  final static int irqINT = 9;
-  final static int softirqINT = 10;
-  final static int cpusINT = 11;
-  final static int freeMemoryINT = 12;
-  final static int physicalMemoryINT = 13;
-  final static int processesINT = 14;
-  final static int unallocatedSwapINT = 15;
-  final static int cachedMemoryINT = 16;
-  final static int dirtyMemoryINT = 17;
-  final static int cpuNonUserINT = 18;
-
-  final static int loopbackPacketsLONG = 0;
-  final static int loopbackBytesLONG = 1;
-  final static int recvPacketsLONG = 2;
-  final static int recvBytesLONG = 3;
-  final static int recvErrorsLONG = 4;
-  final static int recvDropsLONG = 5;
-  final static int xmitPacketsLONG = 6;
-  final static int xmitBytesLONG = 7;
-  final static int xmitErrorsLONG = 8;
-  final static int xmitDropsLONG = 9;
-  final static int xmitCollisionsLONG = 10;
-  final static int contextSwitchesLONG = 11;
-  final static int processCreatesLONG = 12;
-  final static int pagesPagedInLONG = 13;
-  final static int pagesPagedOutLONG = 14;
-  final static int pagesSwappedInLONG = 15;
-  final static int pagesSwappedOutLONG = 16;
-  final static int readsCompletedLONG = 17;
-  final static int readsMergedLONG = 18;
-  final static int bytesReadLONG = 19;
-  final static int timeReadingLONG = 20;
-  final static int writesCompletedLONG = 21;
-  final static int writesMergedLONG = 22;
-  final static int bytesWrittenLONG = 23;
-  final static int timeWritingLONG = 24;
-  final static int iosInProgressLONG = 25;
-  final static int timeIosInProgressLONG = 26;
-  final static int ioTimeLONG = 27;
-
-  final static int loadAverage1DOUBLE = 0;
-  final static int loadAverage15DOUBLE = 1;
-  final static int loadAverage5DOUBLE = 2;
-
-  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("LinuxSystemStats",
-                          "Statistics on a Linux machine.",
-                          new StatisticDescriptor[] {
-                            f.createIntGauge("allocatedSwap",
-                                                "The number of megabytes of swap space have actually been written to. Swap space must be reserved before it can be allocated.",
-                                                "megabytes"),
-                            f.createIntGauge("bufferMemory",
-                                                "The number of megabytes of memory allocated to buffers.",
-                                                "megabytes"),
-                            f.createIntGauge("sharedMemory",
-                                                "The number of megabytes of shared memory on the machine.",
-                                                "megabytes", true),
-                            f.createIntGauge("cpuActive",
-                                                "The percentage of the total available time that has been used in a non-idle state.",
-                                                "%"),
-                            f.createIntGauge("cpuIdle",
-                                                "The percentage of the total available time that has been spent sleeping.",
-                                                "%", true),
-                            f.createIntGauge("cpuNice",
-                                                "The percentage of the total available time that has been used to execute user code in processes with low priority.",
-                                                "%"),
-                            f.createIntGauge("cpuSystem",
-                                                "The percentage of the total available time that has been used to execute system (i.e. kernel) code.",
-                                                "%"),
-                            f.createIntGauge("cpuUser",
-                                                "The percentage of the total available time that has been used to execute user code.",
-                                                "%"),
-                            f.createIntGauge("iowait",
-                                                "The percentage of the total available time that has been used to wait for I/O to complete.",
-                                                "%"),
-                            f.createIntGauge("irq",
-                                                "The percentage of the total available time that has been used servicing  interrupts.",
-                                                "%"),
-                            f.createIntGauge("softirq",
-                                                "The percentage of the total available time that has been used servicing softirqs.",
-                                                "%"),
-                            f.createIntGauge("cpus",
-                                                "The number of online cpus on the local machine.",
-                                                "items"),
-                            f.createIntGauge("freeMemory",
-                                                "The number of megabytes of unused memory on the machine.",
-                                                "megabytes", true),
-                            f.createIntGauge("physicalMemory",
-                                                "The actual amount of total physical memory on the machine.",
-                                                "megabytes", true),
-                            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("unallocatedSwap",
-                                                "The number of megabytes of swap space that have not been allocated.",
-                                                "megabytes", true),
-                            f.createIntGauge("cachedMemory",
-                                                "The number of megabytes of memory used for the file system cache.",
-                                                "megabytes", true),
-                            f.createIntGauge("dirtyMemory",
-                                                "The number of megabytes of memory in the file system cache that need to be written.",
-                                                "megabytes", true),
-                            f.createIntGauge("cpuNonUser",
-                                                "The percentage of total available time that has been used to execute non-user code.(includes system, iowait, irq, softirq etc.)",
-                                                "%"),
-
-
-                            f.createLongCounter("loopbackPackets",
-                                             "The number of network packets sent (or received) on the loopback interface",
-                                             "packets", false),
-                            f.createLongCounter("loopbackBytes",
-                                             "The number of network bytes sent (or received) on the loopback interface",
-                                             "bytes", false),
-			    f.createLongCounter("recvPackets",
-					     "The total number of network packets received (excluding loopback)",
-					     "packets", false),
-                            f.createLongCounter("recvBytes",
-                                              "The total number of network bytes received (excluding loopback)",
-                                              "bytes", false),
-			    f.createLongCounter("recvErrors",
-					     "The total number of network receive errors",
-					     "errors", false),
-                            f.createLongCounter("recvDrops",
-                                             "The total number network receives dropped",
-                                             "packets", false),
-			    f.createLongCounter("xmitPackets",
-					     "The total number of network packets transmitted (excluding loopback)",
-					     "packets", false),
-                            f.createLongCounter("xmitBytes",
-                                             "The total number of network bytes transmitted (excluding loopback)",
-                                             "bytes", false),
-			    f.createLongCounter("xmitErrors",
-					     "The total number of network transmit errors",
-					     "errors", false),
-			    f.createLongCounter("xmitDrops",
-					     "The total number of network transmits dropped",
-					     "packets", false),
-			    f.createLongCounter("xmitCollisions",
-					    "The total number of network transmit collisions",
-					     "collisions", false),
-                            f.createLongCounter("contextSwitches",
-                                                "The total number of context switches from one thread to another on the computer.  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.",
-                                                "operations", false),
-                            f.createLongCounter("processCreates",
-                                                "The total number of times a process has been created.",
-                                                "operations", false),
-                            f.createLongCounter("pagesPagedIn",
-                                                "The total number of pages that have been brought into memory from disk by the operating system's memory manager.",
-                                                "pages", false),
-                            f.createLongCounter("pagesPagedOut",
-                                                "The total number of pages that have been flushed from memory to disk by the operating system's memory manager.",
-                                                "pages", false),
-                            f.createLongCounter("pagesSwappedIn",
-                                                "The total number of swap pages that have been read in from disk by the operating system's memory manager.",
-                                                "pages", false),
-                            f.createLongCounter("pagesSwappedOut",
-                                                "The total number of swap pages that have been written out to disk by the operating system's memory manager.",
-                                                "pages", false),
-                            f.createLongCounter("diskReadsCompleted",
-                                                "The total number disk read operations completed successfully",
-                                                "ops"),
-                            f.createLongCounter("diskReadsMerged",
-                                                "The total number disk read operations that were able to be merge with adjacent reads for efficiency",
-                                                "ops"),
-                            f.createLongCounter("diskBytesRead",
-                                                "The total number bytes read from disk successfully",
-                                                "bytes"),
-                            f.createLongCounter("diskTimeReading",
-                                                "The total number of milliseconds spent reading from disk",
-                                                "milliseconds"),
-                            f.createLongCounter("diskWritesCompleted",
-                                                "The total number disk write operations completed successfully",
-                                                "ops"),
-                            f.createLongCounter("diskWritesMerged",
-                                                "The total number disk write operations that were able to be merge with adjacent reads for efficiency",
-                                                "ops"),
-                            f.createLongCounter("diskBytesWritten",
-                                                "The total number bytes written to disk successfully",
-                                                "bytes"),
-                            f.createLongCounter("diskTimeWriting",
-                                                "The total number of milliseconds spent writing to disk",
-                                                "milliseconds"),
-                            f.createLongGauge("diskOpsInProgress",
-                                                "The current number of disk operations in progress",
-                                                "ops"),
-                            f.createLongCounter("diskTimeInProgress",
-                                                "The total number of milliseconds spent with disk ops in progress",
-                                                "milliseconds"),
-                            f.createLongCounter("diskTime",
-                                                "The total number of milliseconds that measures both completed disk operations and any accumulating backlog of in progress ops.",
-                                                "milliseconds"),
-
-
-                            f.createDoubleGauge("loadAverage1",
-                                                "The average number of threads in the run queue or waiting for disk I/O over the last minute.",
-                                                "threads"),
-                            f.createDoubleGauge("loadAverage15",
-                                                "The average number of threads in the run queue or waiting for disk I/O over the last fifteen minutes.",
-                                                "threads"),
-                            f.createDoubleGauge("loadAverage5",
-                                                "The average number of threads in the run queue or waiting for disk I/O over the last five minutes.",
-                                                "threads"),
-                          });
-
-    checkOffset("allocatedSwap", allocatedSwapINT);
-    checkOffset("bufferMemory", bufferMemoryINT);
-    checkOffset("sharedMemory", sharedMemoryINT);
-    checkOffset("cpuActive", cpuActiveINT);
-    checkOffset("cpuIdle", cpuIdleINT);
-    checkOffset("cpuNice", cpuNiceINT);
-    checkOffset("cpuSystem", cpuSystemINT);
-    checkOffset("cpuUser", cpuUserINT);
-    checkOffset("iowait", iowaitINT);
-    checkOffset("irq", irqINT);
-    checkOffset("softirq", softirqINT);
-    checkOffset("cpus", cpusINT);
-    checkOffset("freeMemory", freeMemoryINT);
-    checkOffset("physicalMemory", physicalMemoryINT);
-    checkOffset("processes", processesINT);
-    checkOffset("unallocatedSwap", unallocatedSwapINT);
-    checkOffset("cachedMemory", cachedMemoryINT);
-    checkOffset("dirtyMemory", dirtyMemoryINT);
-    checkOffset("cpuNonUser", cpuNonUserINT);
-
-    checkOffset("loopbackPackets", loopbackPacketsLONG);
-    checkOffset("loopbackBytes", loopbackBytesLONG);
-    checkOffset("recvPackets", recvPacketsLONG);
-    checkOffset("recvBytes", recvBytesLONG);
-    checkOffset("recvErrors", recvErrorsLONG);
-    checkOffset("recvDrops", recvDropsLONG);
-    checkOffset("xmitPackets", xmitPacketsLONG);
-    checkOffset("xmitBytes", xmitBytesLONG);
-    checkOffset("xmitErrors", xmitErrorsLONG);
-    checkOffset("xmitDrops", xmitDropsLONG);
-    checkOffset("xmitCollisions", xmitCollisionsLONG);
-    checkOffset("contextSwitches", contextSwitchesLONG);
-    checkOffset("processCreates", processCreatesLONG);
-    checkOffset("pagesPagedIn", pagesPagedInLONG);
-    checkOffset("pagesPagedOut", pagesPagedOutLONG);
-    checkOffset("pagesSwappedIn", pagesSwappedInLONG);
-    checkOffset("pagesSwappedOut", pagesSwappedOutLONG);
-    checkOffset("diskReadsCompleted", readsCompletedLONG);
-    checkOffset("diskReadsMerged", readsMergedLONG);
-    checkOffset("diskBytesRead", bytesReadLONG);
-    checkOffset("diskTimeReading", timeReadingLONG);
-    checkOffset("diskWritesCompleted", writesCompletedLONG);
-    checkOffset("diskWritesMerged", writesMergedLONG);
-    checkOffset("diskBytesWritten", bytesWrittenLONG);
-    checkOffset("diskTimeWriting", timeWritingLONG);
-    checkOffset("diskOpsInProgress", iosInProgressLONG);
-    checkOffset("diskTimeInProgress", timeIosInProgressLONG);
-    checkOffset("diskTime", ioTimeLONG);
-
-    checkOffset("loadAverage1", loadAverage1DOUBLE);
-    checkOffset("loadAverage15", loadAverage15DOUBLE);
-    checkOffset("loadAverage5", loadAverage5DOUBLE);
-  }
-    
-  private LinuxSystemStats() {
-    // no instances allowed
-  }
-  public static StatisticsType getType() {
-    return myType;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/750996a0/geode-core/src/main/java/com/gemstone/gemfire/internal/LocalStatListener.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/LocalStatListener.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/LocalStatListener.java
deleted file mode 100644
index c46bc2f..0000000
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/LocalStatListener.java
+++ /dev/null
@@ -1,40 +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;
-
-/**
- * Implement this interface to receive call back when a stat value has changed.
- * The listener has to be registered with statSampler. This can be done in the
- * following manner:
- * <code>
- * InternalDistributedSystem internalSystem = (InternalDistributedSystem)cache
- *                                                      .getDistributedSystem();
- * final GemFireStatSampler sampler = internalSystem.getStatSampler();          
- * sampler.addLocalStatListener(l, stats, statName);
- * </code>
- * 
- *
- */
-public interface LocalStatListener {
-  /**
-   * Invoked when the value of a statistic has changed
-   *
-   * @param value
-   *        The new value of the statistic 
-   */
-  public void statValueChanged( double value );
-}


Mime
View raw message