aggregator

package
v0.0.0-...-65429f0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregator

type Aggregator interface {
	CollectHistogram(histogramAggregator MetricAggregatorDTO) (interface{}, error)
}

func New

func New(input Input) (Aggregator, error)

type Collector

type Collector interface {
	Collect(*Entity, float64)
}

type Entity

type Entity struct {
	ID                string    `json:"id"`
	Name              string    `json:"name"`
	Help              string    `json:"help"`
	CreatedAt         time.Time `json:"created_at"`
	UpdateAt          time.Time `json:"update_at"`
	Stages            []Stage   `json:"stages"`
	State             string    `json:"state"`
	TimeToLiveSeconds int       `json:"time_to_live"`
}

func (*Entity) AddStage

func (e *Entity) AddStage(stage Stage)

func (*Entity) Close

func (e *Entity) Close()

func (*Entity) InProgress

func (e *Entity) InProgress() bool

func (*Entity) LabelValues

func (e *Entity) LabelValues() map[string]string

func (*Entity) LastLifeSpan

func (e *Entity) LastLifeSpan() int

type Input

type Input struct {
	Repository Repository `validate:"required"`
	Collector  Collector  `validate:"required"`
}

type Labels

type Labels map[string]string

type Meter

type Meter interface {
	Registry(duration float64)
}

type MetricAggregatorDTO

type MetricAggregatorDTO struct {
	ID                  string            `json:"id"`
	LifeSpan            int               `json:"life_span"`
	CreatedAt           time.Time         `json:"created_at"`
	Name                string            `json:"name"`
	Help                string            `json:"help"`
	ConstLabels         Labels            `json:"const_labels"`
	Buckets             []float64         `json:"buckets"`
	Stage               string            `json:"stage"`
	LabelValues         map[string]string `json:"label_values"`
	ForceRegistryUpdate bool              `json:"force_registry_update"`
	TimeToLiveSeconds   int               `json:"time_to_live"`
}

type Repository

type Repository interface {
	RepositoryReader
	RepositoryWriter
}

Repository is a interface for read 'n write application

type RepositoryReader

type RepositoryReader interface {
	Find(string) (*Entity, error)
}

RepositoryReader is a interface for read application

type RepositoryWriter

type RepositoryWriter interface {
	Insert(Entity) (*Entity, error)
	Delete(string) error
	Update(Entity) (*Entity, error)
}

RepositoryWriter is a interface for write application

type Stage

type Stage struct {
	Stage       string    `json:"stage"`
	CreatedAt   time.Time `json:"created_at"`
	LifeSpan    int       `json:"life_span"`
	LabelValues map[string]string
}

func (*Stage) Equal

func (e *Stage) Equal(target Stage) bool

Jump to

Keyboard shortcuts

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