storage

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package storage stores the input axes in order, and can get a Plane by time interval.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateStorageAxis

func CreateStorageAxis(regions region.RegionsInfo, strategy matrix.Strategy) matrix.Axis

CreateStorageAxis converts the RegionsInfo to a StorageAxis.

func IntoResponseAxis

func IntoResponseAxis(storageAxis matrix.Axis, baseTag region.StatTag) matrix.Axis

IntoResponseAxis converts StorageAxis to ResponseAxis.

func IntoStorageAxis

func IntoStorageAxis(responseAxis matrix.Axis, strategy matrix.Strategy) matrix.Axis

IntoStorageAxis converts ResponseAxis to StorageAxis.

Types

type LayerConfig

type LayerConfig struct {
	Len   int
	Ratio int
}

LayerConfig is the configuration of layerStat.

type Stat

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

Stat is composed of multiple layerStats.

func NewStat

func NewStat(ctx context.Context, wg *sync.WaitGroup, provider *region.PDDataProvider, cfg StatConfig, strategy matrix.Strategy, startTime time.Time) *Stat

NewStat generates a Stat based on the configuration.

func (*Stat) Append

func (s *Stat) Append(regions region.RegionsInfo, endTime time.Time)

Append adds the latest full statistics.

func (*Stat) Range

func (s *Stat) Range(startTime, endTime time.Time, startKey, endKey string, baseTag region.StatTag) matrix.Plane

Range returns a sub Plane with specified range.

type StatConfig

type StatConfig struct {
	LayersConfig []LayerConfig
}

StatConfig is the configuration of Stat.

Jump to

Keyboard shortcuts

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