clusterinfo

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAlertCountByAddress

func GetAlertCountByAddress(address string, httpClient *http.Client) (int, error)

GetAlertCountByAddress receives alert manager's address like "ip:port", and it returns the

alert number of the alert manager.

func GetTopologyUnderEtcd

func GetTopologyUnderEtcd(ctx context.Context, etcdClient *clientv3.Client) (tidbNodes []TiDBInfo, grafanaNode *GrafanaInfo, alertManagerNode *AlertManagerInfo, e error)

GetTopology return error only when fetch etcd failed.

Types

type AlertManagerInfo

type AlertManagerInfo struct {
	IP         string `json:"ip"`
	Port       uint   `json:"port"`
	BinaryPath string `json:"binary_path"`
}

type ComponentStatus

type ComponentStatus uint
const (
	ComponentStatusUnreachable ComponentStatus = 0
	ComponentStatusUp          ComponentStatus = 1
	ComponentStatusTombstone   ComponentStatus = 2
)

type GrafanaInfo

type GrafanaInfo struct {
	IP         string `json:"ip"`
	Port       uint   `json:"port"`
	BinaryPath string `json:"binary_path"`
}

type PDInfo

type PDInfo struct {
	Version    string          `json:"version"`
	IP         string          `json:"ip"`
	Port       uint            `json:"port"`
	DeployPath string          `json:"deploy_path"`
	Status     ComponentStatus `json:"status"`
}

func GetPDTopology

func GetPDTopology(pdEndPoint string, httpClient *http.Client) ([]PDInfo, error)

type TiDBInfo

type TiDBInfo struct {
	Version    string          `json:"version"`
	IP         string          `json:"ip"`
	Port       uint            `json:"port"`
	BinaryPath string          `json:"binary_path"`
	Status     ComponentStatus `json:"status"`
	StatusPort uint            `json:"status_port"`
}

func GetTiDBTopologyFromOld

func GetTiDBTopologyFromOld(ctx context.Context, etcdclient *clientv3.Client) ([]TiDBInfo, error)

GetTiDBTopologyFromOld get tidb topology under "/tidb/server/info/". It cannot get "binary_path" field.

type TiKVInfo

type TiKVInfo struct {
	Version    string            `json:"version"`
	IP         string            `json:"ip"`
	Port       uint              `json:"port"`
	BinaryPath string            `json:"binary_path"`
	Status     ComponentStatus   `json:"status"`
	StatusPort uint              `json:"status_port"`
	Labels     map[string]string `json:"labels"`
}

func GetTiKVTopology

func GetTiKVTopology(endpoint string, httpClient *http.Client) ([]TiKVInfo, error)

Jump to

Keyboard shortcuts

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