[
https://issues.apache.org/jira/browse/HBASE-4304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13100261#comment-13100261
]
subramanian raghunathan commented on HBASE-4304:
------------------------------------------------
What i felt as corrective action could be is like :
{code}
protected void metrics() {
this.metrics.regions.set(this.onlineRegions.size());
this.metrics.incrementRequests(this.requestCount.get());
//TODO:compute the request per second here
{code}
{color:green}//TODO:compute the request per second here {color}
So the the request per second value will be fixed till the next run
which will be recalculated in the next run and the counter is reset to zero as
part of
{code}
void tryRegionServerReport()
throws IOException {
HServerLoad hsl = buildServerLoad();
// Why we do this?
this.requestCount.set(0);
{code}
{color:red}But this has a contradiction with the usage of context based metrics
update , when the context is enabled.
There could be a chance of race in the computation of the value.
The race will be resetting of the value to zero {this.value = 0;}
after computation {color}
{code}
private synchronized void intervalHeartBeat() {
long now = System.currentTimeMillis();
long diff = (now-ts)/1000;
if (diff == 0) diff = 1; // sigh this is crap.
this.prevRate = (float)value / diff;
this.value = 0;
this.ts = now;
}
{code}
> requestsPerSecond counter stuck at 0
> ------------------------------------
>
> Key: HBASE-4304
> URL: https://issues.apache.org/jira/browse/HBASE-4304
> Project: HBase
> Issue Type: Bug
> Components: master, regionserver
> Affects Versions: 0.92.0
> Reporter: Todd Lipcon
> Assignee: Li Pi
> Priority: Critical
> Fix For: 0.92.0
>
>
> Running trunk @ r1163343, all of the requestsPerSecond counters are showing 0
> both in the master UI and in the RS UI. The writeRequestsCount metric is
> properly updating in the RS UI.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira