Documentation
¶
Index ¶
- type MetricSource
- func (m *MetricSource) FleetWindowMetrics(_ context.Context, service string, window regression.TimeWindow) (*regression.WindowMetrics, error)
- func (m *MetricSource) ListServices(_ context.Context) ([]string, error)
- func (m *MetricSource) ListTenants(_ context.Context, service string) ([]string, error)
- func (m *MetricSource) TenantWindowMetrics(_ context.Context, service, tenantID string, window regression.TimeWindow) (*regression.WindowMetrics, error)
- func (m *MetricSource) WindowMetrics(_ context.Context, service, action string, window regression.TimeWindow) (*regression.WindowMetrics, error)
- type Store
- func (s *Store) ActiveForDeploy(_ context.Context, deployID string) ([]regression.Regression, error)
- func (s *Store) Get(_ context.Context, id string) (*regression.Regression, error)
- func (s *Store) List(_ context.Context, filter regression.RegressionFilter) ([]regression.Regression, error)
- func (s *Store) Save(_ context.Context, r *regression.Regression) error
- func (s *Store) UpdateStatus(_ context.Context, id string, status string) error
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 ¶
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 (*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 ¶
func (s *Store) Get(_ context.Context, id string) (*regression.Regression, error)
Get returns the regression with the given ID, or ErrNotFound.
func (*Store) List ¶
func (s *Store) List(_ context.Context, filter regression.RegressionFilter) ([]regression.Regression, error)
List returns regressions matching the filter, newest first.
func (*Store) Save ¶
func (s *Store) Save(_ context.Context, r *regression.Regression) error
Save generates an ID, sets DetectedAt if zero, and appends the regression.