Package org.apache.hadoop.hbase.util
Class JSONMetricUtil
java.lang.Object
org.apache.hadoop.hbase.util.JSONMetricUtil
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectName
buildObjectName
(String pattern) static ObjectName
buildObjectName
(String domain, Hashtable<String, String> keyValueTable) buldKeyValueTable
(String[] keys, String[] values) Method for building map used for constructing ObjectName.static float
calcPercentage
(long a, long b) static String
dumpBeanToString
(String qry) Returns a subset of mbeans defined by qry.static String
static List<GarbageCollectorMXBean>
static long
getLastGcDuration
(ObjectName gcCollector) static MBeanAttributeInfo[]
static List<MemoryPoolMXBean>
static String
static Set<ObjectName>
getRegistredMBeans
(ObjectName name, MBeanServer mbs) static Object
getValueFromMBean
(ObjectName bean, String attribute)
-
Field Details
-
LOG
-
mbServer
-
JAVA_LANG_DOMAIN
- See Also:
-
JAVA_NIO_DOMAIN
- See Also:
-
SUN_MGMT_DOMAIN
- See Also:
-
HADOOP_DOMAIN
- See Also:
-
TYPE_KEY
- See Also:
-
NAME_KEY
- See Also:
-
SERVICE_KEY
- See Also:
-
SUBSYSTEM_KEY
- See Also:
-
-
Constructor Details
-
JSONMetricUtil
private JSONMetricUtil()Utility for getting metric values. Collection of static methods intended for easier access to metric values.
-
-
Method Details
-
getMBeanAttributeInfo
public static MBeanAttributeInfo[] getMBeanAttributeInfo(ObjectName bean) throws IntrospectionException, InstanceNotFoundException, ReflectionException, IntrospectionException, IntrospectionException -
getValueFromMBean
-
dumpBeanToString
Returns a subset of mbeans defined by qry. Modeled after DumpRegionServerMetrics#dumpMetrics. Example: String qry= "java.lang:type=Memory"- Returns:
- String representation of json array.
- Throws:
MalformedObjectNameException
- if json have bad formatIOException
- /
-
buldKeyValueTable
Method for building map used for constructing ObjectName. Mapping is done with arrays indices- Parameters:
keys
- Map keysvalues
- Map values- Returns:
- Map or null if arrays are empty or have different number of elements
-
buildObjectName
- Throws:
MalformedObjectNameException
-
buildObjectName
public static ObjectName buildObjectName(String domain, Hashtable<String, String> keyValueTable) throws MalformedObjectNameException- Throws:
MalformedObjectNameException
-
getRegistredMBeans
-
getProcessPID
-
getCommmand
-
getGcCollectorBeans
-
getLastGcDuration
-
getMemoryPools
-
calcPercentage
-