HTTPCLIENT-1413: Fixed divide by zero error in FutureRequestExecutionMetrics
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1529295 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
cc6a57e04a
commit
4282ad94e3
|
@ -139,7 +139,7 @@ public final class FutureRequestExecutionMetrics {
|
||||||
|
|
||||||
public long averageDuration() {
|
public long averageDuration() {
|
||||||
final long counter = count.get();
|
final long counter = count.get();
|
||||||
return cumulativeDuration.get() / counter;
|
return counter > 0 ? cumulativeDuration.get() / counter : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue