Package org.apache.http.impl
Class HttpConnectionMetricsImpl
java.lang.Object
org.apache.http.impl.HttpConnectionMetricsImpl
- All Implemented Interfaces:
HttpConnectionMetrics
Default implementation of the
HttpConnectionMetrics interface.- Since:
- 4.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHttpConnectionMetricsImpl(HttpTransportMetrics inTransportMetric, HttpTransportMetrics outTransportMetric) -
Method Summary
Modifier and TypeMethodDescriptionReturn the value for the specified metric.longReturns the number of bytes transferred over the connection, 0 if not available.longReturns the number of requests transferred over the connection, 0 if not available.longReturns the number of responses transferred over the connection, 0 if not available.longReturns the number of bytes transferred over the connection, 0 if not available.voidvoidvoidreset()Resets the countsvoid
-
Field Details
-
REQUEST_COUNT
- See Also:
-
RESPONSE_COUNT
- See Also:
-
SENT_BYTES_COUNT
- See Also:
-
RECEIVED_BYTES_COUNT
- See Also:
-
-
Constructor Details
-
HttpConnectionMetricsImpl
public HttpConnectionMetricsImpl(HttpTransportMetrics inTransportMetric, HttpTransportMetrics outTransportMetric)
-
-
Method Details
-
getReceivedBytesCount
public long getReceivedBytesCount()Description copied from interface:HttpConnectionMetricsReturns the number of bytes transferred over the connection, 0 if not available.- Specified by:
getReceivedBytesCountin interfaceHttpConnectionMetrics
-
getSentBytesCount
public long getSentBytesCount()Description copied from interface:HttpConnectionMetricsReturns the number of bytes transferred over the connection, 0 if not available.- Specified by:
getSentBytesCountin interfaceHttpConnectionMetrics
-
getRequestCount
public long getRequestCount()Description copied from interface:HttpConnectionMetricsReturns the number of requests transferred over the connection, 0 if not available.- Specified by:
getRequestCountin interfaceHttpConnectionMetrics
-
incrementRequestCount
public void incrementRequestCount() -
getResponseCount
public long getResponseCount()Description copied from interface:HttpConnectionMetricsReturns the number of responses transferred over the connection, 0 if not available.- Specified by:
getResponseCountin interfaceHttpConnectionMetrics
-
incrementResponseCount
public void incrementResponseCount() -
getMetric
Description copied from interface:HttpConnectionMetricsReturn the value for the specified metric.- Specified by:
getMetricin interfaceHttpConnectionMetrics- Parameters:
metricName- the name of the metric to query.- Returns:
- the object representing the metric requested,
nullif the metric cannot not found.
-
setMetric
-
reset
public void reset()Description copied from interface:HttpConnectionMetricsResets the counts- Specified by:
resetin interfaceHttpConnectionMetrics
-