command

package
v0.0.0-...-f0eb915 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Initiated by admin.
	Read hotType = "/hotspot/regions/read"
	// Initiated by merge checker or merge scheduler. Note that it may not include region merge.
	// the order describe the operator's producer and is very helpful to decouple scheduler or checker limit
	Write hotType = "/hotspot/regions/write"
)

Variables

This section is empty.

Functions

func ExportRegionsInfo

func ExportRegionsInfo(cmd *cobra.Command, _ []string)

func NewHotRegionCommand

func NewHotRegionCommand() *cobra.Command

NewHotRegionCommand

func NewRegionCommand

func NewRegionCommand() *cobra.Command

NewHotRegionCommand

func PrintRegionsInfo

func PrintRegionsInfo(cmd *cobra.Command, _ []string)

func ShowRegionDistributionFnc

func ShowRegionDistributionFnc(cmd *cobra.Command, _ []string)

Types

type HotPeerStatShow

type HotPeerStatShow struct {
	StoreID        uint64    `json:"store_id"`
	RegionID       uint64    `json:"region_id"`
	HotDegree      int       `json:"hot_degree"`
	ByteRate       float64   `json:"flow_bytes"`
	KeyRate        float64   `json:"flow_keys"`
	QueryRate      float64   `json:"flow_query"`
	AntiCount      int       `json:"anti_count"`
	LastUpdateTime time.Time `json:"last_update_time"`
}

HotPeerStatShow records the hot region statistics for output

type HotPeersStat

type HotPeersStat struct {
	TotalLoads     []float64         `json:"-"`
	TotalBytesRate float64           `json:"total_flow_bytes"`
	TotalKeysRate  float64           `json:"total_flow_keys"`
	TotalQueryRate float64           `json:"total_flow_query"`
	Count          int               `json:"regions_count"`
	Stats          []HotPeerStatShow `json:"statistics"`
}

HotPeersStat records all hot regions statistics

type Peer

type Peer struct {
	Id        uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	StoreId   uint64 `protobuf:"varint,2,opt,name=store_id,json=storeId,proto3" json:"store_id,omitempty"`
	IsLearner bool   `protobuf:"varint,3,opt,name=is_learner,json=isLearner,proto3" json:"is_learner,omitempty"`
}

type RegionInfo

type RegionInfo struct {
	ID       uint64  `json:"id"`
	StartKey string  `json:"start_key"`
	EndKey   string  `json:"end_key"`
	Peers    []*Peer `json:"peers,omitempty"`
	Leader   *Peer   `json:"leader,omitempty"`
}

type RegionsInfo

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

func GetRegionsInfo

func GetRegionsInfo(cmd *cobra.Command) (*RegionsInfo, error)

type StoreHotPeersInfos

type StoreHotPeersInfos struct {
	AsPeer   map[string]*HotPeersStat `json:"as_peer"`
	AsLeader map[string]*HotPeersStat `json:"as_leader"`
}

type StoreInfo

type StoreInfo struct {
	Store struct {
		ID uint64 `json:"id"`
	} `json:"store"`
}

type StoreInfos

type StoreInfos struct {
	StoreHotPeersStat *StoreHotPeersInfos
	// contains filtered or unexported fields
}

func NewHotRegionExport

func NewHotRegionExport(pd string, stores *StoresInfo, regions *RegionsInfo) *StoreInfos

type StoresInfo

type StoresInfo struct {
	Stores []*StoreInfo `json:"stores"`
}

func GetStoresInfo

func GetStoresInfo(cmd *cobra.Command) (*StoresInfo, error)

GetStoresInfo

Jump to

Keyboard shortcuts

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