region

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ResponseTags = append([]StatTag{Integration}, StorageTags...)

ResponseTags is the order of tags when responding.

StorageTags is the order of tags during storage.

Functions

func Bytes

func Bytes(s string) (b []byte)

Bytes converts a string into a byte slice. Need to make sure that the byte slice is not modified.

func GetDisplayTags

func GetDisplayTags(baseTag StatTag) []string

GetDisplayTags returns the actual order of the ResponseTags under the specified baseTag.

func String

func String(b []byte) (s string)

String converts slice of bytes to string without copy.

Types

type PDDataProvider

type PDDataProvider struct {
	// File mode (debug)
	FileStartTime int64
	FileEndTime   int64
	// API or Core mode
	// This item takes effect only when both FileStartTime and FileEndTime are 0.
	PeriodicGetter RegionsInfoGenerator

	EtcdProvider pd.EtcdProvider
	Store        *dbstore.DB
}

type RegionsInfo

type RegionsInfo interface {
	Len() int
	GetKeys() []string
	GetValues(tag StatTag) []uint64
}

type RegionsInfoGenerator

type RegionsInfoGenerator func() (RegionsInfo, error)

type StatTag

type StatTag int

StatTag is a tag for statistics of different dimensions.

const (
	// Integration is The overall value of all other dimension statistics.
	Integration StatTag = iota
	// WrittenBytes is the size of the data written per minute.
	WrittenBytes
	// ReadBytes is the size of the data read per minute.
	ReadBytes
	// WrittenKeys is the number of keys written to the data per minute.
	WrittenKeys
	// ReadKeys is the number of keys read to the data per minute.
	ReadKeys
)

func IntoTag

func IntoTag(typ string) StatTag

IntoTag converts a string into a StatTag.

func (StatTag) String

func (tag StatTag) String() string

Jump to

Keyboard shortcuts

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