-
Notifications
You must be signed in to change notification settings - Fork 204
/
Copy pathsystemLoadsGetters.go
65 lines (52 loc) · 2.41 KB
/
systemLoadsGetters.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package presenter
import (
"github.com/ElrondNetwork/elrond-go/core"
)
// GetCpuLoadPercent wil return cpu load
func (psh *PresenterStatusHandler) GetCpuLoadPercent() uint64 {
return psh.getFromCacheAsUint64(core.MetricCpuLoadPercent)
}
// GetMemLoadPercent will return mem percent usage of node
func (psh *PresenterStatusHandler) GetMemLoadPercent() uint64 {
return psh.getFromCacheAsUint64(core.MetricMemLoadPercent)
}
// GetTotalMem will return how much memory does the computer have
func (psh *PresenterStatusHandler) GetTotalMem() uint64 {
return psh.getFromCacheAsUint64(core.MetricMemTotal)
}
// GetMemUsedByNode will return how many memory node uses
func (psh *PresenterStatusHandler) GetMemUsedByNode() uint64 {
return psh.getFromCacheAsUint64(core.MetricMemUsedGolang)
}
// GetNetworkRecvPercent will return network receive percent
func (psh *PresenterStatusHandler) GetNetworkRecvPercent() uint64 {
return psh.getFromCacheAsUint64(core.MetricNetworkRecvPercent)
}
// GetNetworkRecvBps will return network received bytes per second
func (psh *PresenterStatusHandler) GetNetworkRecvBps() uint64 {
return psh.getFromCacheAsUint64(core.MetricNetworkRecvBps)
}
// GetNetworkRecvBpsPeak will return received bytes per seconds peak
func (psh *PresenterStatusHandler) GetNetworkRecvBpsPeak() uint64 {
return psh.getFromCacheAsUint64(core.MetricNetworkRecvBpsPeak)
}
// GetNetworkSentPercent will return network sent percent
func (psh *PresenterStatusHandler) GetNetworkSentPercent() uint64 {
return psh.getFromCacheAsUint64(core.MetricNetworkSentPercent)
}
// GetNetworkSentBps will return network sent bytes per second
func (psh *PresenterStatusHandler) GetNetworkSentBps() uint64 {
return psh.getFromCacheAsUint64(core.MetricNetworkSentBps)
}
// GetNetworkSentBpsPeak will return sent bytes per seconds peak
func (psh *PresenterStatusHandler) GetNetworkSentBpsPeak() uint64 {
return psh.getFromCacheAsUint64(core.MetricNetworkSentBpsPeak)
}
// GetNetworkSentBytesInEpoch will return the number of bytes sent in current epoch
func (psh *PresenterStatusHandler) GetNetworkSentBytesInEpoch() uint64 {
return psh.getFromCacheAsUint64(core.MetricNetworkSendBytesInCurrentEpochPerHost)
}
// GetNetworkReceivedBytesInEpoch will return the number of bytes received in current epoch
func (psh *PresenterStatusHandler) GetNetworkReceivedBytesInEpoch() uint64 {
return psh.getFromCacheAsUint64(core.MetricNetworkRecvBytesInCurrentEpochPerHost)
}