Class StatisticCollector

java.lang.Object
com.predic8.membrane.core.rules.StatisticCollector

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 Details

    • StatisticCollector

      public StatisticCollector(boolean countErrorExchanges)
      Parameters:
      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.
  • Method Details

    • collectFrom

      public void collectFrom(AbstractExchange exc)
    • collectFrom

      public void collectFrom(StatisticCollector s)
    • getCount

      public int getCount()
    • getGoodCount

      public int getGoodCount()
    • getMinTime

      public String getMinTime()
    • getMaxTime

      public String getMaxTime()
    • getAvgTime

      public String getAvgTime()
    • getGoodTotalTime

      public long getGoodTotalTime()
    • getGoodTotalBytesReceived

      public long getGoodTotalBytesReceived()
    • getGoodTotalBytesSent

      public long getGoodTotalBytesSent()
    • getBytesSent

      public String getBytesSent()
    • getBytesReceived

      public String getBytesReceived()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getErrorCount

      public String getErrorCount()