input

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: 13 Imported by: 0

Documentation

Overview

Package input defines several different data inputs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAPIPeriodicGetter

func NewAPIPeriodicGetter(pdAddr string, client *http.Client) regionpkg.RegionsInfoGenerator

Types

type RegionInfo

type RegionInfo struct {
	ID              uint64 `json:"id"`
	StartKey        string `json:"start_key"`
	EndKey          string `json:"end_key"`
	WrittenBytes    uint64 `json:"written_bytes"`
	ReadBytes       uint64 `json:"read_bytes"`
	WrittenKeys     uint64 `json:"written_keys"`
	ReadKeys        uint64 `json:"read_keys"`
	ApproximateSize int64  `json:"approximate_size"`
	ApproximateKeys int64  `json:"approximate_keys"`
}

RegionInfo records detail region info for api usage.

type RegionsInfo

type RegionsInfo struct {
	Count   int           `json:"count"`
	Regions []*RegionInfo `json:"regions"`
}

RegionsInfo contains some regions with the detailed region info.

func (*RegionsInfo) GetKeys

func (rs *RegionsInfo) GetKeys() []string

func (*RegionsInfo) GetValues

func (rs *RegionsInfo) GetValues(tag regionpkg.StatTag) []uint64

func (*RegionsInfo) Len

func (rs *RegionsInfo) Len() int

type StatInput

type StatInput interface {
	GetStartTime() time.Time
	Background(stat *storage.Stat)
}

StatInput is the interface that different data inputs need to implement.

func FileInput

func FileInput(startTime, endTime time.Time) StatInput

FileInput reads files in the specified time range from the ./data directory.

func NewStatInput

func NewStatInput(ctx context.Context, provider *region.PDDataProvider) StatInput

func PeriodicInput

func PeriodicInput(ctx context.Context, periodicGetter region.RegionsInfoGenerator) StatInput

Jump to

Keyboard shortcuts

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