1
0
mirror of https://github.com/square/okhttp.git synced 2026-01-17 08:42:25 +03:00

Merge pull request #1553 from square/kiran+kenji/add-active

Expose running and queued call counts for monitoring
This commit is contained in:
Jesse Wilson
2015-04-14 00:44:16 -04:00

View File

@@ -177,4 +177,12 @@ public final class Dispatcher {
synchronized void finished(Call call) {
if (!executedCalls.remove(call)) throw new AssertionError("Call wasn't in-flight!");
}
public synchronized int getRunningCallCount() {
return runningCalls.size();
}
public synchronized int getQueuedCallCount() {
return readyCalls.size();
}
}