zrhoffman commented on code in PR #7608:
URL: https://github.com/apache/trafficcontrol/pull/7608#discussion_r1253360754


##########
traffic_monitor/cache/cache.go:
##########
@@ -306,6 +307,17 @@ func (handler Handler) Handle(id string, rdr io.Reader, 
format string, reqTime t
                handler.resultChan <- result
                return
        }
+       if val, ok := miscStats["plugin.system_stats.timestamp_ms"]; ok {
+               valString := fmt.Sprintf("%s", val)

Review Comment:
   Typically we void `fmt.Sprintf` in Traffic Monitor anyway for performance 
reasons, since it uses reflection (see 
https://github.com/apache/trafficcontrol/pull/6159#issuecomment-920952811 for 
more info), so this should use `strconv.Itoa`



##########
traffic_monitor/cache/cache.go:
##########
@@ -306,6 +307,17 @@ func (handler Handler) Handle(id string, rdr io.Reader, 
format string, reqTime t
                handler.resultChan <- result
                return
        }
+       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 {
+                       log.Errorf("parse error '%v'", valErr)

Review Comment:
   Same comment here, just use `log.Error` and string concatenation to avoid 
reflection for performance reasons.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to