Package org.apache.hadoop.hbase.util
Class JSONMetricUtil
java.lang.Object
org.apache.hadoop.hbase.util.JSONMetricUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectNamebuildObjectName(String pattern) static ObjectNamebuildObjectName(String domain, Hashtable<String, String> keyValueTable) buldKeyValueTable(String[] keys, String[] values) Method for building map used for constructing ObjectName.static floatcalcPercentage(long a, long b) static StringdumpBeanToString(String qry) Returns a subset of mbeans defined by qry.static Stringstatic List<GarbageCollectorMXBean>static longgetLastGcDuration(ObjectName gcCollector) static MBeanAttributeInfo[]static List<MemoryPoolMXBean>static Stringstatic Set<ObjectName>getRegistredMBeans(ObjectName name, MBeanServer mbs) static ObjectgetValueFromMBean(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
-