Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added INFO level messages to better understand the performance of per…

…-request instrumentation. Expect to remove most of this after debugging.
  • Loading branch information...
commit e29b2228f99923d7a76726abb3b3c2832667fdf7 1 parent 7b8d30c
@jayjwylie jayjwylie authored
View
13 src/java/voldemort/store/stats/RequestCounter.java
@@ -180,6 +180,10 @@ public void addRequest(long timeNS,
long numEmptyResponses,
long bytes,
long getAllAggregatedCount) {
+ // TODO: Remove this instrumentation
+ final long infoCutoffNs = 100 * 1000; // 100 us cut off for INFO display
+ long startTimeNs = System.nanoTime();
+
long timeMs = timeNS / Time.NS_PER_MS;
if(this.useHistogram) {
histogram.insert(timeMs);
@@ -198,8 +202,15 @@ public void addRequest(long timeNS,
oldv.getAllAggregatedCount + getAllAggregatedCount,
getAllAggregatedCount > oldv.getAllMaxCount ? getAllAggregatedCount
: oldv.getAllMaxCount);
- if(values.compareAndSet(oldv, newv))
+ if(values.compareAndSet(oldv, newv)) {
+ long durationNs = System.nanoTime() - startTimeNs;
+ if(durationNs > infoCutoffNs) {
+ logger.info("addRequest (histogram.insert and accumulator update) took more than "
+ + infoCutoffNs + " ns: " + durationNs + " ns.");
+ }
+
return;
+ }
}
// TODO: Make this DEBUG level
logger.info("addRequest lost data because three retries was insufficient.");
View
22 src/java/voldemort/utils/pool/KeyedResourcePool.java
@@ -448,20 +448,20 @@ public Pool(ResourcePoolConfig resourcePoolConfig) {
if(!nonBlockingPut(resource)) {
this.size.decrementAndGet();
objectFactory.destroy(key, resource);
- if (currentCreatesInFlight>0) {
- logger.info("attemptGrow established new connection for key "
- + key.toString() + " with " + currentCreatesInFlight
- + " other connection establishments in flight."
- + " And then promptly destroyed the new connection.");
+ if(currentCreatesInFlight > 0) {
+ logger.info("attemptGrow established new connection for key "
+ + key.toString() + " with " + currentCreatesInFlight
+ + " other connection establishments in flight."
+ + " And then promptly destroyed the new connection.");
}
return false;
}
- if (currentCreatesInFlight>0) {
- logger.info("attemptGrow established new connection for key "
- + key.toString() + " with " + currentCreatesInFlight
- + " other connection establishments in flight."
- + " After checking in to KeyedResourcePool, there are "
- + queue.size() + " destinations checked in.");
+ if(currentCreatesInFlight > 0) {
+ logger.info("attemptGrow established new connection for key "
+ + key.toString() + " with " + currentCreatesInFlight
+ + " other connection establishments in flight."
+ + " After checking in to KeyedResourcePool, there are "
+ + queue.size() + " destinations checked in.");
}
}
} catch(Exception e) {
Please sign in to comment.
Something went wrong with that request. Please try again.