public class

HttpConnectionMetricsImpl

extends Object
implements HttpConnectionMetrics
java.lang.Object
   ↳ org.apache.http.impl.HttpConnectionMetricsImpl

Class Overview

Implementation of the metrics interface.

Summary

Constants
String RECEIVED_BYTES_COUNT
String REQUEST_COUNT
String RESPONSE_COUNT
String SENT_BYTES_COUNT
Public Constructors
HttpConnectionMetricsImpl(HttpTransportMetrics inTransportMetric, HttpTransportMetrics outTransportMetric)
Public Methods
Object getMetric(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 counts
void setMetric(String metricName, Object obj)
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.http.HttpConnectionMetrics

Constants

public static final String RECEIVED_BYTES_COUNT

Constant Value: "http.received-bytes-count"

public static final String REQUEST_COUNT

Constant Value: "http.request-count"

public static final String RESPONSE_COUNT

Constant Value: "http.response-count"

public static final String SENT_BYTES_COUNT

Constant Value: "http.sent-bytes-count"

Public Constructors

public HttpConnectionMetricsImpl (HttpTransportMetrics inTransportMetric, HttpTransportMetrics outTransportMetric)

Public Methods

public Object getMetric (String metricName)

Return the value for the specified metric.

Parameters
metricName the name of the metric to query.
Returns
  • the object representing the metric requested, null if the metric cannot not found.

public long getReceivedBytesCount ()

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

public long getRequestCount ()

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

public long getResponseCount ()

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

public long getSentBytesCount ()

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

public void incrementRequestCount ()

public void incrementResponseCount ()

public void reset ()

Resets the counts

public void setMetric (String metricName, Object obj)