netmaker/nm-proxy/metrics/metrics.go

22 lines
330 B
Go
Raw Normal View History

2022-11-28 13:25:40 +08:00
package metrics
2022-11-29 02:55:42 +08:00
import (
"sync"
)
2022-11-28 13:25:40 +08:00
/*
1. Create metrics packet--> packet with identifier to track latency, errors.
*/
2022-11-29 02:55:42 +08:00
type Metric struct {
LastRecordedLatency int64
ConnectionStatus bool
TrafficSent uint64
TrafficRecieved uint64
}
var MetricsMapLock *sync.RWMutex
var MetricsMap = make(map[string]Metric)