service

package
v0.0.0-...-c16b6a5 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attributes

type Attributes struct {
	TypesByKey map[string][]string `json:"typesByKey"`
}

type Duration

type Duration struct {
	Quantile05  float64 `json:"q0_5"`
	Quantile075 float64 `json:"q0_75"`
	Quantile095 float64 `json:"q0_95"`
	Quantile099 float64 `json:"q0_99"`
}

type NumberHistory

type NumberHistory struct {
	Current float64    `json:"current"`
	Past    NumberPast `json:"past"`
}

type NumberPast

type NumberPast struct {
	Hour  float64 `json:"hour"`
	Day   float64 `json:"day"`
	Month float64 `json:"month"`
}

type RateAverage

type RateAverage struct {
	Min5  float64 `json:"min5"`
	Hour  float64 `json:"hour"`
	Day   float64 `json:"day"`
	Month float64 `json:"month"`
}

type ReadStatus

type ReadStatus struct {
	ReadRate        RateAverage            `json:"readRate"`
	SourcesMostRead map[string]RateAverage `json:"sourcesMostRead"`
}

type Service

type Service interface {
	GetRateAverage(ctx context.Context, metricName string, sumBy string) (rate RateAverage, errs error)
	GetNumberHistory(ctx context.Context, metricName string) (nh NumberHistory, errs error)
	GetRelativeRateByLabel(ctx context.Context, rateSum RateAverage, metricName string, key string) (rateByKey map[string]RateAverage, errs error)
	GetEventAttributeTypes(ctx context.Context, metric, sumBy, period string) (attrs Attributes, err error)
	GetEventAttributeValuesByName(ctx context.Context, name string) (vals []string, err error)
	GetDuration(ctx context.Context, metricName string, quantile float64, t time.Duration) (dSeconds float64, errs error)
}

func NewLogging

func NewLogging(svc Service, log *slog.Logger) Service

func NewService

func NewService(apiProm apiPromV1.API) Service

Jump to

Keyboard shortcuts

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