meters

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2021 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Meters = services.MeterDefinitions{
	"redis": services.MeterDefinition{
		Name:              "Redis Meter Database",
		Description:       "For Production Use",
		Maker:             MakeRedis,
		SettingsValidator: databases.ValidateRedisSettings,
	},
	"redis-shard": services.MeterDefinition{
		Name:              "Redis Sharded Meter Database",
		Description:       "For Production Use",
		Maker:             MakeRedisShards,
		SettingsValidator: databases.ValidateRedisShardSettings,
	},
}

Functions

func MakeRedis

func MakeRedis(settings interface{}) (services.Meter, error)

func MakeRedisShards added in v0.0.4

func MakeRedisShards(settings interface{}) (services.Meter, error)

Types

type ByNameAndWindow

type ByNameAndWindow []*services.Metric

func (ByNameAndWindow) Len

func (b ByNameAndWindow) Len() int

func (ByNameAndWindow) Less

func (b ByNameAndWindow) Less(i, j int) bool

func (ByNameAndWindow) Swap

func (b ByNameAndWindow) Swap(i, j int)

type Redis

type Redis struct {
	*databases.Redis
}

func (*Redis) Add

func (r *Redis) Add(id string, name string, data map[string]string, tw services.TimeWindow, value int64) error

func (*Redis) AddMax

func (r *Redis) AddMax(id string, name string, uid string, data map[string]string, tw services.TimeWindow, value int64) error

Adds the maximum value from a given UID to a given statistic

func (*Redis) AddOnce

func (r *Redis) AddOnce(id string, name string, uid string, data map[string]string, tw services.TimeWindow, value int64) error

Adds a value from a UID to the statistic, but only once

func (*Redis) Get

func (r *Redis) Get(id string, name string, data map[string]string, tw services.TimeWindow) (*services.Metric, error)

func (*Redis) GetByTimeIds

func (r *Redis) GetByTimeIds(id string, from, to int64, tId, maxTId int64, name, twType string) ([]*services.Metric, error)

func (*Redis) N

func (r *Redis) N(id string, to, n int64, name, twType string) ([]*services.Metric, error)

func (*Redis) Range

func (r *Redis) Range(id string, from, to int64, name, twType string) ([]*services.Metric, error)

Jump to

Keyboard shortcuts

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