metric

package
v0.0.0-...-d5de6aa Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Histogram

type Histogram struct {
	Key    string
	Values []HistogramValue
}

type HistogramValue

type HistogramValue struct {
	Value     float64
	CreatedAt time.Time
}

type IMetric

type IMetric interface {
	SetWatcher(Watcher) error
	SetRoutine(Routine) error

	InsertMetadata(Metric) error

	SetupWatcher(Watcher) error
	SetupRoutine(Routine) error

	UpdateWatcher(Watcher) error
	UpdateRoutine(Routine) error

	WatcherExists(id uuid.UUID) (bool, error)
	RoutineExists(id uuid.UUID) (bool, error)

	SetIndicator(uuid.UUID, Indicator) error
	SetHistogram(uuid.UUID, Histogram) error
}

type Indicator

type Indicator struct {
	Key       string
	Value     float64
	CreatedAt time.Time
}

type Log

type Log struct {
	Level     string
	Message   string
	Timestamp time.Time
}

type Metric

type Metric struct {
	Id         uuid.UUID
	StartedAt  time.Time
	FinishedAt time.Time
	Latency    time.Duration
	Watcher    Watcher
	Routine    Routine
	RoutineID  uuid.UUID
	Metadata   map[string]any
	Indicators []Indicator
	Histograms []Histogram
	Logs       []Log
}

type Routine

type Routine struct {
	Id           uuid.UUID
	WatcherID    uuid.UUID
	Name         string
	Desc         string
	Path         string
	RunAt        time.Time
	Interval     time.Duration
	LoadInterval time.Duration
	Start        int64
	End          int64
}

type Watcher

type Watcher struct {
	Id    uuid.UUID
	Name  string
	RunAt time.Time
}

Jump to

Keyboard shortcuts

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