mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-18 07:56:56 +00:00
36 lines
776 B
Go
36 lines
776 B
Go
|
|
package anomaly
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
|
||
|
|
"github.com/SigNoz/signoz/pkg/valuer"
|
||
|
|
)
|
||
|
|
|
||
|
|
type HourlyProvider struct {
|
||
|
|
BaseSeasonalProvider
|
||
|
|
}
|
||
|
|
|
||
|
|
var _ BaseProvider = (*HourlyProvider)(nil)
|
||
|
|
|
||
|
|
func (hp *HourlyProvider) GetBaseSeasonalProvider() *BaseSeasonalProvider {
|
||
|
|
return &hp.BaseSeasonalProvider
|
||
|
|
}
|
||
|
|
|
||
|
|
// NewHourlyProvider now uses the generic option type
|
||
|
|
func NewHourlyProvider(opts ...GenericProviderOption[*HourlyProvider]) *HourlyProvider {
|
||
|
|
hp := &HourlyProvider{
|
||
|
|
BaseSeasonalProvider: BaseSeasonalProvider{},
|
||
|
|
}
|
||
|
|
|
||
|
|
for _, opt := range opts {
|
||
|
|
opt(hp)
|
||
|
|
}
|
||
|
|
|
||
|
|
return hp
|
||
|
|
}
|
||
|
|
|
||
|
|
func (p *HourlyProvider) GetAnomalies(ctx context.Context, orgID valuer.UUID, req *AnomaliesRequest) (*AnomaliesResponse, error) {
|
||
|
|
req.Seasonality = SeasonalityHourly
|
||
|
|
return p.getAnomalies(ctx, orgID, req)
|
||
|
|
}
|