memory

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricSource

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

MetricSource implements regression.MetricSource by computing WindowMetrics from gateway in-memory stores.

func NewMetricSource

func NewMetricSource(log *gateway.RequestLog, trace *gateway.TraceStore) *MetricSource

NewMetricSource creates a MetricSource backed by the given gateway stores.

func (*MetricSource) FleetWindowMetrics

func (m *MetricSource) FleetWindowMetrics(_ context.Context, service string, window regression.TimeWindow) (*regression.WindowMetrics, error)

FleetWindowMetrics computes metrics for all actions of a service within the given time window.

func (*MetricSource) ListServices

func (m *MetricSource) ListServices(_ context.Context) ([]string, error)

ListServices returns unique service names from recent requests.

func (*MetricSource) ListTenants

func (m *MetricSource) ListTenants(_ context.Context, service string) ([]string, error)

ListTenants returns unique tenant IDs for a service from request headers.

func (*MetricSource) TenantWindowMetrics

func (m *MetricSource) TenantWindowMetrics(_ context.Context, service, tenantID string, window regression.TimeWindow) (*regression.WindowMetrics, error)

TenantWindowMetrics computes metrics for a service+tenant within the given time window.

func (*MetricSource) WindowMetrics

func (m *MetricSource) WindowMetrics(_ context.Context, service, action string, window regression.TimeWindow) (*regression.WindowMetrics, error)

WindowMetrics computes metrics for a service+action within the given time window.

type Store

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

Store implements regression.RegressionStore using a mutex-protected slice.

func NewStore

func NewStore() *Store

NewStore creates a new in-memory regression store.

func (*Store) ActiveForDeploy

func (s *Store) ActiveForDeploy(_ context.Context, deployID string) ([]regression.Regression, error)

ActiveForDeploy returns all active regressions for the given deploy ID, newest first.

func (*Store) Get

Get returns the regression with the given ID, or ErrNotFound.

func (*Store) List

List returns regressions matching the filter, newest first.

func (*Store) Save

Save generates an ID, sets DetectedAt if zero, and appends the regression.

func (*Store) UpdateStatus

func (s *Store) UpdateStatus(_ context.Context, id string, status string) error

UpdateStatus updates the status of the regression with the given ID. If the new status is "resolved" or "dismissed", ResolvedAt is set to now.

Jump to

Keyboard shortcuts

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