flowstats

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package flowstats records bounded, pseudonymous user-flow transitions and explicit scenario journeys directly at the application middleware boundary. It is independent of the selected reverse proxy.

Index

Constants

View Source
const SectionName = "flow"

Variables

View Source
var (
	ErrForeignHandle  = errors.New("flowstats: foreign generation handle")
	ErrNotDrained     = errors.New("flowstats: generation was not drained")
	ErrHandleReleased = errors.New("flowstats: generation handle was released")
)
View Source
var Default = NewRegistry()

Functions

This section is empty.

Types

type Frozen

type Frozen struct{ Snapshot Snapshot }

type GenerationCollector

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

func NewGenerationCollector

func NewGenerationCollector(registry *Registry) *GenerationCollector

func (*GenerationCollector) BeginBoundary

func (c *GenerationCollector) BeginBoundary(ctx context.Context, runID string, epoch runctl.Epoch) (runctl.BoundaryResult, error)

func (*GenerationCollector) Collect

func (c *GenerationCollector) Collect(handle runctl.GenerationHandle) (any, error)

func (*GenerationCollector) Drain

func (*GenerationCollector) Freeze

func (*GenerationCollector) Name

func (c *GenerationCollector) Name() string

func (*GenerationCollector) Release

func (c *GenerationCollector) Release(handle runctl.GenerationHandle)

type Registry

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

func NewRegistry

func NewRegistry() *Registry

func NewRegistryWithOptions added in v1.7.0

func NewRegistryWithOptions(options flowviz.Options) (*Registry, error)

func (*Registry) Configure added in v1.7.0

func (r *Registry) Configure(options flowviz.Options) error

Configure replaces the empty/current generation with one using immutable visualization options. Startup wiring calls it before serving traffic.

func (*Registry) Observe

func (r *Registry) Observe(session, scenario, method, route string)

Observe receives only already-pseudonymized session labels, bounded scenario names, and registered route templates. Raw cookies and raw URL paths never enter this package.

func (*Registry) ObserveRequest added in v1.7.0

func (r *Registry) ObserveRequest(value sessionlabel.Observation)

func (*Registry) Reset

func (r *Registry) Reset()

func (*Registry) Snapshot

func (r *Registry) Snapshot() Snapshot

type Snapshot

type Snapshot struct {
	Stories       []accesslog.StoryEntry `json:"stories,omitempty"`
	StoryDropped  int64                  `json:"story_dropped,omitempty"`
	Flows         []accesslog.FlowEntry  `json:"flows,omitempty"`
	FlowDropped   int64                  `json:"flow_dropped,omitempty"`
	Visualization *flowviz.Snapshot      `json:"visualization,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL