Top Description Fields Constructors Methods
org.apache.http.impl

public Class HttpConnectionMetricsImpl

extends Object
implements HttpConnectionMetrics
Class Inheritance
All Implemented Interfaces
org.apache.http.HttpConnectionMetrics
Imports
java.util.HashMap, .Map, org.apache.http.HttpConnectionMetrics, org.apache.http.io.HttpTransportMetrics

Default implementation of the HttpConnectionMetrics interface.
Since
4.0

Field Summary

Modifier and TypeField and Description
private final HttpTransportMetrics
private Map<String, Object>
metricsCache

The cache map for all metrics values.

private final HttpTransportMetrics
public static final String
public static final String
private long
public static final String
private long
public static final String

Constructor Summary

AccessConstructor and Description
public
HttpConnectionMetricsImpl(final HttpTransportMetrics inTransportMetric, final HttpTransportMetrics outTransportMetric)

Method Summary

Modifier and TypeMethod and Description
public Object
getMetric(final String
the name of the metric to query.
metricName
)

Implements org.apache.http.HttpConnectionMetrics.getMetric.

Return the value for the specified metric.
public long
getReceivedBytesCount()

Implements org.apache.http.HttpConnectionMetrics.getReceivedBytesCount.

Returns the number of bytes transferred over the connection, 0 if not available.
public long
getRequestCount()

Implements org.apache.http.HttpConnectionMetrics.getRequestCount.

Returns the number of requests transferred over the connection, 0 if not available.
public long
getResponseCount()

Implements org.apache.http.HttpConnectionMetrics.getResponseCount.

Returns the number of responses transferred over the connection, 0 if not available.
public long
getSentBytesCount()

Implements org.apache.http.HttpConnectionMetrics.getSentBytesCount.

Returns the number of bytes transferred over the connection, 0 if not available.
public void
public void
public void
reset()

Implements org.apache.http.HttpConnectionMetrics.reset.

Resets the counts
public void
setMetric(final String metricName, final Object obj)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

inTransportMetricback to summary
private final HttpTransportMetrics inTransportMetric
metricsCacheback to summary
private Map<String, Object> metricsCache

The cache map for all metrics values.

outTransportMetricback to summary
private final HttpTransportMetrics outTransportMetric
RECEIVED_BYTES_COUNTback to summary
public static final String RECEIVED_BYTES_COUNT
REQUEST_COUNTback to summary
public static final String REQUEST_COUNT
requestCountback to summary
private long requestCount
RESPONSE_COUNTback to summary
public static final String RESPONSE_COUNT
responseCountback to summary
private long responseCount
SENT_BYTES_COUNTback to summary
public static final String SENT_BYTES_COUNT

Constructor Detail

HttpConnectionMetricsImplback to summary
public HttpConnectionMetricsImpl(final HttpTransportMetrics inTransportMetric, final HttpTransportMetrics outTransportMetric)

Method Detail

getMetricback to summary
public Object getMetric(final String metricName)

Implements org.apache.http.HttpConnectionMetrics.getMetric.

Doc from org.apache.http.HttpConnectionMetrics.getMetric.

Return the value for the specified metric.

Parameters
metricName:String

the name of the metric to query.

Returns:Object

the object representing the metric requested, null if the metric cannot not found.

Annotations
@Override
getReceivedBytesCountback to summary
public long getReceivedBytesCount()

Implements org.apache.http.HttpConnectionMetrics.getReceivedBytesCount.

Doc from org.apache.http.HttpConnectionMetrics.getReceivedBytesCount.

Returns the number of bytes transferred over the connection, 0 if not available.

Annotations
@Override
getRequestCountback to summary
public long getRequestCount()

Implements org.apache.http.HttpConnectionMetrics.getRequestCount.

Doc from org.apache.http.HttpConnectionMetrics.getRequestCount.

Returns the number of requests transferred over the connection, 0 if not available.

Annotations
@Override
getResponseCountback to summary
public long getResponseCount()

Implements org.apache.http.HttpConnectionMetrics.getResponseCount.

Doc from org.apache.http.HttpConnectionMetrics.getResponseCount.

Returns the number of responses transferred over the connection, 0 if not available.

Annotations
@Override
getSentBytesCountback to summary
public long getSentBytesCount()

Implements org.apache.http.HttpConnectionMetrics.getSentBytesCount.

Doc from org.apache.http.HttpConnectionMetrics.getSentBytesCount.

Returns the number of bytes transferred over the connection, 0 if not available.

Annotations
@Override
incrementRequestCountback to summary
public void incrementRequestCount()
incrementResponseCountback to summary
public void incrementResponseCount()
resetback to summary
public void reset()

Implements org.apache.http.HttpConnectionMetrics.reset.

Doc from org.apache.http.HttpConnectionMetrics.reset.

Resets the counts

Annotations
@Override
setMetricback to summary
public void setMetric(final String metricName, final Object obj)