strategy

package
v0.11.0-beta Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package strategy provides basic interfaces for routing to availble plugins and caching metric data.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCacheEntryDoesNotExist = errors.New("cache entry does not exist")
)
View Source
var (
	ErrorCouldNotSelect = errors.New("could not select a plugin (round robin strategy)")
)
View Source
var GlobalCacheExpiration time.Duration

GlobalCacheExpiration the default time limit for which a cache entry is valid. A plugin can override the GlobalCacheExpiration (default).

Functions

func NewCache

func NewCache(expiration time.Duration) *cache

func NewLRU

func NewLRU(cacheTTL time.Duration) *lru

Types

type RoutingAndCaching

type RoutingAndCaching interface {
	Select([]SelectablePlugin) (SelectablePlugin, error)
	CheckCache(mts []core.Metric) ([]core.Metric, []core.Metric)
	UpdateCache(mts []core.Metric)
	CacheHits(string, int) (uint64, error)
	CacheMisses(string, int) (uint64, error)
	AllCacheHits() uint64
	AllCacheMisses() uint64
	CacheTTL() time.Duration
	String() string
}

type SelectablePlugin

type SelectablePlugin interface {
	HitCount() int
	LastHit() time.Time
	String() string
}

Jump to

Keyboard shortcuts

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