s3-orchestrator

debug

import "github.com/afreidah/s3-orchestrator/internal/debug"

Package debug houses opt-in diagnostic services wired by DI when the matching config block is enabled.

Index

type FlightRecorderService

FlightRecorderService adapts *trace.FlightRecorder to lifecycle.Runner and lifecycle.Stopper so the supervisor owns its start/stop and the admin handler can hold the recorder for snapshot reads.

type FlightRecorderService struct {
    // contains filtered or unexported fields
}

func NewFlightRecorderService

func NewFlightRecorderService(minAge time.Duration) *FlightRecorderService

NewFlightRecorderService constructs a service around a FlightRecorder configured with the given minimum window age. The recorder is not started here; Run starts it so a registration-time failure (another recorder already active) surfaces through the supervisor.

func (*FlightRecorderService) Recorder

func (s *FlightRecorderService) Recorder() *trace.FlightRecorder

Recorder returns the underlying *trace.FlightRecorder for the admin snapshot handler to call WriteTo on. Nil-safe so the admin handler can receive a nil service when the feature is disabled and check before use.

func (*FlightRecorderService) Run

func (s *FlightRecorderService) Run(ctx context.Context) error

Run starts the recorder and blocks until ctx is cancelled. A Start failure (only happens if another recorder is already active in-process) is returned so the supervisor logs it instead of silently no-op’ing.

func (*FlightRecorderService) Stop

func (s *FlightRecorderService) Stop(_ context.Context) error

Stop ends recording so the ring buffer can be GC’d. Idempotent: calling Stop on a recorder that never started or already stopped is safe.

Generated by gomarkdoc