You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by sr...@apache.org on 2023/06/02 21:34:07 UTC

[trafficcontrol] branch master updated: TM - Plugin Systems Stats Timestamp for SOH (#7551)

This is an automated email from the ASF dual-hosted git repository.

srijeet0406 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new a1bd413864 TM - Plugin Systems Stats Timestamp for SOH (#7551)
a1bd413864 is described below

commit a1bd413864feef5a7b87228cc80f087cf1680812
Author: Rima Shah <22...@users.noreply.github.com>
AuthorDate: Fri Jun 2 15:34:00 2023 -0600

    TM - Plugin Systems Stats Timestamp for SOH (#7551)
    
    * Using plugin.system_stats.timestamp_ms instead of current_time_epoch_ms
    
    * Removed current_time_epoch_ms
---
 traffic_monitor/cache/cache.go             | 2 +-
 traffic_monitor/cache/cache_test.go        | 8 ++++----
 traffic_monitor/cache/stats_over_http.json | 2 +-
 3 files changed, 6 insertions(+), 6 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..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"
 	}
 }