HBASE-12328 Need to separate JvmMetrics for Master and RegionServer (Sanghyun Yun)
This commit is contained in:
parent
b389ca211e
commit
31c185aad5
|
@ -47,9 +47,9 @@ public abstract class MetricsHBaseServerSourceFactory {
|
|||
* @return The Camel Cased context name.
|
||||
*/
|
||||
protected static String createContextName(String serverName) {
|
||||
if (serverName.contains("HMaster")) {
|
||||
if (serverName.contains("HMaster") || serverName.contains("master")) {
|
||||
return "Master";
|
||||
} else if (serverName.contains("HRegion")) {
|
||||
} else if (serverName.contains("HRegion") || serverName.contains("regionserver")) {
|
||||
return "RegionServer";
|
||||
}
|
||||
return "IPC";
|
||||
|
|
|
@ -46,7 +46,7 @@ public class MetricsHBaseServerSourceFactoryImpl extends MetricsHBaseServerSourc
|
|||
if (source == null) {
|
||||
//Create the source.
|
||||
source = new MetricsHBaseServerSourceImpl(
|
||||
METRICS_NAME,
|
||||
context,
|
||||
METRICS_DESCRIPTION,
|
||||
context.toLowerCase(),
|
||||
context + METRICS_JMX_CONTEXT_SUFFIX, wrapper);
|
||||
|
|
|
@ -48,8 +48,8 @@ public class TestRpcMetrics {
|
|||
assertEquals("Master,sub=IPC", masterSource.getMetricsJmxContext());
|
||||
assertEquals("RegionServer,sub=IPC", rsSource.getMetricsJmxContext());
|
||||
|
||||
assertEquals("IPC", masterSource.getMetricsName());
|
||||
assertEquals("IPC", rsSource.getMetricsName());
|
||||
assertEquals("Master", masterSource.getMetricsName());
|
||||
assertEquals("RegionServer", rsSource.getMetricsName());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue