series

package
v0.0.6-0...-77809e9 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Desc

Desc describes a metric

type Instance

type Instance struct {
	Instance string
	Name     string
	Labels   Labels
}

Instance holds information about a PCP instance

type Labels

type Labels map[string]interface{}

Labels structure for storing labels

type Series

type Series struct {
	MetricName string
	Desc       Desc
	Labels     Labels
	Instances  map[string]Instance
}

Series is a single time series with descriptor, labels and instances, but without values

type Service

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

Service retrieves and caches series

func NewSeriesService

func NewSeriesService(pmseriesAPI pmseries.API, cacheSize int) (*Service, error)

NewSeriesService creates a new resource service

func (*Service) GetSeries

func (s *Service) GetSeries(sids []string) (map[string]*Series, error)

GetSeries retrieves multiple series and caches them this will be called from different goroutines (each QueryData call runs in a new goroutine) let's keep it simple and stupid for now with a lock if this isn't sufficient anymore, a solution like https://notes.shichao.io/gopl/ch9/#example-concurrent-non-blocking-cache will be required - a concurrent non-blocking memoizing cache, where the memoize function processes multiple keys

func (*Service) RefreshInstances

func (s *Service) RefreshInstances(series *Series) error

RefreshInstances refreshes instances of a series

Jump to

Keyboard shortcuts

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