Skip to content

Commit

Permalink
Fix contention related environment stats
Browse files Browse the repository at this point in the history
  • Loading branch information
afeinberg committed Sep 1, 2011
1 parent 3ebabd9 commit d2366e7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/java/voldemort/store/bdb/stats/BdbEnvironmentStats.java
Expand Up @@ -115,13 +115,13 @@ public long getCleanerBacklog() {
return getFastStats().getCleanerBacklog();
}

@JmxGetter(name = "NumAcquiredWithContention")
public long getNumAcquiredWithContention() {
@JmxGetter(name = "NumAcquiresWithContention")
public long getNumAcquiresWithContention() {
return getFastStats().getNAcquiresWithContention();
}

@JmxGetter(name = "NumAcquireNoWaiters")
public long getNumAcquireNoWaiters() {
@JmxGetter(name = "NumAcquiresNoWaiters")
public long getNumAcquiresNoWaiters() {
return getFastStats().getNAcquiresNoWaiters();
}

Expand Down Expand Up @@ -193,7 +193,8 @@ public double getPercentageCacheHits() {

@JmxGetter(name = "PercentageContended")
public double getPercentageContended() {
return safeGetPercentage(getNumAcquiredWithContention(), getNumAcquireNoWaiters());
return safeGetPercentage(getNumAcquiresWithContention(),
getNumAcquiresWithContention() + getNumAcquiresNoWaiters());
}

public static double safeGetPercentage(long rawNum, long total) {
Expand Down

0 comments on commit d2366e7

Please sign in to comment.