mirror of
https://github.com/datarhei/core.git
synced 2025-10-05 07:57:13 +08:00
Add EmergencyLeaderTimeout parameter, ignore throttling nodes, implement NodeRecoverTimeout, introduce processNodeMap in cluster DB
This commit is contained in:
@@ -41,6 +41,7 @@ type NodeReader interface {
|
||||
IPs() []string
|
||||
About() NodeAbout
|
||||
Version() NodeVersion
|
||||
Resources() NodeResources
|
||||
|
||||
Files() NodeFiles
|
||||
ProcessList() ([]Process, error)
|
||||
@@ -495,6 +496,22 @@ func (n *node) About() NodeAbout {
|
||||
return nodeAbout
|
||||
}
|
||||
|
||||
func (n *node) Resources() NodeResources {
|
||||
n.stateLock.RLock()
|
||||
defer n.stateLock.RUnlock()
|
||||
|
||||
r := NodeResources{
|
||||
IsThrottling: n.resources.throttling,
|
||||
NCPU: n.resources.ncpu,
|
||||
CPU: n.resources.cpu,
|
||||
CPULimit: n.resources.cpuLimit,
|
||||
Mem: n.resources.mem,
|
||||
MemLimit: n.resources.memLimit,
|
||||
}
|
||||
|
||||
return r
|
||||
}
|
||||
|
||||
func (n *node) Version() NodeVersion {
|
||||
about, err := n.AboutPeer()
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user