timescale

package
v0.1.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package timescale implements the timescale metrics exporter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter

type Exporter struct {
	// contains filtered or unexported fields
}

Exporter for exporting metrics to timescale db.

func (*Exporter) Export

func (e *Exporter) Export(ctx context.Context, metrics []checker.Metric) error

Export exports the metrics to the exporter.

func (*Exporter) GetMetrics

func (e *Exporter) GetMetrics(
	ctx context.Context,
	time time.Duration,
	checkIDs ...string,
) (map[string][]checker.Metric, error)

GetMetrics get the metrics of the given checks.

func (*Exporter) Provision

func (e *Exporter) Provision(ctx *appcontext.Context, provider exporter.Provider) error

Provision sets e's configuration.

type Metric

type Metric struct {
	CheckID   string
	CheckName string

	StartTime time.Time     `gorm:"NOT NULL"`
	Duration  time.Duration `gorm:"NOT NULL"`
	Timeout   bool          `gorm:"NOT NULL"`
	Success   bool          `gorm:"NOT NULL"`
}

Metric model.

func (Metric) GetCheckID

func (m Metric) GetCheckID() string

GetCheckID returns the check ID.

func (Metric) GetCheckName

func (m Metric) GetCheckName() string

GetCheckName returns the check name.

func (Metric) GetDuration

func (m Metric) GetDuration() time.Duration

GetDuration returns the duration.

func (Metric) GetStartTime

func (m Metric) GetStartTime() time.Time

GetStartTime returns the start time.

func (Metric) IsSuccessful

func (m Metric) IsSuccessful() bool

IsSuccessful tells if the check was successful.

func (Metric) IsTimeout

func (m Metric) IsTimeout() bool

IsTimeout tells if the check timed out.

Jump to

Keyboard shortcuts

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