metrics.go 330 B

123456789101112131415161718192021
  1. package metrics
  2. import (
  3. "sync"
  4. )
  5. /*
  6. 1. Create metrics packet--> packet with identifier to track latency, errors.
  7. */
  8. type Metric struct {
  9. LastRecordedLatency int64
  10. ConnectionStatus bool
  11. TrafficSent uint64
  12. TrafficRecieved uint64
  13. }
  14. var MetricsMapLock *sync.RWMutex
  15. var MetricsMap = make(map[string]Metric)