Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ServerMaxProcsGauge records the maxprocs. ServerMaxProcsGauge = prometheus.NewGauge( prometheus.GaugeOpts{ Namespace: "pd", Subsystem: "service", Name: "maxprocs", Help: "The value of GOMAXPROCS.", }) // ServerMemoryLimit records the cgroup memory limit. ServerMemoryLimit = prometheus.NewGauge( prometheus.GaugeOpts{ Namespace: "pd", Subsystem: "service", Name: "memory_quota_bytes", Help: "The value of memory quota bytes.", }) // ServerInfoGauge indicates the pd server info including version and git hash. ServerInfoGauge = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Namespace: "pd", Subsystem: "server", Name: "info", Help: "Indicate the pd server info, and the value is the start timestamp (s).", }, []string{"version", "hash"}) )
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server interface { // Name returns the unique name for this server in the cluster. Name() string // GetAddr returns the address of the server. GetAddr() string // Context returns the context of server. Context() context.Context // Run runs the server. Run() error // Close closes the server. Close() // GetLeaderListenUrls gets service endpoints from the leader in election group. GetLeaderListenUrls() []string // GetClient returns builtin etcd client. GetClient() *clientv3.Client // GetHTTPClient returns builtin http client. GetHTTPClient() *http.Client // AddStartCallback adds a callback in the startServer phase. AddStartCallback(callbacks ...func()) // IsServing returns whether the server is the leader, if there is embedded etcd, or the primary otherwise. IsServing() bool // AddServiceReadyCallback adds callbacks when the server becomes the leader, if there is embedded etcd, or the primary otherwise. AddServiceReadyCallback(callbacks ...func(context.Context) error) }
Server defines the common basic behaviors of a server
Click to show internal directories.
Click to hide internal directories.