org.apache.http.impl
Class HttpConnectionMetricsImpl

java.lang.Object
  extended by org.apache.http.impl.HttpConnectionMetricsImpl
All Implemented Interfaces:
HttpConnectionMetrics

public class HttpConnectionMetricsImpl
extends Object
implements HttpConnectionMetrics

Default implementation of the HttpConnectionMetrics interface.

Since:
4.0

Field Summary
static String RECEIVED_BYTES_COUNT
           
static String REQUEST_COUNT
           
static String RESPONSE_COUNT
           
static String SENT_BYTES_COUNT
           
 
Constructor Summary
HttpConnectionMetricsImpl(HttpTransportMetrics inTransportMetric, HttpTransportMetrics outTransportMetric)
           
 
Method Summary
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REQUEST_COUNT

public static final String REQUEST_COUNT
See Also:
Constant Field Values

RESPONSE_COUNT

public static final String RESPONSE_COUNT
See Also:
Constant Field Values

SENT_BYTES_COUNT

public static final String SENT_BYTES_COUNT
See Also:
Constant Field Values

RECEIVED_BYTES_COUNT

public static final String RECEIVED_BYTES_COUNT
See Also:
Constant Field Values
Constructor Detail

HttpConnectionMetricsImpl

public HttpConnectionMetricsImpl(HttpTransportMetrics inTransportMetric,
                                 HttpTransportMetrics outTransportMetric)
Method Detail

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 interface HttpConnectionMetrics

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 interface HttpConnectionMetrics

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 interface HttpConnectionMetrics

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 interface HttpConnectionMetrics

incrementResponseCount

public void incrementResponseCount()

getMetric

public Object getMetric(String metricName)
Description copied from interface: HttpConnectionMetrics
Return the value for the specified metric.

Specified by:
getMetric in interface HttpConnectionMetrics
Parameters:
metricName - the name of the metric to query.
Returns:
the object representing the metric requested, null if the metric cannot not found.

setMetric

public void setMetric(String metricName,
                      Object obj)

reset

public void reset()
Description copied from interface: HttpConnectionMetrics
Resets the counts

Specified by:
reset in interface HttpConnectionMetrics


Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.