psrefresh

package
v0.0.0-...-4fe5f23 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDefaultParamSetRefresher

func NewDefaultParamSetRefresher(traceStore OPSProvider, numParamSets int, dfBuilder dataframe.DataFrameBuilder, qconfig config.QueryConfig) *defaultParamSetRefresher

NewDefaultParamSetRefresher builds a new *ParamSetRefresher.

func ShouldCacheValue

func ShouldCacheValue(value string, validValues []string) bool

check whether value is part of the list validValues

Types

type CachedParamSetRefresher

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

CachedParamSetRefresher provides a struct to refresh paramsets and store them in the given cache.

func NewCachedParamSetRefresher

func NewCachedParamSetRefresher(psRefresher *defaultParamSetRefresher, cache cache.Cache) *CachedParamSetRefresher

NewCachedParamSetRefresher returns a new instance of the CachedParamSetRefresher.

func (*CachedParamSetRefresher) GetAll

GetAll returns the entire ParamSet for the instance.

func (*CachedParamSetRefresher) GetParamSetForQuery

func (c *CachedParamSetRefresher) GetParamSetForQuery(ctx context.Context, query *query.Query, q url.Values) (int64, paramtools.ParamSet, error)

GetParamSetForQuery returns the trace count and paramset for the given query.

func (*CachedParamSetRefresher) PopulateCache

func (c *CachedParamSetRefresher) PopulateCache()

Populate the cache with the paramsets.

func (*CachedParamSetRefresher) Start

func (c *CachedParamSetRefresher) Start(period time.Duration) error

Start the refresher.

func (*CachedParamSetRefresher) StartRefreshRoutine

func (c *CachedParamSetRefresher) StartRefreshRoutine(refreshPeriod time.Duration)

StartRefreshRoutine starts a goroutine to refresh the paramsets in the cache.

type OPSProvider

type OPSProvider interface {
	GetLatestTile(context.Context) (types.TileNumber, error)
	GetParamSet(ctx context.Context, tileNumber types.TileNumber) (paramtools.ReadOnlyParamSet, error)
}

OPSProvider allows access to OrdererParamSets. TraceStore implements this interface.

type ParamSetRefresher

type ParamSetRefresher interface {
	// GetAll returns all the paramsets in the instance.
	GetAll() paramtools.ReadOnlyParamSet

	// GetParamSetForQuery returns the paramsets filtered for the provided query.
	GetParamSetForQuery(ctx context.Context, query *query.Query, q url.Values) (int64, paramtools.ParamSet, error)

	// Start kicks off the param set refresh routine.
	Start(period time.Duration) error
}

ParamSetRefresher provides an interface for accessing instance param sets.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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