zrhoffman commented on code in PR #7302:
URL: https://github.com/apache/trafficcontrol/pull/7302#discussion_r1089381336
##########
traffic_monitor/datareq/crstate.go:
##########
@@ -84,10 +87,55 @@ func filterDirectlyPolledCaches(crstates tc.CRStates)
tc.CRStates {
return filtered
}
-func srvTRStateSelf(localStates peer.CRStatesThreadsafe, directlyPolledOnly
bool) ([]byte, error) {
+func srvTRStateSelf(localStates peer.CRStatesThreadsafe, directlyPolledOnly
bool, toData todata.TODataThreadsafe) ([]byte, error) {
if !directlyPolledOnly {
- return tc.CRStatesMarshall(localStates.Get())
+ localStatesC := updateStatusAnycast(localStates, toData)
+ return tc.CRStatesMarshall(localStatesC)
}
- unfiltered := localStates.Get()
+ unfiltered := updateStatusAnycast(localStates, toData)
return tc.CRStatesMarshall(filterDirectlyPolledCaches(unfiltered))
}
+
+func updateStatusAnycast(localStates peer.CRStatesThreadsafe, toData
todata.TODataThreadsafe) tc.CRStates {
+ localStatesC := localStates.Get()
+ toDataC := toData.Get()
+
+ for cache, _ := range localStatesC.Caches {
+ if _, ok := toDataC.ServerPartners[cache]; ok {
Review Comment:
What is a Server Partner? Is there an open source-friendly analogue to
Server Partner?
##########
traffic_monitor/cache/data.go:
##########
@@ -64,6 +64,10 @@ type AvailableStatus struct {
UnavailableStat string
// Poller is the name of the poller which set this availability status.
Poller string
+ // Time of last poll
+ LastPoll time.Time
+ // Time of v6 last poll
+ LastPollv6 time.Time
Review Comment:
`V` should be capitalized here for CamelCase
--
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]