org.apache.hadoop.hive.common.metrics
Class Metrics
java.lang.Object
org.apache.hadoop.hive.common.metrics.Metrics
public class Metrics
- extends Object
Metrics Subsystem - allows exposure of a number of named parameters/counters
via jmx, intended to be used as a static subsystem
Has a couple of primary ways it can be used:
(i) Using the set and get methods to set and get named parameters
(ii) Using the incrementCounter method to increment and set named
parameters in one go, rather than having to make a get and then a set.
(iii) Using the startScope and endScope methods to start and end
named "scopes" that record the number of times they've been
instantiated and amount of time(in milliseconds) spent inside
the scopes.
Nested Class Summary |
class |
Metrics.MetricsScope
MetricsScope : A class that encapsulates an idea of a metered scope. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Metrics
public Metrics()
init
public static void init()
throws Exception
- Throws:
Exception
incrementCounter
public static Long incrementCounter(String name)
throws IOException
- Throws:
IOException
incrementCounter
public static Long incrementCounter(String name,
long increment)
throws IOException
- Throws:
IOException
set
public static void set(String name,
Object value)
throws IOException
- Throws:
IOException
get
public static Object get(String name)
throws IOException
- Throws:
IOException
startScope
public static Metrics.MetricsScope startScope(String name)
throws IOException
- Throws:
IOException
getScope
public static Metrics.MetricsScope getScope(String name)
throws IOException
- Throws:
IOException
endScope
public static void endScope(String name)
throws IOException
- Throws:
IOException
Copyright © 2013 The Apache Software Foundation