HBASE-25435 Slow metric value can be configured
Signed-off-by: jediwang <jediwang@tencent.com>
This commit is contained in:
parent
f5a7fffd8b
commit
35648278fc
|
@ -42,6 +42,7 @@ public class MetricsRegionServer {
|
|||
"hbase.regionserver.enable.table.latencies";
|
||||
public static final boolean RS_ENABLE_TABLE_METRICS_DEFAULT = true;
|
||||
|
||||
public static final String SLOW_METRIC_TIME = "hbase.ipc.slow.metric.time";
|
||||
private final MetricsRegionServerSource serverSource;
|
||||
private final MetricsRegionServerWrapper regionServerWrapper;
|
||||
private RegionServerTableMetrics tableMetrics;
|
||||
|
@ -53,6 +54,8 @@ public class MetricsRegionServer {
|
|||
private Timer bulkLoadTimer;
|
||||
private Meter serverReadQueryMeter;
|
||||
private Meter serverWriteQueryMeter;
|
||||
protected long slowMetricTime;
|
||||
protected static final int DEFAULT_SLOW_METRIC_TIME = 1000; // milliseconds
|
||||
|
||||
public MetricsRegionServer(MetricsRegionServerWrapper regionServerWrapper, Configuration conf,
|
||||
MetricsTable metricsTable) {
|
||||
|
@ -68,6 +71,7 @@ public class MetricsRegionServer {
|
|||
// create and use metrics from the new hbase-metrics based registry.
|
||||
bulkLoadTimer = metricRegistry.timer("Bulkload");
|
||||
|
||||
slowMetricTime = conf.getLong(SLOW_METRIC_TIME, DEFAULT_SLOW_METRIC_TIME);
|
||||
serverReadQueryMeter = metricRegistry.meter("ServerReadQueryPerSecond");
|
||||
serverWriteQueryMeter = metricRegistry.meter("ServerWriteQueryPerSecond");
|
||||
quotaSource = CompatibilitySingletonFactory.getInstance(MetricsRegionServerQuotaSource.class);
|
||||
|
@ -109,7 +113,7 @@ public class MetricsRegionServer {
|
|||
if (tableMetrics != null && tn != null) {
|
||||
tableMetrics.updatePutBatch(tn, t);
|
||||
}
|
||||
if (t > 1000) {
|
||||
if (t > slowMetricTime) {
|
||||
serverSource.incrSlowPut();
|
||||
}
|
||||
serverSource.updatePutBatch(t);
|
||||
|
@ -135,7 +139,7 @@ public class MetricsRegionServer {
|
|||
if (tableMetrics != null && tn != null) {
|
||||
tableMetrics.updateDeleteBatch(tn, t);
|
||||
}
|
||||
if (t > 1000) {
|
||||
if (t > slowMetricTime) {
|
||||
serverSource.incrSlowDelete();
|
||||
}
|
||||
serverSource.updateDeleteBatch(t);
|
||||
|
@ -166,7 +170,7 @@ public class MetricsRegionServer {
|
|||
if (tableMetrics != null && tn != null) {
|
||||
tableMetrics.updateGet(tn, t);
|
||||
}
|
||||
if (t > 1000) {
|
||||
if (t > slowMetricTime) {
|
||||
serverSource.incrSlowGet();
|
||||
}
|
||||
serverSource.updateGet(t);
|
||||
|
@ -177,7 +181,7 @@ public class MetricsRegionServer {
|
|||
if (tableMetrics != null && tn != null) {
|
||||
tableMetrics.updateIncrement(tn, t);
|
||||
}
|
||||
if (t > 1000) {
|
||||
if (t > slowMetricTime) {
|
||||
serverSource.incrSlowIncrement();
|
||||
}
|
||||
serverSource.updateIncrement(t);
|
||||
|
@ -188,7 +192,7 @@ public class MetricsRegionServer {
|
|||
if (tableMetrics != null && tn != null) {
|
||||
tableMetrics.updateAppend(tn, t);
|
||||
}
|
||||
if (t > 1000) {
|
||||
if (t > slowMetricTime) {
|
||||
serverSource.incrSlowAppend();
|
||||
}
|
||||
serverSource.updateAppend(t);
|
||||
|
|
Loading…
Reference in New Issue