From 615a7caa20657d35b376e40688bae4e2de778eff Mon Sep 17 00:00:00 2001 From: Rima Shah Date: Fri, 2 Jun 2023 14:19:10 -0600 Subject: [PATCH 1/2] Using plugin.system_stats.timestamp_ms instead of current_time_epoch_ms --- traffic_monitor/cache/cache.go | 2 +- traffic_monitor/cache/cache_test.go | 8 ++++---- traffic_monitor/cache/stats_over_http.json | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/traffic_monitor/cache/cache.go b/traffic_monitor/cache/cache.go index 4d443c4088..9bedd3494f 100644 --- a/traffic_monitor/cache/cache.go +++ b/traffic_monitor/cache/cache.go @@ -307,7 +307,7 @@ func (handler Handler) Handle(id string, rdr io.Reader, format string, reqTime t handler.resultChan <- result return } - if val, ok := miscStats["current_time_epoch_ms"]; ok { + if val, ok := miscStats["plugin.system_stats.timestamp_ms"]; ok { valString := fmt.Sprintf("%s", val) valInt, valErr := strconv.ParseInt(valString, 10, 64) if valErr != nil { diff --git a/traffic_monitor/cache/cache_test.go b/traffic_monitor/cache/cache_test.go index 077592ffca..93ed80b687 100644 --- a/traffic_monitor/cache/cache_test.go +++ b/traffic_monitor/cache/cache_test.go @@ -124,12 +124,12 @@ func TestParseAndDecode(t *testing.T) { t.Errorf("empty miscStats structure") } - if val, ok := miscStats["current_time_epoch_ms"]; ok { + if val, ok := miscStats["plugin.system_stats.timestamp_ms"]; ok { valString := fmt.Sprintf("%s", val) - if valString != "1684784878894" { - t.Errorf("unable to read `current_time_epoch_ms`") + if valString != "1684784877939" { + t.Errorf("unable to read `plugin.system_stats.timestamp_ms`") } } else { - t.Errorf("current_time_epoch_ms field was not found in the json file") + t.Errorf("plugin.system_stats.timestamp_ms field was not found in the json file") } } diff --git a/traffic_monitor/cache/stats_over_http.json b/traffic_monitor/cache/stats_over_http.json index a7d8ed4b20..5192b26271 100644 --- a/traffic_monitor/cache/stats_over_http.json +++ b/traffic_monitor/cache/stats_over_http.json @@ -1,5 +1,6 @@ { "global": { + "plugin.system_stats.timestamp_ms": "1684784877939", "proxy.process.http.completed_requests": 26220072200, "proxy.process.http.total_incoming_connections": 770802777, "proxy.process.http.total_client_connections": 770802777, From cbdb1382bd29f1b0c27a9a09b2bcd1bf60f7d5f1 Mon Sep 17 00:00:00 2001 From: Rima Shah Date: Fri, 2 Jun 2023 15:09:12 -0600 Subject: [PATCH 2/2] Removed current_time_epoch_ms --- traffic_monitor/cache/stats_over_http.json | 1 - 1 file changed, 1 deletion(-) diff --git a/traffic_monitor/cache/stats_over_http.json b/traffic_monitor/cache/stats_over_http.json index 5192b26271..979a2bac72 100644 --- a/traffic_monitor/cache/stats_over_http.json +++ b/traffic_monitor/cache/stats_over_http.json @@ -534,7 +534,6 @@ "plugin.system_stats.net.docker0.rx_length_errors": "0", "proxy.process.cache.volume_0.span.offline": "0", "proxy.process.cache.volume_0.span.online": "0", - "current_time_epoch_ms": "1684784878894", "server": "10.0.0" } }