org.apache.hadoop.hive.common.metrics
Class Metrics.MetricsScope

java.lang.Object
  extended by org.apache.hadoop.hive.common.metrics.Metrics.MetricsScope
Enclosing class:
Metrics

public static class Metrics.MetricsScope
extends Object

MetricsScope : A class that encapsulates an idea of a metered scope. Instantiating a named scope and then closing it exposes two counters: (i) a "number of calls" counter ( <name>.n ), and (ii) a "number of msecs spent between scope open and close" counter. ( <name>.t)


Method Summary
 void close()
          Closes scope, and records the time taken
 Long getNumCounter()
           
 Long getTimeCounter()
           
 void open()
          Opens scope, and makes note of the time started, increments run counter
 void reopen()
          Closes scope if open, and reopens it
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getNumCounter

public Long getNumCounter()
                   throws IOException
Throws:
IOException

getTimeCounter

public Long getTimeCounter()
                    throws IOException
Throws:
IOException

open

public void open()
          throws IOException
Opens scope, and makes note of the time started, increments run counter

Throws:
IOException

close

public void close()
           throws IOException
Closes scope, and records the time taken

Throws:
IOException

reopen

public void reopen()
            throws IOException
Closes scope if open, and reopens it

Throws:
IOException


Copyright © 2012 The Apache Software Foundation