cross-wire backend rx/tx (#356)

This commit is contained in:
Michael Quigley 2023-06-26 16:58:32 -04:00
parent 5b7ff0968d
commit 75795b326b
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62

View File

@ -57,14 +57,14 @@ func Ingest(event ZitiEventJson) (*Usage, error) {
} }
if v, found := usage["egress.tx"]; found { if v, found := usage["egress.tx"]; found {
if vFloat64, ok := v.(float64); ok { if vFloat64, ok := v.(float64); ok {
u.BackendTx = int64(vFloat64) u.BackendRx = int64(vFloat64)
} else { } else {
logrus.Errorf("unable to assert 'usage/egress.tx': %v", event) logrus.Errorf("unable to assert 'usage/egress.tx': %v", event)
} }
} }
if v, found := usage["egress.rx"]; found { if v, found := usage["egress.rx"]; found {
if vFloat64, ok := v.(float64); ok { if vFloat64, ok := v.(float64); ok {
u.BackendRx = int64(vFloat64) u.BackendTx = int64(vFloat64)
} else { } else {
logrus.Errorf("unable to assert 'usage/egress.rx': %v", event) logrus.Errorf("unable to assert 'usage/egress.rx': %v", event)
} }