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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Event

func Event(ctx context.Context, in *Metric) (err error)

func Setup

func Setup(ctx context.Context, in *SetupIn)

Types

type Histogram

type Histogram struct {
	Key    string           `json:"key"`
	Values []HistogramValue `json:"values"`
}

type HistogramValue

type HistogramValue struct {
	Value     float64   `json:"value"`
	CreatedAt time.Time `json:"created_at"`
}

type Indicator

type Indicator struct {
	Key       string    `json:"key"`
	Value     float64   `json:"value"`
	CreatedAt time.Time `json:"created_at"`
}

type Log

type Log struct {
	Level     string    `json:"level"`
	Message   string    `json:"message"`
	Timestamp time.Time `json:"timestamp"`
}

type Metric

type Metric struct {
	Id         uuid.UUID      `json:"id"`
	StartedAt  time.Time      `json:"started_at"`
	FinishedAt time.Time      `json:"finished_at"`
	Latency    time.Duration  `json:"latency"`
	Watcher    Watcher        `json:"watcher"`
	Routine    Routine        `json:"routine"`
	Metadata   map[string]any `json:"metadata"`
	Indicators []Indicator    `json:"indicators"`
	Histograms []Histogram    `json:"histograms"`
	Logs       []Log          `json:"logs"`
}

type Routine

type Routine struct {
	Id           uuid.UUID     `json:"routine_id"`
	WatcherID    uuid.UUID     `json:"-"`
	Name         string        `json:"name"`
	Desc         string        `json:"desc"`
	Path         string        `json:"path"`
	RunAt        time.Time     `json:"run_at"`
	Interval     time.Duration `json:"interval"`
	LoadInterval time.Duration `json:"load_interval"`
	Start        int64         `json:"start"`
	End          int64         `json:"end"`
}

type SetupIn

type SetupIn struct {
	Watcher Watcher `json:"watcher"`
	Routine Routine `json:"routine"`
}

type Watcher

type Watcher struct {
	Id    uuid.UUID `json:"id"`
	Name  string    `json:"name"`
	RunAt time.Time `json:"run_at"`
}

Jump to

Keyboard shortcuts

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