Skip to content

src/dazzle_back/pra/consumers.py

Generated: 2026-03-30T04:38:46.492119+00:00

Commit: 615f1354a103

Language: python

Scope: dazzle_back

Purpose

Test consumers for PRA stress testing.

Provides configurable consumers that simulate various processing behaviors: - Normal: Process events at full speed - Slow: Introduce artificial latency (backpressure testing) - Failing: Randomly fail events (DLQ testing)

Key Exports

  • ConsumerStats
  • TestConsumer
  • NormalConsumer
  • SlowConsumer
  • FailingConsumer
  • ProjectionConsumer
  • DerivationConsumer
  • ConsumerGroup
  • create_backpressure_test_consumers
  • create_dlq_test_consumers
  • create_projection_test_consumers
  • create_full_test_consumers
  • avg_processing_ms
  • stats
  • process
  • projections
  • sequence
  • rebuild_time_ms
  • start_rebuild
  • complete_rebuild

Dependencies

Imports

  • __future__.annotations
  • asyncio
  • logging
  • random
  • time
  • abc.ABC
  • abc.abstractmethod
  • collections.abc.Callable
  • dataclasses.dataclass
  • dataclasses.field
  • datetime.UTC
  • datetime.datetime
  • typing.Any
  • dazzle_back.events.envelope.EventEnvelope
  • dazzle_back.metrics.MetricsCollector

Event Interactions

None detected.

Invariants and Assumptions

  • Validates: Permanent failure for event {envelope.event_id}

Tests

  • tests/unit/test_pra_cli.py
  • tests/unit/test_pra_harness.py
  • tests/unit/test_pra_metrics.py
  • tests/unit/test_pra_load_generator.py

Notes

This page was automatically generated by tools/gen_reference_docs.py.