anomaly

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package anomaly provides cost anomaly detection

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Anomaly

type Anomaly struct {
	Type        string
	Description string
	Severity    string
	DetectedAt  time.Time
	Value       float64
	Expected    float64
	Deviation   float64
}

Anomaly represents a detected anomaly

type AnomalyReport

type AnomalyReport struct {
	TotalAnomalies int
	BySeverity     map[string]int
	ByType         map[string]int
	Anomalies      []Anomaly
	Summary        string
}

AnomalyReport represents a report of detected anomalies

func GenerateReport

func GenerateReport(anomalies []Anomaly) *AnomalyReport

GenerateReport generates an anomaly report

type DataPoint

type DataPoint struct {
	Timestamp time.Time
	Value     float64
}

DataPoint represents a cost data point

type Detector

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

Detector detects cost anomalies

func NewDetector

func NewDetector(threshold float64, window time.Duration) *Detector

NewDetector creates a new anomaly detector

func (*Detector) Detect

func (d *Detector) Detect(data []DataPoint) []Anomaly

Detect detects anomalies in cost data

func (*Detector) DetectSuddenChange

func (d *Detector) DetectSuddenChange(data []DataPoint) []Anomaly

DetectSuddenChange detects sudden changes in cost

func (*Detector) DetectTrendChange

func (d *Detector) DetectTrendChange(data []DataPoint) []Anomaly

DetectTrendChange detects changes in cost trend

Jump to

Keyboard shortcuts

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