Methods Summary |
---|
public java.lang.Object | getMetric(java.lang.String metricName)
Object value = null;
if (this.metricsCache != null) {
value = this.metricsCache.get(metricName);
}
if (value == null) {
if (REQUEST_COUNT.equals(metricName)) {
value = new Long(requestCount);
} else if (RESPONSE_COUNT.equals(metricName)) {
value = new Long(responseCount);
} else if (RECEIVED_BYTES_COUNT.equals(metricName)) {
if (this.inTransportMetric != null) {
return new Long(this.inTransportMetric.getBytesTransferred());
} else {
return null;
}
} else if (SENT_BYTES_COUNT.equals(metricName)) {
if (this.outTransportMetric != null) {
return new Long(this.outTransportMetric.getBytesTransferred());
} else {
return null;
}
}
}
return value;
|
public long | getReceivedBytesCount()
if (this.inTransportMetric != null) {
return this.inTransportMetric.getBytesTransferred();
} else {
return -1;
}
|
public long | getRequestCount()
return this.requestCount;
|
public long | getResponseCount()
return this.responseCount;
|
public long | getSentBytesCount()
if (this.outTransportMetric != null) {
return this.outTransportMetric.getBytesTransferred();
} else {
return -1;
}
|
public void | incrementRequestCount()
this.requestCount++;
|
public void | incrementResponseCount()
this.responseCount++;
|
public void | reset()
if (this.outTransportMetric != null) {
this.outTransportMetric.reset();
}
if (this.inTransportMetric != null) {
this.inTransportMetric.reset();
}
this.requestCount = 0;
this.responseCount = 0;
this.metricsCache = null;
|
public void | setMetric(java.lang.String metricName, java.lang.Object obj)
if (this.metricsCache == null) {
this.metricsCache = new HashMap();
}
this.metricsCache.put(metricName, obj);
|