Class SidecarTapPoller

java.lang.Object
ai.pipestream.module.pipelineprobe.pipelinecrawl.SidecarTapPoller

@ApplicationScoped public class SidecarTapPoller extends Object
Reads in-process tap counters and rich-observation snapshots for the orchestrator's poll loop. Pure CDI bean — no I/O, no network, no blocking. Wraps TransportTestCounter (always-on counts) and RichObservationCollector (opt-in latency / ring buffer / errors) so the orchestrator has one place to ask for "what's the state of this tap right now."

Used as the terminal poll when OPENSEARCH_SINK is NOT in the run's effective steps — the LAST main-flow step's tap is the visible terminal, and the orchestrator gates "done" on the tap's unique-doc count reaching the expected total.

  • Constructor Details

    • SidecarTapPoller

      public SidecarTapPoller()
      Creates the tap poller; its collaborators are injected and it is managed by CDI.
  • Method Details

    • uniqueCount

      public int uniqueCount(String accountId, String tapNodeId)
      Unique-doc count seen at one specific tap node for the given account. The tap node-ids are what PipelineGraphFactory stamps on the graph (e.g., "tap-chunker", "tap-opensearch-sink"), which the engine sets as pipe_step_name on every dispatch to that tap — and the TestProcessor keys the counter on it.
      Parameters:
      accountId - the account whose counters to read
      tapNodeId - the tap node-id to read the count for
      Returns:
      the number of distinct docs seen at that tap for the account
    • totalCount

      public int totalCount(String accountId, String tapNodeId)
      Total receipts (including duplicates) at one tap.
      Parameters:
      accountId - the account whose counters to read
      tapNodeId - the tap node-id to read the count for
      Returns:
      the total number of receipts (duplicates included) at that tap
    • richSnapshot

      public RichObservationCollector.Snapshot richSnapshot(String accountId, String tapNodeId)
      Rich snapshot for one observed tap, or null if no rich data has been collected yet (no docs received OR the tap isn't in rich-collection mode). Caller should treat null as "no panel data yet — render zeroes or a placeholder."
      Parameters:
      accountId - the account whose rich data to read
      tapNodeId - the tap node-id to read the snapshot for
      Returns:
      the rich snapshot for that tap, or null if none collected yet
    • resetAccount

      public void resetAccount(String accountId)
      Reset all per-account state across both collectors. Call at the start of a new run so prior runs' counters don't bleed into the new test.
      Parameters:
      accountId - the account whose state to clear in both collectors