Fix TM2 wrong TODOs, fix magic strings
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/15248fa4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/15248fa4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/15248fa4 Branch: refs/heads/master Commit: 15248fa4e1c345fec9cc0cd48c476ebc89094504 Parents: 655f472 Author: Robert Butts <robert.o.bu...@gmail.com> Authored: Mon Feb 6 15:46:59 2017 -0700 Committer: Jeff Elsloo <jeffrey_els...@cable.comcast.com> Committed: Thu Feb 9 09:41:09 2017 -0700 ---------------------------------------------------------------------- traffic_monitor_golang/traffic_monitor/manager/stat.go | 3 +-- traffic_monitor_golang/traffic_monitor/peer/crstates.go | 1 - .../traffic_monitor/trafficopsdata/trafficopsdata.go | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/15248fa4/traffic_monitor_golang/traffic_monitor/manager/stat.go ---------------------------------------------------------------------- diff --git a/traffic_monitor_golang/traffic_monitor/manager/stat.go b/traffic_monitor_golang/traffic_monitor/manager/stat.go index 23619be..6ab105c 100644 --- a/traffic_monitor_golang/traffic_monitor/manager/stat.go +++ b/traffic_monitor_golang/traffic_monitor/manager/stat.go @@ -46,8 +46,7 @@ func getNewCaches(localStates peer.CRStatesThreadsafe, monitorConfigTS TrafficMo caches := map[enum.CacheName]struct{}{} for cacheName := range localStates.GetCaches() { // ONLINE and OFFLINE caches are not polled. - // TODO add a function IsPolled() which can be called by this and the monitorConfig func which sets the polling, to prevent updating in one place breaking the other. - if ts, ok := monitorConfig.TrafficServer[string(cacheName)]; !ok || ts.Status == "ONLINE" || ts.Status == "OFFLINE" { + if ts, ok := monitorConfig.TrafficServer[string(cacheName)]; !ok || ts.Status == string(enum.CacheStatusOnline) || ts.Status == string(enum.CacheStatusOffline) { continue } caches[cacheName] = struct{}{} http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/15248fa4/traffic_monitor_golang/traffic_monitor/peer/crstates.go ---------------------------------------------------------------------- diff --git a/traffic_monitor_golang/traffic_monitor/peer/crstates.go b/traffic_monitor_golang/traffic_monitor/peer/crstates.go index 62bb810..ba42d7e 100644 --- a/traffic_monitor_golang/traffic_monitor/peer/crstates.go +++ b/traffic_monitor_golang/traffic_monitor/peer/crstates.go @@ -116,7 +116,6 @@ func (t *CRStatesThreadsafe) Get() Crstates { } // GetDeliveryServices returns the internal Crstates delivery services map for reading. -// TODO add GetCaches, GetDeliveryservices? func (t *CRStatesThreadsafe) GetDeliveryServices() map[enum.DeliveryServiceName]Deliveryservice { t.m.RLock() defer t.m.RUnlock() http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/15248fa4/traffic_monitor_golang/traffic_monitor/trafficopsdata/trafficopsdata.go ---------------------------------------------------------------------- diff --git a/traffic_monitor_golang/traffic_monitor/trafficopsdata/trafficopsdata.go b/traffic_monitor_golang/traffic_monitor/trafficopsdata/trafficopsdata.go index afc6106..970ea4f 100644 --- a/traffic_monitor_golang/traffic_monitor/trafficopsdata/trafficopsdata.go +++ b/traffic_monitor_golang/traffic_monitor/trafficopsdata/trafficopsdata.go @@ -35,7 +35,6 @@ import ( // 2. .*\.foo\..* expressions, where foo is a direct string match with no regular expression matching characters // 3. Everything else // This allows us to do a cheap match on 1 and 2, and only regex match the uncommon case. -// TODO performance tests, whether Go compiled *Regexp is relevantly slower than `strings.Contains` for direct and .foo. matches type Regexes struct { DirectMatches map[string]enum.DeliveryServiceName DotStartSlashDotFooSlashDotDotStar map[string]enum.DeliveryServiceName