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..979a2bac72 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, @@ -533,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" } }