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
FieldsModifier and TypeFieldDescriptionprivate final HttpTransportMetrics
The cache map for all metrics values.private final HttpTransportMetrics
static final String
static final String
private long
static final String
private long
static final String
-
Constructor Summary
ConstructorsConstructorDescriptionHttpConnectionMetricsImpl
(HttpTransportMetrics inTransportMetric, HttpTransportMetrics outTransportMetric) -
Method Summary
Modifier and TypeMethodDescriptionReturn the value for the specified metric.long
Returns the number of bytes transferred over the connection, 0 if not available.long
Returns the number of requests transferred over the connection, 0 if not available.long
Returns the number of responses transferred over the connection, 0 if not available.long
Returns the number of bytes transferred over the connection, 0 if not available.void
void
void
reset()
Resets the countsvoid
-
Field Details
-
REQUEST_COUNT
- See Also:
-
RESPONSE_COUNT
- See Also:
-
SENT_BYTES_COUNT
- See Also:
-
RECEIVED_BYTES_COUNT
- See Also:
-
inTransportMetric
-
outTransportMetric
-
requestCount
private long requestCount -
responseCount
private long responseCount -
metricsCache
The cache map for all metrics values.
-
-
Constructor Details
-
HttpConnectionMetricsImpl
public HttpConnectionMetricsImpl(HttpTransportMetrics inTransportMetric, HttpTransportMetrics outTransportMetric)
-
-
Method Details
-
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
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
-
reset
public void reset()Description copied from interface:HttpConnectionMetrics
Resets the counts- Specified by:
reset
in interfaceHttpConnectionMetrics
-