HBASE-20672 Adding new Metrics readRequestRate and writeRequestRate - revert pending discussion

This commit is contained in:
tedyu 2018-06-11 18:47:30 -07:00
parent 40f0a43462
commit edf60b965b
5 changed files with 1 additions and 60 deletions

View File

@ -256,18 +256,12 @@ public interface MetricsRegionServerSource extends BaseSource, JvmPauseMonitorSo
String READ_REQUEST_COUNT = "readRequestCount";
String READ_REQUEST_COUNT_DESC =
"Number of read requests with non-empty Results that this RegionServer has answered.";
String READ_REQUEST_RATE_PER_SECOND = "readRequestRatePerSecond";
String READ_REQUEST_RATE_DESC =
"Rate of answering the read requests by this region server per second.";
String FILTERED_READ_REQUEST_COUNT = "filteredReadRequestCount";
String FILTERED_READ_REQUEST_COUNT_DESC =
"Number of filtered read requests this RegionServer has answered.";
String WRITE_REQUEST_COUNT = "writeRequestCount";
String WRITE_REQUEST_COUNT_DESC =
"Number of mutation requests this RegionServer has answered.";
String WRITE_REQUEST_RATE_PER_SECOND = "writeRequestRatePerSecond";
String WRITE_REQUEST_RATE_DESC =
"Rate of answering the mutation requests by this region server per second.";
String CHECK_MUTATE_FAILED_COUNT = "checkMutateFailedCount";
String CHECK_MUTATE_FAILED_COUNT_DESC =
"Number of Check and Mutate calls that failed the checks.";

View File

@ -135,11 +135,6 @@ public interface MetricsRegionServerWrapper {
*/
long getReadRequestsCount();
/**
* Get the rate of read requests per second to regions hosted on this region server.
*/
double getReadRequestsRatePerSecond();
/**
* Get the number of filtered read requests to regions hosted on this region server.
*/
@ -150,11 +145,6 @@ public interface MetricsRegionServerWrapper {
*/
long getWriteRequestsCount();
/**
* Get the rate of write requests per second to regions hosted on this region server.
*/
double getWriteRequestsRatePerSecond();
/**
* Get the number of CAS operations that failed.
*/

View File

@ -544,11 +544,7 @@ public class MetricsRegionServerSourceImpl
.addGauge(Interns.info(MOB_FILE_CACHE_COUNT, MOB_FILE_CACHE_COUNT_DESC),
rsWrap.getMobFileCacheCount())
.addGauge(Interns.info(MOB_FILE_CACHE_HIT_PERCENT, MOB_FILE_CACHE_HIT_PERCENT_DESC),
rsWrap.getMobFileCacheHitPercent())
.addGauge(Interns.info(READ_REQUEST_RATE_PER_SECOND, READ_REQUEST_RATE_DESC),
rsWrap.getReadRequestsRatePerSecond())
.addGauge(Interns.info(WRITE_REQUEST_RATE_PER_SECOND, WRITE_REQUEST_RATE_DESC),
rsWrap.getWriteRequestsRatePerSecond());
rsWrap.getMobFileCacheHitPercent());
}
@Override

View File

@ -74,10 +74,8 @@ class MetricsRegionServerWrapperImpl
private volatile long numReferenceFiles = 0;
private volatile double requestsPerSecond = 0.0;
private volatile long readRequestsCount = 0;
private volatile double readRequestsRatePerSecond = 0;
private volatile long filteredReadRequestsCount = 0;
private volatile long writeRequestsCount = 0;
private volatile double writeRequestsRatePerSecond = 0;
private volatile long checkAndMutateChecksFailed = 0;
private volatile long checkAndMutateChecksPassed = 0;
private volatile long storefileIndexSize = 0;
@ -520,11 +518,6 @@ class MetricsRegionServerWrapperImpl
return readRequestsCount;
}
@Override
public double getReadRequestsRatePerSecond() {
return readRequestsRatePerSecond;
}
@Override
public long getFilteredReadRequestsCount() {
return filteredReadRequestsCount;
@ -535,11 +528,6 @@ class MetricsRegionServerWrapperImpl
return writeRequestsCount;
}
@Override
public double getWriteRequestsRatePerSecond() {
return writeRequestsRatePerSecond;
}
@Override
public long getRpcGetRequestsCount() {
return regionServer.rpcServices.rpcGetRequestCount.sum();
@ -722,8 +710,6 @@ class MetricsRegionServerWrapperImpl
private long lastRan = 0;
private long lastRequestCount = 0;
private long lastReadRequestsCount = 0;
private long lastWriteRequestsCount = 0;
@Override
synchronized public void run() {
@ -859,21 +845,6 @@ class MetricsRegionServerWrapperImpl
requestsPerSecond = (currentRequestCount - lastRequestCount) /
((currentTime - lastRan) / 1000.0);
lastRequestCount = currentRequestCount;
long intervalReadRequestsCount = tempReadRequestsCount - lastReadRequestsCount;
long intervalWriteRequestsCount = tempWriteRequestsCount - lastWriteRequestsCount;
double readRequestsRatePerMilliSecond = ((double)intervalReadRequestsCount/
(double)period);
double writeRequestsRatePerMilliSecond = ((double)intervalWriteRequestsCount/
(double)period);
readRequestsRatePerSecond = readRequestsRatePerMilliSecond * 1000.0;
writeRequestsRatePerSecond = writeRequestsRatePerMilliSecond * 1000.0;
lastReadRequestsCount = tempReadRequestsCount;
lastWriteRequestsCount = tempWriteRequestsCount;
}
lastRan = currentTime;

View File

@ -100,11 +100,6 @@ public class MetricsRegionServerWrapperStub implements MetricsRegionServerWrappe
return 899;
}
@Override
public double getReadRequestsRatePerSecond() {
return 10.0;
}
@Override
public long getTotalRowActionRequestCount() {
return getReadRequestsCount() + getWriteRequestsCount();
@ -125,11 +120,6 @@ public class MetricsRegionServerWrapperStub implements MetricsRegionServerWrappe
return 707;
}
@Override
public double getWriteRequestsRatePerSecond() {
return 10.0;
}
@Override
public long getRpcGetRequestsCount() {
return 521;