api

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2025 License: Apache-2.0 Imports: 64 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

NewHandler creates a HTTP handler for API.

func TopNRegions

func TopNRegions(regions []*core.RegionInfo, less func(a, b *core.RegionInfo) bool, n int) []*core.RegionInfo

TopNRegions returns top n regions according to the given rule.

Types

type Health

type Health struct {
	Name       string   `json:"name"`
	MemberID   uint64   `json:"member_id"`
	ClientUrls []string `json:"client_urls"`
	Health     bool     `json:"health"`
}

Health reflects the cluster's health. NOTE: This type is exported by HTTP API. Please pay more attention when modifying it.

type ListServiceGCSafepoint

type ListServiceGCSafepoint struct {
	ServiceGCSafepoints   []*endpoint.ServiceSafePoint `json:"service_gc_safe_points"`
	MinServiceGcSafepoint uint64                       `json:"min_service_gc_safe_point,omitempty"`
	GCSafePoint           uint64                       `json:"gc_safe_point"`
}

ListServiceGCSafepoint is the response for list service GC safepoint. NOTE: This type is exported by HTTP API. Please pay more attention when modifying it. This type is in sync with `pd/client/http/types.go`.

type Progress

type Progress struct {
	Action       string  `json:"action"`
	StoreID      uint64  `json:"store_id,omitempty"`
	Progress     float64 `json:"progress"`
	CurrentSpeed float64 `json:"current_speed"`
	LeftSeconds  float64 `json:"left_seconds"`
}

Progress contains status about a progress.

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() any

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

func (*RegionHeap) Push

func (h *RegionHeap) Push(x any)

Push pushes an element x onto the heap.

func (*RegionHeap) Swap

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

type Trend

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

Trend describes the cluster's schedule trend. NOTE: This type is exported by HTTP API. Please pay more attention when modifying it.

Jump to

Keyboard shortcuts

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