public class StatisticCollector extends Object
StatisticCollector
counts Exchange
objects, tracks the time they took
to complete, the number of bytes they sent, and some more numbers.
Instances are not thread-safe.Constructor and Description |
---|
StatisticCollector(boolean countErrorExchanges) |
Modifier and Type | Method and Description |
---|---|
void |
collectFrom(AbstractExchange exc) |
void |
collectFrom(StatisticCollector s) |
String |
getAvgTime() |
String |
getBytesReceived() |
String |
getBytesSent() |
int |
getCount() |
String |
getErrorCount() |
int |
getGoodCount() |
String |
getMaxTime() |
String |
getMinTime() |
String |
toString() |
public StatisticCollector(boolean countErrorExchanges)
countErrorExchanges
- whether to count failed Exchange objects. Since
AbstractHttpHandler
counts Exchanges before their state is set to completed
(and AbstractExchange.getStatus()
still returns ExchangeState.FAILED
,
we need to be able to count them as successful (and track their statistics). On the
other hand MemoryExchangeStore
needs to count failures as failures,
and does not track their values.public void collectFrom(AbstractExchange exc)
public void collectFrom(StatisticCollector s)
public int getCount()
public int getGoodCount()
public String getMinTime()
public String getMaxTime()
public String getAvgTime()
public String getBytesSent()
public String getBytesReceived()
public String getErrorCount()
Copyright © 2012. All Rights Reserved.