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 theHttpConnectionMetrics
interface.- Since:
- 4.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
RECEIVED_BYTES_COUNT
static java.lang.String
REQUEST_COUNT
static java.lang.String
RESPONSE_COUNT
static java.lang.String
SENT_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.Object
getMetric(java.lang.String metricName)
Return the value for the specified metric.long
getReceivedBytesCount()
Returns the number of bytes transferred over the connection, 0 if not available.long
getRequestCount()
Returns the number of requests transferred over the connection, 0 if not available.long
getResponseCount()
Returns the number of responses transferred over the connection, 0 if not available.long
getSentBytesCount()
Returns the number of bytes transferred over the connection, 0 if not available.void
incrementRequestCount()
void
incrementResponseCount()
void
reset()
Resets the countsvoid
setMetric(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:HttpConnectionMetrics
Returns 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
Returns 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
Returns 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
Returns the number of responses transferred over the connection, 0 if not available.- Specified by:
getResponseCount
in interfaceHttpConnectionMetrics
-
incrementResponseCount
public void incrementResponseCount()
-
getMetric
public java.lang.Object getMetric(java.lang.String metricName)
Description copied from interface:HttpConnectionMetrics
Return the value for the specified metric.- Specified by:
getMetric
in interfaceHttpConnectionMetrics
- Parameters:
metricName
- the name of the metric to query.- Returns:
- the object representing the metric requested,
null
if 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:HttpConnectionMetrics
Resets the counts- Specified by:
reset
in interfaceHttpConnectionMetrics
-
-