@InterfaceAudience.Private public final class JSONMetricUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
HADOOP_DOMAIN |
static String |
JAVA_LANG_DOMAIN |
static String |
JAVA_NIO_DOMAIN |
private static org.slf4j.Logger |
LOG |
private static MBeanServer |
mbServer |
static String |
NAME_KEY |
static String |
SERVICE_KEY |
static String |
SUBSYSTEM_KEY |
static String |
SUN_MGMT_DOMAIN |
static String |
TYPE_KEY |
Modifier | Constructor and Description |
---|---|
private |
JSONMetricUtil()
Utility for getting metric values.
|
Modifier and Type | Method and Description |
---|---|
static ObjectName |
buildObjectName(String pattern) |
static ObjectName |
buildObjectName(String domain,
Hashtable<String,String> keyValueTable) |
static Hashtable<String,String> |
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 |
getCommmand() |
static List<GarbageCollectorMXBean> |
getGcCollectorBeans() |
static long |
getLastGcDuration(ObjectName gcCollector) |
static MBeanAttributeInfo[] |
getMBeanAttributeInfo(ObjectName bean) |
static List<MemoryPoolMXBean> |
getMemoryPools() |
static String |
getProcessPID() |
static Set<ObjectName> |
getRegistredMBeans(ObjectName name,
MBeanServer mbs) |
static Object |
getValueFromMBean(ObjectName bean,
String attribute) |
private static final org.slf4j.Logger LOG
private static MBeanServer mbServer
public static final String JAVA_LANG_DOMAIN
public static final String JAVA_NIO_DOMAIN
public static final String SUN_MGMT_DOMAIN
public static final String HADOOP_DOMAIN
public static final String TYPE_KEY
public static final String NAME_KEY
public static final String SERVICE_KEY
public static final String SUBSYSTEM_KEY
private JSONMetricUtil()
public static MBeanAttributeInfo[] getMBeanAttributeInfo(ObjectName bean) throws IntrospectionException, InstanceNotFoundException, ReflectionException, IntrospectionException, IntrospectionException
public static Object getValueFromMBean(ObjectName bean, String attribute)
public static String dumpBeanToString(String qry) throws MalformedObjectNameException, IOException
MalformedObjectNameException
- if json have bad formatIOException
- /public static Hashtable<String,String> buldKeyValueTable(String[] keys, String[] values)
keys
- Map keysvalues
- Map valuespublic static ObjectName buildObjectName(String pattern) throws MalformedObjectNameException
MalformedObjectNameException
public static ObjectName buildObjectName(String domain, Hashtable<String,String> keyValueTable) throws MalformedObjectNameException
MalformedObjectNameException
public static Set<ObjectName> getRegistredMBeans(ObjectName name, MBeanServer mbs)
public static String getProcessPID()
public static String getCommmand() throws MalformedObjectNameException, IOException
public static List<GarbageCollectorMXBean> getGcCollectorBeans()
public static long getLastGcDuration(ObjectName gcCollector)
public static List<MemoryPoolMXBean> getMemoryPools()
public static float calcPercentage(long a, long b)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.