@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 |
static String |
NAME_KEY |
static String |
SERVICE_KEY |
static String |
SUBSYSTEM_KEY |
static String |
SUN_MGMT_DOMAIN |
static String |
TYPE_KEY |
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 hashtable 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) |
static com.fasterxml.jackson.databind.JsonNode |
mappStringToJsonNode(String jsonString) |
static com.fasterxml.jackson.databind.JsonNode |
searchJson(com.fasterxml.jackson.databind.JsonNode tree,
String searchKey) |
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
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 com.fasterxml.jackson.databind.JsonNode mappStringToJsonNode(String jsonString) throws com.fasterxml.jackson.core.JsonProcessingException, IOException
com.fasterxml.jackson.core.JsonProcessingException
IOException
public static com.fasterxml.jackson.databind.JsonNode searchJson(com.fasterxml.jackson.databind.JsonNode tree, String searchKey) throws com.fasterxml.jackson.core.JsonProcessingException, IOException
com.fasterxml.jackson.core.JsonProcessingException
IOException
public static Hashtable<String,String> buldKeyValueTable(String[] keys, String[] values)
keys
- Hashtable keysvalues
- Hashtable 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–2019 Cloudera. All rights reserved.