Package org.apache.http.impl
Class HttpConnectionMetricsImpl
java.lang.Object
org.apache.http.impl.HttpConnectionMetricsImpl
- All Implemented Interfaces:
HttpConnectionMetrics
public class HttpConnectionMetricsImpl extends Object implements HttpConnectionMetrics
Implementation of the metrics interface.
-
Field Summary
Fields Modifier and Type Field Description static StringRECEIVED_BYTES_COUNTstatic StringREQUEST_COUNTstatic StringRESPONSE_COUNTstatic StringSENT_BYTES_COUNT -
Constructor Summary
Constructors Constructor Description HttpConnectionMetricsImpl(HttpTransportMetrics inTransportMetric, HttpTransportMetrics outTransportMetric) -
Method Summary
Modifier and Type Method Description ObjectgetMetric(String metricName)Return the value for the specified metric.longgetReceivedBytesCount()Returns the number of bytes transferred over the connection, 0 if not available.longgetRequestCount()Returns the number of requests transferred over the connection, 0 if not available.longgetResponseCount()Returns the number of responses transferred over the connection, 0 if not available.longgetSentBytesCount()Returns the number of bytes transferred over the connection, 0 if not available.voidincrementRequestCount()voidincrementResponseCount()voidreset()Resets the countsvoidsetMetric(String metricName, Object obj)
-
Field Details
-
REQUEST_COUNT
- See Also:
- Constant Field Values
-
RESPONSE_COUNT
- See Also:
- Constant Field Values
-
SENT_BYTES_COUNT
- See Also:
- Constant Field Values
-
RECEIVED_BYTES_COUNT
- See Also:
- Constant Field Values
-
-
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
-