metrics

package
v2.4.17 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIMetrics

type APIMetrics struct {
	SuccessfulCounter map[string]prometheus.Counter
	FailedCounter     map[string]prometheus.Counter
	LastStart         map[string]prometheus.Gauge
	LastFinish        map[string]prometheus.Gauge
	LastDuration      map[string]prometheus.Gauge
	LastStatus        map[string]prometheus.Gauge

	LastBackupSizeLocal         prometheus.Gauge
	LastBackupSizeRemote        prometheus.Gauge
	NumberBackupsRemote         prometheus.Gauge
	NumberBackupsRemoteBroken   prometheus.Gauge
	NumberBackupsLocal          prometheus.Gauge
	NumberBackupsRemoteExpected prometheus.Gauge
	NumberBackupsLocalExpected  prometheus.Gauge

	SubCommands map[string][]string
	// contains filtered or unexported fields
}

func NewAPIMetrics

func NewAPIMetrics() *APIMetrics

func (*APIMetrics) ExecuteWithMetrics

func (m *APIMetrics) ExecuteWithMetrics(command string, errCounter int, f func() error) (error, int)

func (*APIMetrics) Failure

func (m *APIMetrics) Failure(command string)

func (*APIMetrics) Finish

func (m *APIMetrics) Finish(command string, startTime time.Time)

func (*APIMetrics) RegisterMetrics

func (m *APIMetrics) RegisterMetrics()

RegisterMetrics resister prometheus metrics and define allowed measured commands list

func (*APIMetrics) Start

func (m *APIMetrics) Start(command string, startTime time.Time)

func (*APIMetrics) Success

func (m *APIMetrics) Success(command string)

type APIMetricsInterface

type APIMetricsInterface interface {
	Start(command string, startTime time.Time)
	Finish(command string, startTime time.Time)
	Success(command string)
	Failure(command string)
	ExecuteWithMetrics(command string, errCounter int, f func() error) (error, int)
}

Jump to

Keyboard shortcuts

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