Package org.apache.hc.core5.http.impl
Class BasicHttpConnectionMetrics
- java.lang.Object
-
- org.apache.hc.core5.http.impl.BasicHttpConnectionMetrics
-
- All Implemented Interfaces:
HttpConnectionMetrics
public final class BasicHttpConnectionMetrics extends java.lang.Object implements HttpConnectionMetrics
Default implementation of theHttpConnectionMetrics
interface.- Since:
- 4.0
-
-
Field Summary
Fields Modifier and Type Field Description private HttpTransportMetrics
inTransportMetric
private HttpTransportMetrics
outTransportMetric
private java.util.concurrent.atomic.AtomicLong
requestCount
private java.util.concurrent.atomic.AtomicLong
responseCount
-
Constructor Summary
Constructors Constructor Description BasicHttpConnectionMetrics(HttpTransportMetrics inTransportMetric, HttpTransportMetrics outTransportMetric)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getReceivedBytesCount()
Gets the number of bytes transferred over the connection, 0 if not available.long
getRequestCount()
Gets the number of requests transferred over the connection, 0 if not available.long
getResponseCount()
Gets the number of responses transferred over the connection, 0 if not available.long
getSentBytesCount()
Gets the number of bytes transferred over the connection, 0 if not available.void
incrementRequestCount()
void
incrementResponseCount()
-
-
-
Field Detail
-
inTransportMetric
private final HttpTransportMetrics inTransportMetric
-
outTransportMetric
private final HttpTransportMetrics outTransportMetric
-
requestCount
private final java.util.concurrent.atomic.AtomicLong requestCount
-
responseCount
private final java.util.concurrent.atomic.AtomicLong responseCount
-
-
Constructor Detail
-
BasicHttpConnectionMetrics
public BasicHttpConnectionMetrics(HttpTransportMetrics inTransportMetric, HttpTransportMetrics outTransportMetric)
-
-
Method Detail
-
getReceivedBytesCount
public long getReceivedBytesCount()
Description copied from interface:HttpConnectionMetrics
Gets the number of bytes transferred over the connection, 0 if not available.- Specified by:
getReceivedBytesCount
in interfaceHttpConnectionMetrics
-
getSentBytesCount
public long getSentBytesCount()
Description copied from interface:HttpConnectionMetrics
Gets the number of bytes transferred over the connection, 0 if not available.- Specified by:
getSentBytesCount
in interfaceHttpConnectionMetrics
-
getRequestCount
public long getRequestCount()
Description copied from interface:HttpConnectionMetrics
Gets the number of requests transferred over the connection, 0 if not available.- Specified by:
getRequestCount
in interfaceHttpConnectionMetrics
-
incrementRequestCount
public void incrementRequestCount()
-
getResponseCount
public long getResponseCount()
Description copied from interface:HttpConnectionMetrics
Gets the number of responses transferred over the connection, 0 if not available.- Specified by:
getResponseCount
in interfaceHttpConnectionMetrics
-
incrementResponseCount
public void incrementResponseCount()
-
-