status

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const JsonIdent = "    "

Variables

This section is empty.

Functions

This section is empty.

Types

type CNInstance

type CNInstance struct {
	TxnClient   client.TxnClient
	LockService lockservice.LockService
}

type CNStatus

type CNStatus struct {
	TxnClientStatus TxnClientStatus `json:"txn_client_status"`
	LockStatus      LockStatus      `json:"lock_status"`
}

type DeletedSession

type DeletedSession struct {
	Address   string    `json:"address"`
	DeletedAt time.Time `json:"deleted_at"`
}

type HAKeeperStatus

type HAKeeperStatus struct {
	Nodes        []NodeStatus `json:"nodes"`
	DeletedNodes []NodeStatus `json:"deleted_nodes"`
	ErrMsg       string       `json:"err_msg"`
}

HAKeeperStatus contains the status of HAKeeper. Currently, we focus on the uptime/downtime of nodes in HAKeeper.

type LockItem

type LockItem struct {
	TableID  uint64   `json:"table_id"`
	Keys     [][]byte `json:"keys"`
	LockInfo string   `json:"lock_info"`
}

type LockStatus

type LockStatus struct {
	Locks []LockItem `json:"locks"`
}

type LogtailServerStatus

type LogtailServerStatus struct {
	Sessions        []SessionStatus  `json:"session_status"`
	DeletedSessions []DeletedSession `json:"deleted_sessions"`
}

type NodeStatus

type NodeStatus struct {
	NodeID    string                        `json:"node_id"`
	NodeType  string                        `json:"node_type"`
	Address   string                        `json:"address"`
	Labels    map[string]metadata.LabelList `json:"Labels"`
	WorkState metadata.WorkState            `json:"WorkState"`
	Resource  pb.Resource                   `json:"Resource"`
	UpTime    time.Time                     `json:"up_time"`
	DownTime  time.Time                     `json:"down_time"`
}

type Server

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

func NewServer

func NewServer() *Server

func (*Server) Dump

func (s *Server) Dump() ([]byte, error)

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, _ *http.Request)

func (*Server) SetHAKeeperClient

func (s *Server) SetHAKeeperClient(c logservice.ClusterHAKeeperClient)

func (*Server) SetLockService

func (s *Server) SetLockService(uuid string, l lockservice.LockService)

func (*Server) SetLogtailServer

func (s *Server) SetLogtailServer(logtailServer *service.LogtailServer)

func (*Server) SetTxnClient

func (s *Server) SetTxnClient(uuid string, c client.TxnClient)

type SessionStatus

type SessionStatus struct {
	ClientAddress    string    `json:"client_address"`
	LastBeforeSend   time.Time `json:"last_before_send"`
	LastAfterSend    time.Time `json:"last_after_send"`
	Active           int       `json:"active"`
	TableStatusCount int       `json:"table_status_count"`
}

type Status

type Status struct {
	LogtailServerStatus LogtailServerStatus  `json:"logtail_server_status"`
	HAKeeperStatus      HAKeeperStatus       `json:"hakeeper_status"`
	CNUUIDStatus        map[string]*CNStatus `json:"cn_uuid_status"`
}

type TxnClientStatus

type TxnClientStatus struct {
	// indicate whether the CN can provide service normally.
	// 0 means paused, 1 means normal.
	State int `json:"state"`
	// number of user active transactions.
	UserTxnNum int `json:"user_txn_num"`
	// all active txns
	ActiveTxns     []string `json:"active_txns"`
	ActiveTxnCount int      `json:"active_txn_count"`
	// FIFO queue for ready to active txn
	WaitActiveTxns     []string `json:"wait_active_txns"`
	WaitActiveTxnCount int      `json:"wait_active_txn_count"`
	// LatestTS is the latest TS for the txn client.
	LatestTS timestamp.Timestamp `json:"latest_ts"`
}

Jump to

Keyboard shortcuts

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