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

Since: API Level 1

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

public static final String REQUEST_COUNT

Since: API Level 1

Constant Value: "http.request-count"

public static final String RESPONSE_COUNT

Since: API Level 1

Constant Value: "http.response-count"

public static final String SENT_BYTES_COUNT

Since: API Level 1

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

Public Constructors

public HttpConnectionMetricsImpl (HttpTransportMetrics inTransportMetric, HttpTransportMetrics outTransportMetric)

Since: API Level 1

Public Methods

public Object getMetric (String metricName)

Since: API Level 1

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 ()

Since: API Level 1

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

public long getRequestCount ()

Since: API Level 1

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

public long getResponseCount ()

Since: API Level 1

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

public long getSentBytesCount ()

Since: API Level 1

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

public void incrementRequestCount ()

Since: API Level 1

public void incrementResponseCount ()

Since: API Level 1

public void reset ()

Since: API Level 1

Resets the counts

public void setMetric (String metricName, Object obj)

Since: API Level 1