Skip to main content

Module effect_system

Module effect_system 

Source
Expand description

Effect system observability and Cx-aware execution helpers.

This module provides:

  • Cx-aware task execution: [run_task_with_cx] wraps a closure with a [Cx] context for cooperative cancellation and deadline enforcement.
  • Tracing spans: effect.command and effect.subscription spans with structured fields for observability dashboards.
  • Metrics counters: effects_executed_total (by type) and effect_duration_us histogram approximation.

§bd-37a.6: Command/Subscription effect system with Cx capability threading

Structs§

QueueTelemetry
Snapshot of queue telemetry for operator dashboards.
RuntimeDynamics
Snapshot of runtime dynamics for operator dashboards and performance analysis.

Functions§

effects_command_total
Total command effects executed (monotonic counter).
effects_executed_total
Combined total of all effects executed.
effects_queue_dropped
Total tasks dropped due to backpressure or shutdown (monotonic counter).
effects_queue_enqueued
Total tasks enqueued to the effect queue (monotonic counter).
effects_queue_high_water
High-water mark: maximum queue depth observed (ratchet — only increases).
effects_queue_processed
Total tasks processed by the effect queue (monotonic counter).
effects_subscription_total
Total subscription effects started (monotonic counter).
error_effect_panic
Record an effect panic error.
queue_telemetry
Snapshot the current queue telemetry counters.
reconcile_count
Total reconcile operations (monotonic counter).
reconcile_duration_us_total
Cumulative reconcile duration in microseconds.
record_command_effect
Record a command effect execution without wrapping (for inline instrumentation).
record_dynamics_reconcile
Record a reconcile operation with its duration.
record_dynamics_shutdown
Record a shutdown completion with its duration and timeout count.
record_dynamics_sub_panic
Record a subscription panic event.
record_dynamics_sub_start
Record a subscription start event.
record_dynamics_sub_stop
Record a subscription stop event.
record_queue_drop
Record a task dropped due to backpressure or shutdown.
record_queue_enqueue
Record a task enqueue, updating counters and high-water mark.
record_queue_processed
Record a task processed by the effect queue.
record_subscription_start
Record a subscription lifecycle event.
record_subscription_stop
Record a subscription stop event.
runtime_dynamics
Snapshot the current runtime dynamics counters.
shutdown_duration_us_last
Most recent shutdown duration in microseconds (0 = no shutdown yet).
shutdown_timed_out_total
Total subscription join timeouts during shutdown (monotonic counter).
subscription_panics_total
Total subscription panics caught (monotonic counter).
subscription_starts_total
Total subscription starts (monotonic counter).
subscription_stops_total
Total subscription stops (monotonic counter).
trace_command_effect
Execute a command effect with tracing instrumentation.
warn_effect_timeout
Record an effect timeout warning.