Skip to content

Most visited

Recently visited

navigation

HttpConnectionMetricsImpl | Android Developers

to top
Android APIs
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

Added in API level 1

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

public static final String REQUEST_COUNT

Added in API level 1

Constant Value: "http.request-count"

public static final String RESPONSE_COUNT

Added in API level 1

Constant Value: "http.response-count"

public static final String SENT_BYTES_COUNT

Added in API level 1

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

Public Constructors

public HttpConnectionMetricsImpl (HttpTransportMetrics inTransportMetric, HttpTransportMetrics outTransportMetric)

Added in API level 1

Public Methods

public Object getMetric (String metricName)

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

Added in API level 1

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

public long getRequestCount ()

Added in API level 1

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

public long getResponseCount ()

Added in API level 1

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

public long getSentBytesCount ()

Added in API level 1

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

public void incrementRequestCount ()

Added in API level 1

public void incrementResponseCount ()

Added in API level 1

public void reset ()

Added in API level 1

Resets the counts

public void setMetric (String metricName, Object obj)

Added in API level 1

This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.