centralizedmetrics

package
v0.184.53 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricRepository

type MetricRepository interface {
	Poll() ([]common.Metric, error)
	Delete(metrics []common.Metric) error
	Add(metric common.Metric) error
	Info() (*MetricsInfo, error)
	ToggleEnabled(isEnabled bool) error
}

type MetricService

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

func NewDefaultMetricService

func NewDefaultMetricService(db *sql.DB) *MetricService

func NewMetricService

func NewMetricService(repository MetricRepository, processor common.MetricProcessor, interval time.Duration) *MetricService

func (*MetricService) AddMetric

func (s *MetricService) AddMetric(metric common.Metric) error

func (*MetricService) EnsureStarted

func (s *MetricService) EnsureStarted() error

func (*MetricService) Info

func (s *MetricService) Info() (*MetricsInfo, error)

func (*MetricService) Start

func (s *MetricService) Start()

func (*MetricService) Stop

func (s *MetricService) Stop()

func (*MetricService) ToggleEnabled

func (s *MetricService) ToggleEnabled(isEnabled bool) error

type MetricsInfo

type MetricsInfo struct {
	Enabled       bool `json:"enabled"`
	UserConfirmed bool `json:"userConfirmed"`
}

type SQLiteMetricRepository

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

func NewSQLiteMetricRepository

func NewSQLiteMetricRepository(db *sql.DB) *SQLiteMetricRepository

func (*SQLiteMetricRepository) Add

func (r *SQLiteMetricRepository) Add(metric common.Metric) error

func (*SQLiteMetricRepository) Delete

func (r *SQLiteMetricRepository) Delete(metrics []common.Metric) error

func (*SQLiteMetricRepository) Info

func (*SQLiteMetricRepository) Poll

func (r *SQLiteMetricRepository) Poll() ([]common.Metric, error)

func (*SQLiteMetricRepository) ToggleEnabled

func (r *SQLiteMetricRepository) ToggleEnabled(enabled bool) error

func (*SQLiteMetricRepository) UserID

func (r *SQLiteMetricRepository) UserID(tx *sql.Tx) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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