Class ExecutionStats

java.lang.Object
com.wualabs.qtsurfer.engine.strategy.execution.ExecutionStats

public final class ExecutionStats extends Object
Counts what an execution pipeline did, per strategy.

The pipeline's outcomes were previously observable only by implementing ExecutionCallback — that is, only by the strategy whose run it is. Nothing outside could tell a strategy that fills every order from one that partial-fills half of them and quietly reissues the remainder, because both look identical in yield. These counters make that difference visible from the outside without a strategy having to cooperate.

Deliberately plain: AtomicLongs and getters, no metrics library. The engine ships no meter registry, so anything that wants to chart these binds them from outside (see the qtsurfer-engine-metrics module). That also keeps the cost here to one atomic increment on a path that has just finished talking to an exchange over the network.

Live and backtest pipelines share this, since BacktestStrategyExecutorManager extends the live manager — a backtest's fill and failure mix is worth the same scrutiny as a live one.

  • Constructor Details

    • ExecutionStats

      public ExecutionStats()
  • Method Details

    • getFilledBuys

      public long getFilledBuys()
      Buy orders that filled completely.
    • getFilledSells

      public long getFilledSells()
      Sell orders that filled completely.
    • getPartialBuys

      public long getPartialBuys()
      Buy orders that filled only in part.
    • getPartialSells

      public long getPartialSells()
      Sell orders that filled only in part.
    • getFailedBuys

      public long getFailedBuys()
      Buy orders that traded nothing.
    • getFailedSells

      public long getFailedSells()
      Sell orders that traded nothing.
    • getCompletedCycles

      public long getCompletedCycles()
      Enter-to-exit cycles closed with a realised yield.
    • getFillDurationCount

      public long getFillDurationCount()
      How many fill durations have been measured — the count half of a mean, paired with getFillDurationTotalNanos().
    • getFillDurationTotalNanos

      public long getFillDurationTotalNanos()
      Summed fill duration in nanoseconds. Divided by getFillDurationCount() this is the mean time an order took to complete; the two are kept separate so a consumer can compute the mean over any window rather than being handed one average since startup.
    • getFillDurationMaxNanos

      public long getFillDurationMaxNanos()
      Longest single fill duration observed, in nanoseconds; the outlier a mean hides.
    • toString

      public String toString()
      Overrides:
      toString in class Object