LemonRouter.RunCountTracker (lemon_router v0.1.0)

View Source

Tracks run lifecycle counters via telemetry for the RunOrchestrator.counts/0 API.

Attaches to:

  • [:lemon, :run, :submit] — increments queued on submission
  • [:lemon, :run, :start] — decrements queued, no-ops for active (DynamicSupervisor owns that)
  • [:lemon, :run, :stop] — increments completed_today

A midnight reset timer clears completed_today at the start of each UTC day.

Summary

Functions

Returns a specification to start this module under a supervisor.

Returns the number of runs completed since the last midnight UTC reset.

Returns the current queued count (submissions that have not yet started).

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

completed_today()

@spec completed_today() :: non_neg_integer()

Returns the number of runs completed since the last midnight UTC reset.

queued()

@spec queued() :: non_neg_integer()

Returns the current queued count (submissions that have not yet started).

start_link(opts \\ [])