mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-10 15:14:22 +08:00
set uptime only when node is connected
This commit is contained in:
parent
6f04d46cac
commit
a40f8b2878
1 changed files with 2 additions and 3 deletions
|
@ -46,10 +46,9 @@ func Collect(iface, server, network string, peerMap models.PeerMap) (*models.Met
|
||||||
newMetric.TotalSent = int64(proxyMetrics.TrafficSent)
|
newMetric.TotalSent = int64(proxyMetrics.TrafficSent)
|
||||||
newMetric.Latency = int64(proxyMetrics.LastRecordedLatency)
|
newMetric.Latency = int64(proxyMetrics.LastRecordedLatency)
|
||||||
newMetric.Connected = proxyMetrics.NodeConnectionStatus[id]
|
newMetric.Connected = proxyMetrics.NodeConnectionStatus[id]
|
||||||
if !newMetric.Connected {
|
if newMetric.Connected {
|
||||||
newMetric.Latency = 999
|
|
||||||
}
|
|
||||||
newMetric.Uptime = 1
|
newMetric.Uptime = 1
|
||||||
|
}
|
||||||
// check device peer to see if WG is working if ping failed
|
// check device peer to see if WG is working if ping failed
|
||||||
if !newMetric.Connected {
|
if !newMetric.Connected {
|
||||||
if currPeer.ReceiveBytes > 0 &&
|
if currPeer.ReceiveBytes > 0 &&
|
||||||
|
|
Loading…
Add table
Reference in a new issue