Package org.apache.http.impl
Class HttpConnectionMetricsImpl
- java.lang.Object
-
- org.apache.http.impl.HttpConnectionMetricsImpl
-
- All Implemented Interfaces:
HttpConnectionMetrics
public class HttpConnectionMetricsImpl extends java.lang.Object implements HttpConnectionMetrics
Default implementation of theHttpConnectionMetricsinterface.- Since:
- 4.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringRECEIVED_BYTES_COUNTstatic java.lang.StringREQUEST_COUNTstatic java.lang.StringRESPONSE_COUNTstatic java.lang.StringSENT_BYTES_COUNT
-
Constructor Summary
Constructors Constructor Description HttpConnectionMetricsImpl(HttpTransportMetrics inTransportMetric, HttpTransportMetrics outTransportMetric)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetMetric(java.lang.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(java.lang.String metricName, java.lang.Object obj)
-
-
-
Field Detail
-
REQUEST_COUNT
public static final java.lang.String REQUEST_COUNT
- See Also:
- Constant Field Values
-
RESPONSE_COUNT
public static final java.lang.String RESPONSE_COUNT
- See Also:
- Constant Field Values
-
SENT_BYTES_COUNT
public static final java.lang.String SENT_BYTES_COUNT
- See Also:
- Constant Field Values
-
RECEIVED_BYTES_COUNT
public static final java.lang.String RECEIVED_BYTES_COUNT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HttpConnectionMetricsImpl
public HttpConnectionMetricsImpl(HttpTransportMetrics inTransportMetric, HttpTransportMetrics outTransportMetric)
-
-
Method Detail
-
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
public java.lang.Object getMetric(java.lang.String metricName)
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
public void setMetric(java.lang.String metricName, java.lang.Object obj)
-
reset
public void reset()
Description copied from interface:HttpConnectionMetricsResets the counts- Specified by:
resetin interfaceHttpConnectionMetrics
-
-