api

package
v2.1.19+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2019 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRegion

func InitRegion(r *core.RegionInfo, s *regionInfo) *regionInfo

InitRegion init a new api RegionInfo from the core.RegionInfo.

func NewHandler

func NewHandler(svr *server.Server) http.Handler

NewHandler creates a HTTP handler for API.

Types

type MetaStore

type MetaStore struct {
	*metapb.Store
	StateName string `json:"state_name"`
}

MetaStore contains meta information about a store.

type PeerStats

type PeerStats struct {
	Name       string    `json:"name"`
	ID         string    `json:"id"`
	State      string    `json:"state"`
	StartTime  time.Time `json:"startTime"`
	LeaderInfo struct {
		Leader    string    `json:"leader"`
		Uptime    string    `json:"uptime"`
		StartTime time.Time `json:"startTime"`
	} `json:"leaderInfo"`
	RecvAppendRequestCnt int `json:"recvAppendRequestCnt"`
	SendAppendRequestCnt int `json:"sendAppendRequestCnt"`
}

PeerStats is the etcd peers' stats.

type Recommendation

type Recommendation struct {
	Module      string `json:"module"`
	Level       string `json:"level"`
	Description string `json:"description"`
	Instruction string `json:"instruction"`
}

Recommendation contains a potential problem and possible way to deal with it.

type RegionHeap

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

RegionHeap implements heap.Interface, used for selecting top n regions.

func (*RegionHeap) Len

func (h *RegionHeap) Len() int

func (*RegionHeap) Less

func (h *RegionHeap) Less(i, j int) bool

func (*RegionHeap) Min

func (h *RegionHeap) Min() *core.RegionInfo

Min returns the minimum region from the heap.

func (*RegionHeap) Pop

func (h *RegionHeap) Pop() interface{}

Pop removes the minimum element (according to Less) from the heap and returns it.

func (*RegionHeap) Push

func (h *RegionHeap) Push(x interface{})

Push pushes an element x onto the heap.

func (*RegionHeap) Swap

func (h *RegionHeap) Swap(i, j int)

type StoreInfo

type StoreInfo struct {
	Store  *MetaStore   `json:"store"`
	Status *StoreStatus `json:"status"`
}

StoreInfo contains information about a store.

type StoreStatus

type StoreStatus struct {
	Capacity           typeutil.ByteSize  `json:"capacity,omitempty"`
	Available          typeutil.ByteSize  `json:"available,omitempty"`
	LeaderCount        int                `json:"leader_count,omitempty"`
	LeaderWeight       float64            `json:"leader_weight,omitempty"`
	LeaderScore        float64            `json:"leader_score,omitempty"`
	LeaderSize         int64              `json:"leader_size,omitempty"`
	RegionCount        int                `json:"region_count,omitempty"`
	RegionWeight       float64            `json:"region_weight,omitempty"`
	RegionScore        float64            `json:"region_score,omitempty"`
	RegionSize         int64              `json:"region_size,omitempty"`
	SendingSnapCount   uint32             `json:"sending_snap_count,omitempty"`
	ReceivingSnapCount uint32             `json:"receiving_snap_count,omitempty"`
	ApplyingSnapCount  uint32             `json:"applying_snap_count,omitempty"`
	IsBusy             bool               `json:"is_busy,omitempty"`
	StartTS            *time.Time         `json:"start_ts,omitempty"`
	LastHeartbeatTS    *time.Time         `json:"last_heartbeat_ts,omitempty"`
	Uptime             *typeutil.Duration `json:"uptime,omitempty"`
}

StoreStatus contains status about a store.

type StoresInfo

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

StoresInfo records stores' info.

type Trend

type Trend struct {
	Stores  []trendStore  `json:"stores"`
	History *trendHistory `json:"history"`
}

Trend describes the cluster's schedule trend.

Jump to

Keyboard shortcuts

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