Class MockWorkStats

java.lang.Object
ai.pipestream.module.pipelineprobe.mockengine.MockWorkStats

@ApplicationScoped public class MockWorkStats extends Object
Accumulates what the module-under-test did with the served work: how many units it acked, by ProcessingStatus (SUCCESS / RETRYABLE / PERMANENT) and by result disposition (UPDATED_PAYLOAD / NO_OP / REJECT), plus a wall-clock throughput between the first served unit and the last ack. This is what the GET /mock-engine/stats endpoint reports so a test can assert the work queue drained cleanly.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CDI.
  • Method Summary

    Modifier and Type
    Method
    Description
    Builds a snapshot of the accumulated stats: served and acked counts, pending count, per-status and per-disposition tallies, the elapsed wall-clock seconds between the first served unit and the last ack, and the resulting acks-per-second throughput.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MockWorkStats

      public MockWorkStats()
      CDI.
  • Method Details

    • snapshot

      public Map<String,Object> snapshot()
      Builds a snapshot of the accumulated stats: served and acked counts, pending count, per-status and per-disposition tallies, the elapsed wall-clock seconds between the first served unit and the last ack, and the resulting acks-per-second throughput.
      Returns:
      a JSON-friendly snapshot of the run so far.