org.apache.hadoop.hbase.metrics
Class PersistentMetricsTimeVaryingRate

java.lang.Object
  extended by org.apache.hadoop.metrics.util.MetricsBase
      extended by org.apache.hadoop.metrics.util.MetricsTimeVaryingRate
          extended by org.apache.hadoop.hbase.metrics.PersistentMetricsTimeVaryingRate

public class PersistentMetricsTimeVaryingRate
extends org.apache.hadoop.metrics.util.MetricsTimeVaryingRate

This class extends MetricsTimeVaryingRate to let the metrics persist past a pushMetric() call


Field Summary
protected  long lastOper
           
protected static org.apache.commons.logging.Log LOG
           
protected  boolean reset
           
protected  long totalOps
           
 
Fields inherited from class org.apache.hadoop.metrics.util.MetricsBase
NO_DESCRIPTION
 
Constructor Summary
PersistentMetricsTimeVaryingRate(String nam, org.apache.hadoop.metrics.util.MetricsRegistry registry)
          Constructor - create a new metric
PersistentMetricsTimeVaryingRate(String nam, org.apache.hadoop.metrics.util.MetricsRegistry registry, String description)
          Constructor - create a new metric
 
Method Summary
 void inc(int numOps, long time)
          Increment the metrics for numOps operations
 void inc(long time)
          Increment the metrics for numOps operations
protected  void maintainStats()
           
 void pushMetric(org.apache.hadoop.metrics.MetricsRecord mr)
          Push updated metrics to the mr.
 void resetMinMaxAvg()
          Rollover to a new interval NOTE: does not reset numOps.
 
Methods inherited from class org.apache.hadoop.metrics.util.MetricsTimeVaryingRate
getMaxTime, getMinTime, getPreviousIntervalAverageTime, getPreviousIntervalNumOps, resetMinMax
 
Methods inherited from class org.apache.hadoop.metrics.util.MetricsBase
getDescription, getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.commons.logging.Log LOG

reset

protected boolean reset

lastOper

protected long lastOper

totalOps

protected long totalOps
Constructor Detail

PersistentMetricsTimeVaryingRate

public PersistentMetricsTimeVaryingRate(String nam,
                                        org.apache.hadoop.metrics.util.MetricsRegistry registry,
                                        String description)
Constructor - create a new metric

Parameters:
nam - the name of the metrics to be used to publish the metric
registry - - where the metrics object will be registered
description - metrics description

PersistentMetricsTimeVaryingRate

public PersistentMetricsTimeVaryingRate(String nam,
                                        org.apache.hadoop.metrics.util.MetricsRegistry registry)
Constructor - create a new metric

Parameters:
nam - the name of the metrics to be used to publish the metric
registry - - where the metrics object will be registered
Method Detail

pushMetric

public void pushMetric(org.apache.hadoop.metrics.MetricsRecord mr)
Push updated metrics to the mr. Note this does NOT push to JMX (JMX gets the info via MetricsTimeVaryingRate.getPreviousIntervalAverageTime() and MetricsTimeVaryingRate.getPreviousIntervalNumOps()

Overrides:
pushMetric in class org.apache.hadoop.metrics.util.MetricsTimeVaryingRate
Parameters:
mr - owner of this metric

inc

public void inc(int numOps,
                long time)
Increment the metrics for numOps operations

Overrides:
inc in class org.apache.hadoop.metrics.util.MetricsTimeVaryingRate
Parameters:
numOps - - number of operations
time - - time for numOps operations

inc

public void inc(long time)
Increment the metrics for numOps operations

Overrides:
inc in class org.apache.hadoop.metrics.util.MetricsTimeVaryingRate
Parameters:
time - - time for numOps operations

resetMinMaxAvg

public void resetMinMaxAvg()
Rollover to a new interval NOTE: does not reset numOps. this is an absolute value


maintainStats

protected void maintainStats()


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.