You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2016/10/28 21:06:24 UTC

[01/50] incubator-trafficcontrol git commit: Fix TM2 DsStats IsHealthy to match IsAvailable

Repository: incubator-trafficcontrol
Updated Branches:
  refs/heads/master 9c94dde11 -> c6de30895


Fix TM2 DsStats IsHealthy to match IsAvailable

Fixes Traffic Monitor 2.0 `/publish/DsStats` endpoint `isHealthy` stat
to match TM1 and be true iff `isAvailable` is true. The isHealthy stat
was supposed to represent whether the delivery service is healthy,
as defined by the maximum kbps (and other data?) defined in Traffic
Ops. It may or may not need fixed to reflect this in the future.


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/6e00e606
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/6e00e606
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/6e00e606

Branch: refs/heads/master
Commit: 6e00e6062f2b844d8fc2373df91ed0dd4554ed0c
Parents: 9051b51
Author: Robert Butts <ro...@gmail.com>
Authored: Wed Oct 26 15:57:58 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../experimental/traffic_monitor/deliveryservice/stat.go          | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6e00e606/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
index 5415634..090480f 100644
--- a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
+++ b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
@@ -84,8 +84,9 @@ func addAvailableData(dsStats Stats, crStates peer.Crstates, serverCachegroups m
 			}
 
 			if available.IsAvailable {
-				// c.IsAvailable.Value
 				stat.CommonStats.IsAvailable.Value = true
+				// TODO fix to be whether the Delivery Service has exceeded max kbps defined in Traffic Ops in `/health/cdn-name`?
+				stat.CommonStats.IsHealthy.Value = true
 				stat.CommonStats.CachesAvailableNum.Value++
 				cacheGroupStats := stat.CacheGroups[cacheGroup]
 				cacheGroupStats.IsAvailable.Value = true


[20/50] incubator-trafficcontrol git commit: update client import paths

Posted by mi...@apache.org.
update client import paths

This updates the import paths to reference the new
`apache/incubator-trafficcontrol` over the old `Comcast/traffic_control`.


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/31defa09
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/31defa09
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/31defa09

Branch: refs/heads/master
Commit: 31defa0928bd18b2fa184371a6f86ac3b08c4127
Parents: e11cbd3
Author: Mike Ball <mi...@gmail.com>
Authored: Thu Oct 27 11:29:00 2016 -0400
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 traffic_ops/client/fixtures/cachegroup.go             | 2 +-
 traffic_ops/client/fixtures/cdn.go                    | 2 +-
 traffic_ops/client/fixtures/delivery_service.go       | 2 +-
 traffic_ops/client/fixtures/hardware.go               | 2 +-
 traffic_ops/client/fixtures/parameter.go              | 2 +-
 traffic_ops/client/fixtures/profile.go                | 2 +-
 traffic_ops/client/fixtures/server.go                 | 2 +-
 traffic_ops/client/fixtures/stats_summary.go          | 2 +-
 traffic_ops/client/fixtures/traffic_monitor_config.go | 2 +-
 traffic_ops/client/fixtures/traffic_router_config.go  | 2 +-
 traffic_ops/client/fixtures/types.go                  | 2 +-
 traffic_ops/client/fixtures/user.go                   | 2 +-
 12 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/31defa09/traffic_ops/client/fixtures/cachegroup.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/fixtures/cachegroup.go b/traffic_ops/client/fixtures/cachegroup.go
index 2adb749..b0e565a 100644
--- a/traffic_ops/client/fixtures/cachegroup.go
+++ b/traffic_ops/client/fixtures/cachegroup.go
@@ -16,7 +16,7 @@
 
 package fixtures
 
-import "github.com/Comcast/traffic_control/traffic_ops/client"
+import "github.com/apache/incubator-trafficcontrol/traffic_ops/client"
 
 // Cachegroups returns a default CacheGroupResponse to be used for testing.
 func Cachegroups() *client.CacheGroupResponse {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/31defa09/traffic_ops/client/fixtures/cdn.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/fixtures/cdn.go b/traffic_ops/client/fixtures/cdn.go
index 497919f..b22e2f7 100644
--- a/traffic_ops/client/fixtures/cdn.go
+++ b/traffic_ops/client/fixtures/cdn.go
@@ -16,7 +16,7 @@
 
 package fixtures
 
-import "github.com/Comcast/traffic_control/traffic_ops/client"
+import "github.com/apache/incubator-trafficcontrol/traffic_ops/client"
 
 // CDNs returns a default CDNResponse to be used for testing.
 func CDNs() *client.CDNResponse {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/31defa09/traffic_ops/client/fixtures/delivery_service.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/fixtures/delivery_service.go b/traffic_ops/client/fixtures/delivery_service.go
index c09ed6a..9470638 100644
--- a/traffic_ops/client/fixtures/delivery_service.go
+++ b/traffic_ops/client/fixtures/delivery_service.go
@@ -16,7 +16,7 @@
 
 package fixtures
 
-import "github.com/Comcast/traffic_control/traffic_ops/client"
+import "github.com/apache/incubator-trafficcontrol/traffic_ops/client"
 
 // DeliveryServices returns a default DeliveryServiceResponse to be used for testing.
 func DeliveryServices() *client.DeliveryServiceResponse {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/31defa09/traffic_ops/client/fixtures/hardware.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/fixtures/hardware.go b/traffic_ops/client/fixtures/hardware.go
index 7e571b6..aeea909 100644
--- a/traffic_ops/client/fixtures/hardware.go
+++ b/traffic_ops/client/fixtures/hardware.go
@@ -16,7 +16,7 @@
 
 package fixtures
 
-import "github.com/Comcast/traffic_control/traffic_ops/client"
+import "github.com/apache/incubator-trafficcontrol/traffic_ops/client"
 
 // Hardware returns a default HardwareResponse to be used for testing.
 func Hardware() *client.HardwareResponse {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/31defa09/traffic_ops/client/fixtures/parameter.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/fixtures/parameter.go b/traffic_ops/client/fixtures/parameter.go
index d92621b..a7ae7c5 100644
--- a/traffic_ops/client/fixtures/parameter.go
+++ b/traffic_ops/client/fixtures/parameter.go
@@ -16,7 +16,7 @@
 
 package fixtures
 
-import "github.com/Comcast/traffic_control/traffic_ops/client"
+import "github.com/apache/incubator-trafficcontrol/traffic_ops/client"
 
 // Parameters returns a default ParamResponse to be used for testing.
 func Parameters() *client.ParamResponse {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/31defa09/traffic_ops/client/fixtures/profile.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/fixtures/profile.go b/traffic_ops/client/fixtures/profile.go
index 3773534..bb85097 100644
--- a/traffic_ops/client/fixtures/profile.go
+++ b/traffic_ops/client/fixtures/profile.go
@@ -16,7 +16,7 @@
 
 package fixtures
 
-import "github.com/Comcast/traffic_control/traffic_ops/client"
+import "github.com/apache/incubator-trafficcontrol/traffic_ops/client"
 
 // Profiles returns a default ProfileResponse to be used for testing.
 func Profiles() *client.ProfileResponse {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/31defa09/traffic_ops/client/fixtures/server.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/fixtures/server.go b/traffic_ops/client/fixtures/server.go
index e78e1b0..422fed4 100644
--- a/traffic_ops/client/fixtures/server.go
+++ b/traffic_ops/client/fixtures/server.go
@@ -16,7 +16,7 @@
 
 package fixtures
 
-import "github.com/Comcast/traffic_control/traffic_ops/client"
+import "github.com/apache/incubator-trafficcontrol/traffic_ops/client"
 
 // Servers returns a default ServerResponse to be used for testing.
 func Servers() *client.ServerResponse {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/31defa09/traffic_ops/client/fixtures/stats_summary.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/fixtures/stats_summary.go b/traffic_ops/client/fixtures/stats_summary.go
index c6997f1..a39af9e 100644
--- a/traffic_ops/client/fixtures/stats_summary.go
+++ b/traffic_ops/client/fixtures/stats_summary.go
@@ -16,7 +16,7 @@
 
 package fixtures
 
-import "github.com/Comcast/traffic_control/traffic_ops/client"
+import "github.com/apache/incubator-trafficcontrol/traffic_ops/client"
 
 // StatsSummary returns a default StatsSummaryResponse to be used for testing.
 func StatsSummary() *client.StatsSummaryResponse {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/31defa09/traffic_ops/client/fixtures/traffic_monitor_config.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/fixtures/traffic_monitor_config.go b/traffic_ops/client/fixtures/traffic_monitor_config.go
index 4af5f65..755d49c 100644
--- a/traffic_ops/client/fixtures/traffic_monitor_config.go
+++ b/traffic_ops/client/fixtures/traffic_monitor_config.go
@@ -1,6 +1,6 @@
 package fixtures
 
-import "github.com/Comcast/traffic_control/traffic_ops/client"
+import "github.com/apache/incubator-trafficcontrol/traffic_ops/client"
 
 // TrafficMonitorConfig returns a default TMConfigResponse to be used for testing.
 func TrafficMonitorConfig() *client.TMConfigResponse {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/31defa09/traffic_ops/client/fixtures/traffic_router_config.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/fixtures/traffic_router_config.go b/traffic_ops/client/fixtures/traffic_router_config.go
index efb8f04..c1eaa86 100644
--- a/traffic_ops/client/fixtures/traffic_router_config.go
+++ b/traffic_ops/client/fixtures/traffic_router_config.go
@@ -1,6 +1,6 @@
 package fixtures
 
-import "github.com/Comcast/traffic_control/traffic_ops/client"
+import "github.com/apache/incubator-trafficcontrol/traffic_ops/client"
 
 // TrafficRouterConfig returns a default TRConfigResponse to be used for testing.
 func TrafficRouterConfig() *client.TRConfigResponse {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/31defa09/traffic_ops/client/fixtures/types.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/fixtures/types.go b/traffic_ops/client/fixtures/types.go
index 11160d7..3d7d80b 100644
--- a/traffic_ops/client/fixtures/types.go
+++ b/traffic_ops/client/fixtures/types.go
@@ -16,7 +16,7 @@
 
 package fixtures
 
-import "github.com/Comcast/traffic_control/traffic_ops/client"
+import "github.com/apache/incubator-trafficcontrol/traffic_ops/client"
 
 // Types returns a default TypeResponse to be used for testing.
 func Types() *client.TypeResponse {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/31defa09/traffic_ops/client/fixtures/user.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/fixtures/user.go b/traffic_ops/client/fixtures/user.go
index 2575ca0..ebcf672 100644
--- a/traffic_ops/client/fixtures/user.go
+++ b/traffic_ops/client/fixtures/user.go
@@ -16,7 +16,7 @@
 
 package fixtures
 
-import "github.com/Comcast/traffic_control/traffic_ops/client"
+import "github.com/apache/incubator-trafficcontrol/traffic_ops/client"
 
 // Users returns a default UserResponse to be used for testing.
 func Users() *client.UserResponse {


[07/50] incubator-trafficcontrol git commit: fixes server config template

Posted by mi...@apache.org.
fixes server config template


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/2ee89425
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/2ee89425
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/2ee89425

Branch: refs/heads/master
Commit: 2ee8942589ae401b6b3f159e1e17c1cfd3e5a96f
Parents: 136ec75
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Thu Oct 20 08:42:14 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 traffic_ops/experimental/ui/conf/config-template.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/2ee89425/traffic_ops/experimental/ui/conf/config-template.js
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/conf/config-template.js b/traffic_ops/experimental/ui/conf/config-template.js
index 1822ad8..8effe10 100644
--- a/traffic_ops/experimental/ui/conf/config-template.js
+++ b/traffic_ops/experimental/ui/conf/config-template.js
@@ -34,7 +34,7 @@ module.exports = {
 	// set api 'base_url' to the traffic ops api (all api calls made from the traffic ops ui will be proxied to the api base_url)
 	// enter value for api 'key' if you want to append ?API_KEY=value to all api calls. It is suggested to leave blank.
 	api: {
-		base_url: 'http(s)://where-traffic-ops-api-is.com/api/',
+		base_url: 'http(s)://where-traffic-ops-api-is.com',
 		key: ''
 	},
 	// default files location (this is where the traffic ops html, css and javascript was installed)


[02/50] incubator-trafficcontrol git commit: Fix TM2 DS stat time to calculation, not request

Posted by mi...@apache.org.
Fix TM2 DS stat time to calculation, not request


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/4d8a3373
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/4d8a3373
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/4d8a3373

Branch: refs/heads/master
Commit: 4d8a33734b194ee35d04e1fdd6f06239a6fc157f
Parents: ba49773
Author: Robert Butts <ro...@gmail.com>
Authored: Tue Oct 25 10:24:48 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../experimental/traffic_monitor/deliveryservice/stat.go        | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/4d8a3373/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
index f2734bb..7c63cd1 100644
--- a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
+++ b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
@@ -20,6 +20,7 @@ import (
 // TODO remove DeliveryService and set type to the map directly, or add other members
 type Stats struct {
 	DeliveryService map[enum.DeliveryServiceName]dsdata.Stat `json:"deliveryService"`
+	Time            time.Time                                `json:"-"`
 }
 
 // Copy performs a deep copy of this Stats object.
@@ -28,6 +29,7 @@ func (s Stats) Copy() Stats {
 	for k, v := range s.DeliveryService {
 		b.DeliveryService[k] = v.Copy()
 	}
+	b.Time = s.Time
 	return b
 }
 
@@ -440,6 +442,7 @@ func CreateStats(statHistory map[enum.CacheName][]cache.Result, toData todata.TO
 
 	perSecStats, lastStats := addPerSecStats(statHistory, dsStats, lastStats, now, toData.ServerCachegroups, toData.ServerTypes)
 	log.Infof("CreateStats took %v\n", time.Since(start))
+	perSecStats.Time = time.Now()
 	return perSecStats, lastStats, nil
 }
 
@@ -485,7 +488,7 @@ func addCommonData(s *dsdata.StatsOld, c *dsdata.StatCommon, deliveryService enu
 // JSON returns an object formatted as expected to be serialized to JSON and served.
 func (s Stats) JSON(filter dsdata.Filter, params url.Values) dsdata.StatsOld {
 	// TODO fix to be the time calculated, not the time requested
-	now := time.Now().UnixNano() / int64(time.Millisecond) // Traffic Monitor 1.0 API is 'ms since the epoch'
+	now := s.Time.UnixNano() / int64(time.Millisecond) // Traffic Monitor 1.0 API is 'ms since the epoch'
 	jsonObj := &dsdata.StatsOld{
 		CommonAPIData:   srvhttp.GetCommonAPIData(params, time.Now()),
 		DeliveryService: map[enum.DeliveryServiceName]map[dsdata.StatName][]dsdata.StatOld{},


[27/50] incubator-trafficcontrol git commit: Fix TM2 range variable capture

Posted by mi...@apache.org.
Fix TM2 range variable capture


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/e7a5fb6b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/e7a5fb6b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/e7a5fb6b

Branch: refs/heads/master
Commit: e7a5fb6b34f0dae817299af82c2d1c99b3620c65
Parents: 105c35c
Author: Robert Butts <ro...@gmail.com>
Authored: Thu Oct 20 10:15:48 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../experimental/traffic_monitor/manager/opsconfig.go        | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e7a5fb6b/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go b/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
index 21349f7..875b67b 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
@@ -144,14 +144,10 @@ func StartOpsConfigManager(
 				// These must be in a goroutine, because the monitorConfigPoller tick sends to a channel this select listens for. Thus, if we block on sends to the monitorConfigPoller, we have a livelock race condition.
 				// More generically, we're using goroutines as an infinite chan buffer, to avoid potential livelocks
 				for _, subscriber := range opsConfigChangeSubscribers {
-					go func() {
-						subscriber <- newOpsConfig // this is needed for cdnName
-					}()
+					go func(s chan<- handler.OpsConfig) { s <- newOpsConfig }(subscriber)
 				}
 				for _, subscriber := range toChangeSubscribers {
-					go func() {
-						subscriber <- toSession
-					}()
+					go func(s chan<- towrap.ITrafficOpsSession) { s <- toSession }(subscriber)
 				}
 			}
 		}


[44/50] incubator-trafficcontrol git commit: Remove TM2 debug message

Posted by mi...@apache.org.
Remove TM2 debug message


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/286ed23f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/286ed23f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/286ed23f

Branch: refs/heads/master
Commit: 286ed23f11a5e93509fff42eed2e1f1f2e78de04
Parents: 3c17dab
Author: Robert Butts <ro...@gmail.com>
Authored: Fri Oct 21 15:36:24 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 traffic_monitor/experimental/traffic_monitor/srvhttp/srvhttp.go | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/286ed23f/traffic_monitor/experimental/traffic_monitor/srvhttp/srvhttp.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/srvhttp/srvhttp.go b/traffic_monitor/experimental/traffic_monitor/srvhttp/srvhttp.go
index a1ef6af..098c846 100644
--- a/traffic_monitor/experimental/traffic_monitor/srvhttp/srvhttp.go
+++ b/traffic_monitor/experimental/traffic_monitor/srvhttp/srvhttp.go
@@ -257,7 +257,6 @@ type GetDataFunc func(DataRequest) ([]byte, int)
 
 // ParametersStr takes the URL query parameters, and returns a string as used by the Traffic Monitor 1.0 endpoints "pp" key.
 func ParametersStr(params url.Values) string {
-	fmt.Println("debug4 ParametersStr 0")
 	pp := ""
 	for param, vals := range params {
 		for _, val := range vals {


[08/50] incubator-trafficcontrol git commit: Change TM2 common API data to a common struct.

Posted by mi...@apache.org.
Change TM2 common API data to a common struct.

Fixes #1960


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/43197ff7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/43197ff7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/43197ff7

Branch: refs/heads/master
Commit: 43197ff75fc08e8af8d8d8fd9a33d81f57f94683
Parents: b89f96a
Author: Robert Butts <ro...@gmail.com>
Authored: Wed Oct 19 15:27:40 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../experimental/traffic_monitor/cache/cache.go         | 10 ++++------
 .../traffic_monitor/deliveryservice/stat.go             |  3 +--
 .../traffic_monitor/deliveryservicedata/stat.go         |  5 ++---
 .../traffic_monitor/http_server/http_server.go          | 12 ++++++++++++
 .../experimental/traffic_monitor/manager/datarequest.go | 10 ++++------
 5 files changed, 23 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/43197ff7/traffic_monitor/experimental/traffic_monitor/cache/cache.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/cache/cache.go b/traffic_monitor/experimental/traffic_monitor/cache/cache.go
index eb54e42..3846964 100644
--- a/traffic_monitor/experimental/traffic_monitor/cache/cache.go
+++ b/traffic_monitor/experimental/traffic_monitor/cache/cache.go
@@ -73,9 +73,8 @@ type Stat struct {
 }
 
 type Stats struct {
-	Caches      map[enum.CacheName]map[string][]Stat `json:"caches"`
-	QueryParams string                               `json:"pp"`
-	DateStr     string                               `json:"date"`
+	Caches map[enum.CacheName]map[string][]Stat `json:"caches"`
+	CommonAPIData
 }
 
 type Filter interface {
@@ -93,9 +92,8 @@ const (
 // StatsMarshall encodes the stats in JSON, encoding up to historyCount of each stat. If statsToUse is empty, all stats are encoded; otherwise, only the given stats are encoded. If wildcard is true, stats which contain the text in each statsToUse are returned, instead of exact stat names. If cacheType is not CacheTypeInvalid, only stats for the given type are returned. If hosts is not empty, only the given hosts are returned.
 func StatsMarshall(statHistory map[enum.CacheName][]Result, filter Filter, params url.Values) ([]byte, error) {
 	stats := Stats{
-		Caches:      map[enum.CacheName]map[string][]Stat{},
-		QueryParams: http_server.ParametersStr(params),
-		DateStr:     http_server.DateStr(time.Now()),
+		Caches:        map[enum.CacheName]map[string][]Stat{},
+		CommonAPIData: http_server.GetCommonAPIData(params, time.Now()),
 	}
 
 	// TODO in 1.0, stats are divided into 'location', 'cache', and 'type'. 'cache' are hidden by default.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/43197ff7/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
index 8b72163..3ff93d2 100644
--- a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
+++ b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
@@ -475,8 +475,7 @@ func (dsStats Stats) JSON(filter dsdata.Filter, params url.Values) dsdata.StatsO
 	now := time.Now().Unix()
 	jsonObj := &dsdata.StatsOld{
 		DeliveryService: map[enum.DeliveryServiceName]map[dsdata.StatName][]dsdata.StatOld{},
-		QueryParams:     http_server.ParametersStr(params),
-		DateStr:         http_server.DateStr(time.Now()),
+		CommonAPIData:   http_server.GetCommonAPIData(params, time.Now()),
 	}
 
 	for deliveryService, stat := range dsStats.DeliveryService {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/43197ff7/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go b/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
index 16680e4..f60163d 100644
--- a/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
+++ b/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
@@ -22,11 +22,10 @@ type StatOld struct {
 	Span  int    `json:"span,omitempty"`  // TODO set? remove?
 	Index int    `json:"index,omitempty"` // TODO set? remove?
 }
+
 type StatsOld struct {
-	// TODO move QueryParams, DateStr to a 'EndpointCommon' struct
 	DeliveryService map[enum.DeliveryServiceName]map[StatName][]StatOld `json:"deliveryService"`
-	QueryParams     string                                              `json:"pp"`
-	DateStr         string                                              `json:"date"`
+	CommonAPIData
 }
 
 type StatsReadonly interface {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/43197ff7/traffic_monitor/experimental/traffic_monitor/http_server/http_server.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/http_server/http_server.go b/traffic_monitor/experimental/traffic_monitor/http_server/http_server.go
index 95f9f9b..6206cfd 100644
--- a/traffic_monitor/experimental/traffic_monitor/http_server/http_server.go
+++ b/traffic_monitor/experimental/traffic_monitor/http_server/http_server.go
@@ -12,6 +12,18 @@ import (
 	"time"
 )
 
+func GetCommonAPIData(params url.Values, time time.Time) CommonAPIData {
+	return CommonAPIData{
+		QueryParams: ParametersStr(params),
+		DateStr:     DateStr(time.Now()),
+	}
+}
+
+type CommonAPIData struct {
+	QueryParams string `json:"pp"`
+	DateStr     string `json:"date"`
+}
+
 // Server is a re-runnable HTTP server. Server.Run() may be called repeatedly, and
 // each time the previous running server will be stopped, and the server will be
 // restarted with the new port address and data request channel.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/43197ff7/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go b/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
index 4651aa3..7d91e5c 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
@@ -31,9 +31,8 @@ type CacheState struct {
 }
 
 type ApiPeerStates struct {
-	Peers       map[enum.TrafficMonitorName]map[enum.CacheName][]CacheState `json:"peers"`
-	QueryParams string                                                      `json:"pp"`
-	DateStr     string                                                      `json:"date"`
+	Peers map[enum.TrafficMonitorName]map[enum.CacheName][]CacheState `json:"peers"`
+	CommonAPIData
 }
 
 // TODO make fields nullable, so error fields can be omitted, letting API callers still get updates for unerrored fields
@@ -674,9 +673,8 @@ func cacheAvailableCount(caches map[enum.CacheName]peer.IsAvailable) int {
 
 func createApiPeerStates(peerStates map[enum.TrafficMonitorName]peer.Crstates, filter *PeerStateFilter, params url.Values) ApiPeerStates {
 	apiPeerStates := ApiPeerStates{
-		Peers:       map[enum.TrafficMonitorName]map[enum.CacheName][]CacheState{},
-		QueryParams: http_server.ParametersStr(params),
-		DateStr:     http_server.DateStr(time.Now()),
+		Peers:         map[enum.TrafficMonitorName]map[enum.CacheName][]CacheState{},
+		CommonAPIData: http_server.GetCommonAPIData(params, time.Now()),
 	}
 
 	for peer, state := range peerStates {


[05/50] incubator-trafficcontrol git commit: Add TM2 config for server read and write timeouts

Posted by mi...@apache.org.
Add TM2 config for server read and write timeouts


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/b89f96af
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/b89f96af
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/b89f96af

Branch: refs/heads/master
Commit: b89f96af904a07f666a95e9427457c871539bf36
Parents: c557610
Author: Robert Butts <ro...@gmail.com>
Authored: Mon Oct 17 15:42:04 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../experimental/traffic_monitor/config/config.go     | 14 ++++++++++++++
 .../traffic_monitor/http_server/http_server.go        |  6 +++---
 .../experimental/traffic_monitor/manager/manager.go   |  1 +
 .../experimental/traffic_monitor/manager/opsconfig.go |  4 +++-
 .../traffic_monitor-example-config.json               |  4 +++-
 5 files changed, 24 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b89f96af/traffic_monitor/experimental/traffic_monitor/config/config.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/config/config.go b/traffic_monitor/experimental/traffic_monitor/config/config.go
index 1ca4b80..316651a 100644
--- a/traffic_monitor/experimental/traffic_monitor/config/config.go
+++ b/traffic_monitor/experimental/traffic_monitor/config/config.go
@@ -27,6 +27,8 @@ type Config struct {
 	LogLocationWarning           string        `json:"log_location_warning"`
 	LogLocationInfo              string        `json:"log_location_info"`
 	LogLocationDebug             string        `json:"log_location_debug"`
+	ServeReadTimeout             time.Duration `json:"-"`
+	ServeWriteTimeout            time.Duration `json:"-"`
 }
 
 var DefaultConfig = Config{
@@ -44,6 +46,8 @@ var DefaultConfig = Config{
 	LogLocationWarning:           LogLocationStdout,
 	LogLocationInfo:              LogLocationNull,
 	LogLocationDebug:             LogLocationNull,
+	ServeReadTimeout:             10 * time.Second,
+	ServeWriteTimeout:            10 * time.Second,
 }
 
 // MarshalJSON marshals custom millisecond durations. Aliasing inspired by http://choly.ca/post/go-json-marshalling/
@@ -57,6 +61,8 @@ func (c *Config) MarshalJSON() ([]byte, error) {
 		PeerPollingIntervalMs          uint64 `json:"peer_polling_interval_ms"`
 		HealthFlushIntervalMs          uint64 `json:"health_flush_interval_ms"`
 		StatFlushIntervalMs            uint64 `json:"stat_flush_interval_ms"`
+		ServeReadTimeoutMs             uint64 `json:"serve_read_timeout_ms"`
+		ServeWriteTimeoutMs            uint64 `json:"serve_write_timeout_ms"`
 		*Alias
 	}{
 		CacheHealthPollingIntervalMs:   uint64(c.CacheHealthPollingInterval / time.Millisecond),
@@ -80,6 +86,8 @@ func (c *Config) UnmarshalJSON(data []byte) error {
 		PeerPollingIntervalMs          *uint64 `json:"peer_polling_interval_ms"`
 		HealthFlushIntervalMs          *uint64 `json:"health_flush_interval_ms"`
 		StatFlushIntervalMs            *uint64 `json:"stat_flush_interval_ms"`
+		ServeReadTimeoutMs             *uint64 `json:"serve_read_timeout_ms"`
+		ServeWriteTimeoutMs            *uint64 `json:"serve_write_timeout_ms"`
 		*Alias
 	}{
 		Alias: (*Alias)(c),
@@ -109,6 +117,12 @@ func (c *Config) UnmarshalJSON(data []byte) error {
 	if aux.StatFlushIntervalMs != nil {
 		c.StatFlushInterval = time.Duration(*aux.StatFlushIntervalMs) * time.Millisecond
 	}
+	if aux.ServeReadTimeoutMs != nil {
+		c.ServeReadTimeout = time.Duration(*aux.ServeReadTimeoutMs) * time.Millisecond
+	}
+	if aux.ServeWriteTimeoutMs != nil {
+		c.ServeWriteTimeout = time.Duration(*aux.ServeWriteTimeoutMs) * time.Millisecond
+	}
 	return nil
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b89f96af/traffic_monitor/experimental/traffic_monitor/http_server/http_server.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/http_server/http_server.go b/traffic_monitor/experimental/traffic_monitor/http_server/http_server.go
index fb70d72..95f9f9b 100644
--- a/traffic_monitor/experimental/traffic_monitor/http_server/http_server.go
+++ b/traffic_monitor/experimental/traffic_monitor/http_server/http_server.go
@@ -85,7 +85,7 @@ func (s Server) registerEndpoints(sm *http.ServeMux) error {
 // Run runs a new HTTP service at the given addr, making data requests to the given c.
 // Run may be called repeatedly, and each time, will shut down any existing service first.
 // Run is NOT threadsafe, and MUST NOT be called concurrently by multiple goroutines.
-func (s Server) Run(f GetDataFunc, addr string) error {
+func (s Server) Run(f GetDataFunc, addr string, readTimeout time.Duration, writeTimeout time.Duration) error {
 	// TODO make an object, which itself is not threadsafe, but which encapsulates all data so multiple
 	//      objects can be created and Run.
 
@@ -115,8 +115,8 @@ func (s Server) Run(f GetDataFunc, addr string) error {
 	server := &http.Server{
 		Addr:           addr,
 		Handler:        sm,
-		ReadTimeout:    10 * time.Second,
-		WriteTimeout:   10 * time.Second,
+		ReadTimeout:    readTimeout,
+		WriteTimeout:   writeTimeout,
 		MaxHeaderBytes: 1 << 20,
 	}
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b89f96af/traffic_monitor/experimental/traffic_monitor/manager/manager.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/manager.go b/traffic_monitor/experimental/traffic_monitor/manager/manager.go
index d86fad1..003fb31 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/manager.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/manager.go
@@ -130,6 +130,7 @@ func Start(opsConfigFile string, cfg config.Config, staticAppData StaticAppData)
 		errorCount,
 		localCacheStatus,
 		unpolledCaches,
+		cfg,
 	)
 
 	healthTickListener(cacheHealthPoller.TickChan, healthIteration)

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b89f96af/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go b/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
index fd41a12..21349f7 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
@@ -8,6 +8,7 @@ import (
 	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/handler"
 	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/log"
 	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/poller"
+	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/config"
 	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/http_server"
 	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/peer"
 	todata "github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
@@ -59,6 +60,7 @@ func StartOpsConfigManager(
 	errorCount UintThreadsafe,
 	localCacheStatus CacheAvailableStatusThreadsafe,
 	unpolledCaches UnpolledCachesThreadsafe,
+	cfg config.Config,
 ) OpsConfigThreadsafe {
 
 	opsConfigFileChannel := make(chan interface{})
@@ -121,7 +123,7 @@ func StartOpsConfigManager(
 						lastStats,
 						unpolledCaches,
 					)
-				}, listenAddress)
+				}, listenAddress, cfg.ServeReadTimeout, cfg.ServeWriteTimeout)
 				if err != nil {
 					handleErr(fmt.Errorf("MonitorConfigPoller: error creating HTTP server: %s\n", err))
 					continue

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b89f96af/traffic_monitor/experimental/traffic_monitor/traffic_monitor-example-config.json
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/traffic_monitor-example-config.json b/traffic_monitor/experimental/traffic_monitor/traffic_monitor-example-config.json
index 9493dd2..bf40325 100644
--- a/traffic_monitor/experimental/traffic_monitor/traffic_monitor-example-config.json
+++ b/traffic_monitor/experimental/traffic_monitor/traffic_monitor-example-config.json
@@ -12,5 +12,7 @@
 	"log_location_error": "stderr",
 	"log_location_warning": "stdout",
 	"log_location_info": "null",
-	"log_location_debug": "null"
+	"log_location_debug": "null",
+	"serve_read_timeout_ms": 10000,
+	"serve_write_timeout_ms": 10000
 }


[33/50] incubator-trafficcontrol git commit: Rename TM2 http_server to idiomatic srvhttp

Posted by mi...@apache.org.
Rename TM2 http_server to idiomatic srvhttp


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/95ab789c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/95ab789c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/95ab789c

Branch: refs/heads/master
Commit: 95ab789ce58f57087b45869b0b519d45ea0b6ac4
Parents: b59a93f
Author: Robert Butts <ro...@gmail.com>
Authored: Thu Oct 20 15:41:51 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../experimental/traffic_monitor/cache/cache.go |   6 +-
 .../traffic_monitor/deliveryservice/stat.go     |   4 +-
 .../traffic_monitor/deliveryservicedata/stat.go |   4 +-
 .../traffic_monitor/http_server/http_server.go  | 299 -------------------
 .../traffic_monitor/manager/datarequest.go      |  48 +--
 .../traffic_monitor/manager/opsconfig.go        |   6 +-
 .../traffic_monitor/srvhttp/srvhttp.go          | 299 +++++++++++++++++++
 7 files changed, 333 insertions(+), 333 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/95ab789c/traffic_monitor/experimental/traffic_monitor/cache/cache.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/cache/cache.go b/traffic_monitor/experimental/traffic_monitor/cache/cache.go
index aa3a920..20eb2a5 100644
--- a/traffic_monitor/experimental/traffic_monitor/cache/cache.go
+++ b/traffic_monitor/experimental/traffic_monitor/cache/cache.go
@@ -6,7 +6,7 @@ import (
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/log"
 	dsdata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/deliveryservicedata"
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/enum"
-	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/http_server"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/srvhttp"
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/peer"
 	todata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
 	"io"
@@ -73,7 +73,7 @@ type Stat struct {
 }
 
 type Stats struct {
-	http_server.CommonAPIData
+	srvhttp.CommonAPIData
 	Caches map[enum.CacheName]map[string][]Stat `json:"caches"`
 }
 
@@ -86,7 +86,7 @@ type Filter interface {
 // StatsMarshall encodes the stats in JSON, encoding up to historyCount of each stat. If statsToUse is empty, all stats are encoded; otherwise, only the given stats are encoded. If wildcard is true, stats which contain the text in each statsToUse are returned, instead of exact stat names. If cacheType is not CacheTypeInvalid, only stats for the given type are returned. If hosts is not empty, only the given hosts are returned.
 func StatsMarshall(statHistory map[enum.CacheName][]Result, filter Filter, params url.Values) ([]byte, error) {
 	stats := Stats{
-		CommonAPIData: http_server.GetCommonAPIData(params, time.Now()),
+		CommonAPIData: srvhttp.GetCommonAPIData(params, time.Now()),
 		Caches:        map[enum.CacheName]map[string][]Stat{},
 	}
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/95ab789c/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
index d2b8821..f80fcdf 100644
--- a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
+++ b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
@@ -6,7 +6,7 @@ import (
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/cache"
 	dsdata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/deliveryservicedata"
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/enum"
-	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/http_server"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/srvhttp"
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/peer"
 	todata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
 	"net/url"
@@ -474,7 +474,7 @@ func addCommonData(s *dsdata.StatsOld, c *dsdata.StatCommon, deliveryService enu
 func (dsStats Stats) JSON(filter dsdata.Filter, params url.Values) dsdata.StatsOld {
 	now := time.Now().Unix()
 	jsonObj := &dsdata.StatsOld{
-		CommonAPIData:   http_server.GetCommonAPIData(params, time.Now()),
+		CommonAPIData:   srvhttp.GetCommonAPIData(params, time.Now()),
 		DeliveryService: map[enum.DeliveryServiceName]map[dsdata.StatName][]dsdata.StatOld{},
 	}
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/95ab789c/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go b/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
index e2f6e0f..3ddc2c8 100644
--- a/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
+++ b/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
@@ -3,7 +3,7 @@ package deliveryservicedata // TODO rename?
 import (
 	"errors"
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/enum"
-	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/http_server"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/srvhttp"
 	"net/url"
 	"time"
 )
@@ -26,7 +26,7 @@ type StatOld struct {
 
 type StatsOld struct {
 	DeliveryService map[enum.DeliveryServiceName]map[StatName][]StatOld `json:"deliveryService"`
-	http_server.CommonAPIData
+	srvhttp.CommonAPIData
 }
 
 type StatsReadonly interface {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/95ab789c/traffic_monitor/experimental/traffic_monitor/http_server/http_server.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/http_server/http_server.go b/traffic_monitor/experimental/traffic_monitor/http_server/http_server.go
deleted file mode 100644
index ab0668e..0000000
--- a/traffic_monitor/experimental/traffic_monitor/http_server/http_server.go
+++ /dev/null
@@ -1,299 +0,0 @@
-package http_server
-
-import (
-	"fmt"
-	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/log"
-	"github.com/hydrogen18/stoppableListener"
-	"io/ioutil"
-	"net"
-	"net/http"
-	"net/url"
-	"sync"
-	"time"
-)
-
-func GetCommonAPIData(params url.Values, t time.Time) CommonAPIData {
-	return CommonAPIData{
-		QueryParams: ParametersStr(params),
-		DateStr:     DateStr(t),
-	}
-}
-
-type CommonAPIData struct {
-	QueryParams string `json:"pp"`
-	DateStr     string `json:"date"`
-}
-
-// Server is a re-runnable HTTP server. Server.Run() may be called repeatedly, and
-// each time the previous running server will be stopped, and the server will be
-// restarted with the new port address and data request channel.
-type Server struct {
-	getData                    GetDataFunc
-	stoppableListener          *stoppableListener.StoppableListener
-	stoppableListenerWaitGroup sync.WaitGroup
-}
-
-// Endpoints returns a map of HTTP paths to functions.
-// This is a function because Go doesn't have constant map literals.
-func (s Server) endpoints() (map[string]http.HandlerFunc, error) {
-	handleRoot, err := s.handleRootFunc()
-	handleSortableJs, err := s.handleSortableFunc()
-	if err != nil {
-		return nil, fmt.Errorf("Error getting root endpoint: %v", err)
-	}
-
-	// note: with the trailing slash, any non-trailing slash requests will get a 301 redirect
-	return map[string]http.HandlerFunc{
-		"/publish/CacheStats/":          s.dataRequestFunc(CacheStats),
-		"/publish/CacheStats":           s.dataRequestFunc(CacheStats),
-		"/publish/CrConfig/":            s.dataRequestFunc(TRConfig),
-		"/publish/CrConfig":             s.dataRequestFunc(TRConfig),
-		"/publish/CrStates/":            s.handleCrStatesFunc(),
-		"/publish/CrStates":             s.handleCrStatesFunc(),
-		"/publish/DsStats/":             s.dataRequestFunc(DSStats),
-		"/publish/DsStats":              s.dataRequestFunc(DSStats),
-		"/publish/EventLog/":            s.dataRequestFunc(EventLog),
-		"/publish/EventLog":             s.dataRequestFunc(EventLog),
-		"/publish/PeerStates/":          s.dataRequestFunc(PeerStates),
-		"/publish/PeerStates":           s.dataRequestFunc(PeerStates),
-		"/publish/StatSummary/":         s.dataRequestFunc(StatSummary),
-		"/publish/StatSummary":          s.dataRequestFunc(StatSummary),
-		"/publish/Stats/":               s.dataRequestFunc(Stats),
-		"/publish/Stats":                s.dataRequestFunc(Stats),
-		"/publish/ConfigDoc/":           s.dataRequestFunc(ConfigDoc),
-		"/publish/ConfigDoc":            s.dataRequestFunc(ConfigDoc),
-		"/api/cache-count/":             s.dataRequestFunc(APICacheCount),
-		"/api/cache-count":              s.dataRequestFunc(APICacheCount),
-		"/api/cache-available-count/":   s.dataRequestFunc(APICacheAvailableCount),
-		"/api/cache-available-count":    s.dataRequestFunc(APICacheAvailableCount),
-		"/api/cache-down-count/":        s.dataRequestFunc(APICacheDownCount),
-		"/api/cache-down-count":         s.dataRequestFunc(APICacheDownCount),
-		"/api/version/":                 s.dataRequestFunc(APIVersion),
-		"/api/version":                  s.dataRequestFunc(APIVersion),
-		"/api/traffic-ops-uri/":         s.dataRequestFunc(APITrafficOpsURI),
-		"/api/traffic-ops-uri":          s.dataRequestFunc(APITrafficOpsURI),
-		"/api/cache-statuses/":          s.dataRequestFunc(APICacheStates),
-		"/api/cache-statuses":           s.dataRequestFunc(APICacheStates),
-		"/api/bandwidth-kbps/":          s.dataRequestFunc(APIBandwidthKbps),
-		"/api/bandwidth-kbps":           s.dataRequestFunc(APIBandwidthKbps),
-		"/api/bandwidth-capacity-kbps/": s.dataRequestFunc(APIBandwidthCapacityKbps),
-		"/api/bandwidth-capacity-kbps":  s.dataRequestFunc(APIBandwidthCapacityKbps),
-		"/":             handleRoot,
-		"/sorttable.js": handleSortableJs,
-	}, nil
-}
-
-func (s Server) registerEndpoints(sm *http.ServeMux) error {
-	endpoints, err := s.endpoints()
-	if err != nil {
-		return err
-	}
-	for path, f := range endpoints {
-		sm.HandleFunc(path, f)
-	}
-	return nil
-}
-
-// Run runs a new HTTP service at the given addr, making data requests to the given c.
-// Run may be called repeatedly, and each time, will shut down any existing service first.
-// Run is NOT threadsafe, and MUST NOT be called concurrently by multiple goroutines.
-func (s Server) Run(f GetDataFunc, addr string, readTimeout time.Duration, writeTimeout time.Duration) error {
-	// TODO make an object, which itself is not threadsafe, but which encapsulates all data so multiple
-	//      objects can be created and Run.
-
-	if s.stoppableListener != nil {
-		log.Infof("Stopping Web Server\n")
-		s.stoppableListener.Stop()
-		s.stoppableListenerWaitGroup.Wait()
-	}
-	log.Infof("Starting Web Server\n")
-
-	var err error
-	var originalListener net.Listener
-	if originalListener, err = net.Listen("tcp", addr); err != nil {
-		return err
-	}
-	if s.stoppableListener, err = stoppableListener.New(originalListener); err != nil {
-		return err
-	}
-
-	s.getData = f
-
-	sm := http.NewServeMux()
-	err = s.registerEndpoints(sm)
-	if err != nil {
-		return err
-	}
-	server := &http.Server{
-		Addr:           addr,
-		Handler:        sm,
-		ReadTimeout:    readTimeout,
-		WriteTimeout:   writeTimeout,
-		MaxHeaderBytes: 1 << 20,
-	}
-
-	s.stoppableListenerWaitGroup = sync.WaitGroup{}
-	s.stoppableListenerWaitGroup.Add(1)
-	go func() {
-		defer s.stoppableListenerWaitGroup.Done()
-		server.Serve(s.stoppableListener)
-	}()
-
-	log.Infof("Web server listening on %s", addr)
-	return nil
-}
-
-type Type int
-
-const (
-	TRConfig Type = (1 << iota)
-	TRStateDerived
-	TRStateSelf
-	CacheStats
-	DSStats
-	EventLog
-	PeerStates
-	StatSummary
-	Stats
-	ConfigDoc
-	APICacheCount
-	APICacheAvailableCount
-	APICacheDownCount
-	APIVersion
-	APITrafficOpsURI
-	APICacheStates
-	APIBandwidthKbps
-	APIBandwidthCapacityKbps
-)
-
-func (t Type) String() string {
-	switch t {
-	case TRConfig:
-		return "TRConfig"
-	case TRStateDerived:
-		return "TRStateDerived"
-	case TRStateSelf:
-		return "TRStateSelf"
-	case CacheStats:
-		return "CacheStats"
-	case DSStats:
-		return "DSStats"
-	case EventLog:
-		return "EventLog"
-	case PeerStates:
-		return "PeerStates"
-	case StatSummary:
-		return "StatSummary"
-	case Stats:
-		return "Stats"
-	case ConfigDoc:
-		return "ConfigDoc"
-	case APICacheCount:
-		return "APICacheCount"
-	case APICacheAvailableCount:
-		return "APICacheAvailableCount"
-	case APICacheDownCount:
-		return "APICacheDownCount"
-	case APIVersion:
-		return "APIVersion"
-	case APITrafficOpsURI:
-		return "APITrafficOpsURI"
-	case APICacheStates:
-		return "APICacheStates"
-	case APIBandwidthKbps:
-		return "APIBandwidthKbps"
-	case APIBandwidthCapacityKbps:
-		return "APIBandwidthCapacityKbps"
-	default:
-		return "Invalid"
-	}
-}
-
-type Format int
-
-const (
-	XML Format = (1 << iota)
-	JSON
-)
-
-type DataRequest struct {
-	Type
-	Format
-	Date       string
-	Parameters map[string][]string
-}
-
-type GetDataFunc func(DataRequest) ([]byte, int)
-
-// ParametersStr takes the URL query parameters, and returns a string as used by the Traffic Monitor 1.0 endpoints "pp" key.
-func ParametersStr(params url.Values) string {
-	fmt.Println("debug4 ParametersStr 0")
-	pp := ""
-	for param, vals := range params {
-		for _, val := range vals {
-			pp += param + "=[" + val + "], "
-		}
-	}
-	if len(pp) > 2 {
-		pp = pp[:len(pp)-2]
-	}
-	return pp
-}
-
-// DateStr returns the given time in the format expected by Traffic Monitor 1.0 API users
-func DateStr(t time.Time) string {
-	return t.UTC().Format("Mon Jan 02 15:04:05 UTC 2006")
-}
-
-func (s Server) dataRequest(w http.ResponseWriter, req *http.Request, t Type, f Format) {
-	//pp: "0=[my-ats-edge-cache-0], hc=[1]",
-	//dateLayout := "Thu Oct 09 20:28:36 UTC 2014"
-	dateLayout := "Mon Jan 02 15:04:05 MST 2006"
-	data, responseCode := s.getData(DataRequest{
-		Type:       t,
-		Format:     f,
-		Date:       time.Now().UTC().Format(dateLayout),
-		Parameters: req.URL.Query(),
-	})
-	if len(data) > 0 {
-		w.WriteHeader(responseCode)
-		w.Write(data)
-	} else {
-		w.WriteHeader(http.StatusInternalServerError)
-		w.Write([]byte("Internal Server Error"))
-	}
-}
-
-func (s Server) handleRootFunc() (http.HandlerFunc, error) {
-	return s.handleFile("index.html")
-}
-
-func (s Server) handleSortableFunc() (http.HandlerFunc, error) {
-	return s.handleFile("sorttable.js")
-}
-
-func (s Server) handleFile(name string) (http.HandlerFunc, error) {
-	index, err := ioutil.ReadFile(name)
-	if err != nil {
-		return nil, err
-	}
-	return func(w http.ResponseWriter, req *http.Request) {
-		fmt.Fprintf(w, "%s", index)
-	}, nil
-}
-
-func (s Server) handleCrStatesFunc() http.HandlerFunc {
-	return func(w http.ResponseWriter, req *http.Request) {
-		t := TRStateDerived
-		if req.URL.RawQuery == "raw" {
-			t = TRStateSelf
-		}
-		s.dataRequest(w, req, t, JSON)
-	}
-}
-
-func (s Server) dataRequestFunc(t Type) http.HandlerFunc {
-	return func(w http.ResponseWriter, r *http.Request) {
-		s.dataRequest(w, r, t, JSON)
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/95ab789c/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go b/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
index 6c578cb..52d2d17 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
@@ -16,7 +16,7 @@ import (
 	ds "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/deliveryservice"
 	dsdata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/deliveryservicedata"
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/enum"
-	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/http_server"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/srvhttp"
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/peer"
 	todata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
 	towrap "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopswrapper"
@@ -31,7 +31,7 @@ type CacheState struct {
 }
 
 type ApiPeerStates struct {
-	http_server.CommonAPIData
+	srvhttp.CommonAPIData
 	Peers map[enum.TrafficMonitorName]map[enum.CacheName][]CacheState `json:"peers"`
 }
 
@@ -398,9 +398,9 @@ func NewPeerStateFilter(params url.Values, cacheTypes map[enum.CacheName]enum.Ca
 	}, nil
 }
 
-// DataRequest takes an `http_server.DataRequest`, and the monitored data objects, and returns the appropriate response, and the status code.
+// DataRequest takes an `srvhttp.DataRequest`, and the monitored data objects, and returns the appropriate response, and the status code.
 func DataRequest(
-	req http_server.DataRequest,
+	req srvhttp.DataRequest,
 	opsConfig OpsConfigThreadsafe,
 	toSession towrap.ITrafficOpsSession,
 	localStates peer.CRStatesThreadsafe,
@@ -430,7 +430,7 @@ func DataRequest(
 		log.Errorf("Request Error: %v\n", fmt.Errorf(req.Type.String()+": %v", err))
 	}
 
-	// commonReturn takes the body, err, and the data request Type which has been processed. It logs and deals with any error, and returns the appropriate bytes and response code for the `http_server`.
+	// commonReturn takes the body, err, and the data request Type which has been processed. It logs and deals with any error, and returns the appropriate bytes and response code for the `srvhttp`.
 	commonReturn := func(body []byte, err error) ([]byte, int) {
 		if err == nil {
 			return body, http.StatusOK
@@ -446,7 +446,7 @@ func DataRequest(
 
 	var err error
 	switch req.Type {
-	case http_server.TRConfig:
+	case srvhttp.TRConfig:
 		cdnName := opsConfig.Get().CdnName
 		if toSession == nil {
 			return commonReturn(nil, fmt.Errorf("Unable to connect to Traffic Ops"))
@@ -455,13 +455,13 @@ func DataRequest(
 			return commonReturn(nil, fmt.Errorf("No CDN Configured"))
 		}
 		return commonReturn(body, err)
-	case http_server.TRStateDerived:
+	case srvhttp.TRStateDerived:
 		body, err = peer.CrstatesMarshall(combinedStates.Get())
 		return commonReturn(body, err)
-	case http_server.TRStateSelf:
+	case srvhttp.TRStateSelf:
 		body, err = peer.CrstatesMarshall(localStates.Get())
 		return commonReturn(body, err)
-	case http_server.CacheStats:
+	case srvhttp.CacheStats:
 		filter, err := NewCacheStatFilter(req.Parameters, toData.Get().ServerTypes)
 		if err != nil {
 			handleErr(err)
@@ -469,7 +469,7 @@ func DataRequest(
 		}
 		body, err = cache.StatsMarshall(statHistory.Get(), filter, req.Parameters)
 		return commonReturn(body, err)
-	case http_server.DSStats:
+	case srvhttp.DSStats:
 		filter, err := NewDSStatFilter(req.Parameters, toData.Get().DeliveryServiceTypes)
 		if err != nil {
 			handleErr(err)
@@ -477,10 +477,10 @@ func DataRequest(
 		}
 		body, err = json.Marshal(dsStats.Get().JSON(filter, req.Parameters)) // TODO marshall beforehand, for performance? (test to see how often requests are made)
 		return commonReturn(body, err)
-	case http_server.EventLog:
+	case srvhttp.EventLog:
 		body, err = json.Marshal(JSONEvents{Events: events.Get()})
 		return commonReturn(body, err)
-	case http_server.PeerStates:
+	case srvhttp.PeerStates:
 		filter, err := NewPeerStateFilter(req.Parameters, toData.Get().ServerTypes)
 		if err != nil {
 			handleErr(err)
@@ -489,12 +489,12 @@ func DataRequest(
 
 		body, err = json.Marshal(createApiPeerStates(peerStates.Get(), filter, req.Parameters))
 		return commonReturn(body, err)
-	case http_server.StatSummary:
+	case srvhttp.StatSummary:
 		return nil, http.StatusNotImplemented
-	case http_server.Stats:
+	case srvhttp.Stats:
 		body, err = getStats(staticAppData, healthPollInterval, lastHealthDurations.Get(), fetchCount.Get(), healthIteration.Get(), errorCount.Get())
 		return commonReturn(body, err)
-	case http_server.ConfigDoc:
+	case srvhttp.ConfigDoc:
 		opsConfigCopy := opsConfig.Get()
 		// if the password is blank, leave it blank, so callers can see it's missing.
 		if opsConfigCopy.Password != "" {
@@ -502,13 +502,13 @@ func DataRequest(
 		}
 		body, err = json.Marshal(opsConfigCopy)
 		return commonReturn(body, err)
-	case http_server.APICacheCount: // TODO determine if this should use peerStates
+	case srvhttp.APICacheCount: // TODO determine if this should use peerStates
 		return []byte(strconv.Itoa(len(localStates.Get().Caches))), http.StatusOK
-	case http_server.APICacheAvailableCount:
+	case srvhttp.APICacheAvailableCount:
 		return []byte(strconv.Itoa(cacheAvailableCount(localStates.Get().Caches))), http.StatusOK
-	case http_server.APICacheDownCount:
+	case srvhttp.APICacheDownCount:
 		return []byte(strconv.Itoa(cacheDownCount(localStates.Get().Caches))), http.StatusOK
-	case http_server.APIVersion:
+	case srvhttp.APIVersion:
 		s := "traffic_monitor-" + staticAppData.Version + "."
 		if len(staticAppData.GitRevision) > 6 {
 			s += staticAppData.GitRevision[:6]
@@ -516,13 +516,13 @@ func DataRequest(
 			s += staticAppData.GitRevision
 		}
 		return []byte(s), http.StatusOK
-	case http_server.APITrafficOpsURI:
+	case srvhttp.APITrafficOpsURI:
 		return []byte(opsConfig.Get().Url), http.StatusOK
-	case http_server.APICacheStates:
+	case srvhttp.APICacheStates:
 		body, err = json.Marshal(createCacheStatuses(toData.Get().ServerTypes, statHistory.Get(),
 			lastHealthDurations.Get(), localStates.Get().Caches, lastStats.Get(), localCacheStatus))
 		return commonReturn(body, err)
-	case http_server.APIBandwidthKbps:
+	case srvhttp.APIBandwidthKbps:
 		serverTypes := toData.Get().ServerTypes
 		kbpsStats := lastStats.Get()
 		sum := float64(0.0)
@@ -533,7 +533,7 @@ func DataRequest(
 			sum += data.Bytes.PerSec / ds.BytesPerKilobit
 		}
 		return []byte(fmt.Sprintf("%f", sum)), http.StatusOK
-	case http_server.APIBandwidthCapacityKbps:
+	case srvhttp.APIBandwidthCapacityKbps:
 		statHistory := statHistory.Get()
 		cap := int64(0)
 		for _, results := range statHistory {
@@ -673,7 +673,7 @@ func cacheAvailableCount(caches map[enum.CacheName]peer.IsAvailable) int {
 
 func createApiPeerStates(peerStates map[enum.TrafficMonitorName]peer.Crstates, filter *PeerStateFilter, params url.Values) ApiPeerStates {
 	apiPeerStates := ApiPeerStates{
-		CommonAPIData: http_server.GetCommonAPIData(params, time.Now()),
+		CommonAPIData: srvhttp.GetCommonAPIData(params, time.Now()),
 		Peers:         map[enum.TrafficMonitorName]map[enum.CacheName][]CacheState{},
 	}
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/95ab789c/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go b/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
index 03bc5c9..d069578 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
@@ -9,7 +9,7 @@ import (
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/log"
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/poller"
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/config"
-	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/http_server"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/srvhttp"
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/peer"
 	todata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
 	towrap "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopswrapper"
@@ -82,7 +82,7 @@ func StartOpsConfigManager(
 
 	// TODO remove change subscribers, give Threadsafes directly to the things that need them. If they only set vars, and don't actually do work on change.
 	go func() {
-		httpServer := http_server.Server{}
+		httpServer := srvhttp.Server{}
 
 		for newOpsConfig := range opsConfigChannel {
 			var err error
@@ -99,7 +99,7 @@ func StartOpsConfigManager(
 				log.Errorf("OpsConfigManager: %v\n", err)
 			}
 
-			err = httpServer.Run(func(req http_server.DataRequest) ([]byte, int) {
+			err = httpServer.Run(func(req srvhttp.DataRequest) ([]byte, int) {
 				return DataRequest(
 					req,
 					opsConfig,

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/95ab789c/traffic_monitor/experimental/traffic_monitor/srvhttp/srvhttp.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/srvhttp/srvhttp.go b/traffic_monitor/experimental/traffic_monitor/srvhttp/srvhttp.go
new file mode 100644
index 0000000..403b5a9
--- /dev/null
+++ b/traffic_monitor/experimental/traffic_monitor/srvhttp/srvhttp.go
@@ -0,0 +1,299 @@
+package srvhttp
+
+import (
+	"fmt"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/log"
+	"github.com/hydrogen18/stoppableListener"
+	"io/ioutil"
+	"net"
+	"net/http"
+	"net/url"
+	"sync"
+	"time"
+)
+
+func GetCommonAPIData(params url.Values, t time.Time) CommonAPIData {
+	return CommonAPIData{
+		QueryParams: ParametersStr(params),
+		DateStr:     DateStr(t),
+	}
+}
+
+type CommonAPIData struct {
+	QueryParams string `json:"pp"`
+	DateStr     string `json:"date"`
+}
+
+// Server is a re-runnable HTTP server. Server.Run() may be called repeatedly, and
+// each time the previous running server will be stopped, and the server will be
+// restarted with the new port address and data request channel.
+type Server struct {
+	getData                    GetDataFunc
+	stoppableListener          *stoppableListener.StoppableListener
+	stoppableListenerWaitGroup sync.WaitGroup
+}
+
+// Endpoints returns a map of HTTP paths to functions.
+// This is a function because Go doesn't have constant map literals.
+func (s Server) endpoints() (map[string]http.HandlerFunc, error) {
+	handleRoot, err := s.handleRootFunc()
+	handleSortableJs, err := s.handleSortableFunc()
+	if err != nil {
+		return nil, fmt.Errorf("Error getting root endpoint: %v", err)
+	}
+
+	// note: with the trailing slash, any non-trailing slash requests will get a 301 redirect
+	return map[string]http.HandlerFunc{
+		"/publish/CacheStats/":          s.dataRequestFunc(CacheStats),
+		"/publish/CacheStats":           s.dataRequestFunc(CacheStats),
+		"/publish/CrConfig/":            s.dataRequestFunc(TRConfig),
+		"/publish/CrConfig":             s.dataRequestFunc(TRConfig),
+		"/publish/CrStates/":            s.handleCrStatesFunc(),
+		"/publish/CrStates":             s.handleCrStatesFunc(),
+		"/publish/DsStats/":             s.dataRequestFunc(DSStats),
+		"/publish/DsStats":              s.dataRequestFunc(DSStats),
+		"/publish/EventLog/":            s.dataRequestFunc(EventLog),
+		"/publish/EventLog":             s.dataRequestFunc(EventLog),
+		"/publish/PeerStates/":          s.dataRequestFunc(PeerStates),
+		"/publish/PeerStates":           s.dataRequestFunc(PeerStates),
+		"/publish/StatSummary/":         s.dataRequestFunc(StatSummary),
+		"/publish/StatSummary":          s.dataRequestFunc(StatSummary),
+		"/publish/Stats/":               s.dataRequestFunc(Stats),
+		"/publish/Stats":                s.dataRequestFunc(Stats),
+		"/publish/ConfigDoc/":           s.dataRequestFunc(ConfigDoc),
+		"/publish/ConfigDoc":            s.dataRequestFunc(ConfigDoc),
+		"/api/cache-count/":             s.dataRequestFunc(APICacheCount),
+		"/api/cache-count":              s.dataRequestFunc(APICacheCount),
+		"/api/cache-available-count/":   s.dataRequestFunc(APICacheAvailableCount),
+		"/api/cache-available-count":    s.dataRequestFunc(APICacheAvailableCount),
+		"/api/cache-down-count/":        s.dataRequestFunc(APICacheDownCount),
+		"/api/cache-down-count":         s.dataRequestFunc(APICacheDownCount),
+		"/api/version/":                 s.dataRequestFunc(APIVersion),
+		"/api/version":                  s.dataRequestFunc(APIVersion),
+		"/api/traffic-ops-uri/":         s.dataRequestFunc(APITrafficOpsURI),
+		"/api/traffic-ops-uri":          s.dataRequestFunc(APITrafficOpsURI),
+		"/api/cache-statuses/":          s.dataRequestFunc(APICacheStates),
+		"/api/cache-statuses":           s.dataRequestFunc(APICacheStates),
+		"/api/bandwidth-kbps/":          s.dataRequestFunc(APIBandwidthKbps),
+		"/api/bandwidth-kbps":           s.dataRequestFunc(APIBandwidthKbps),
+		"/api/bandwidth-capacity-kbps/": s.dataRequestFunc(APIBandwidthCapacityKbps),
+		"/api/bandwidth-capacity-kbps":  s.dataRequestFunc(APIBandwidthCapacityKbps),
+		"/":             handleRoot,
+		"/sorttable.js": handleSortableJs,
+	}, nil
+}
+
+func (s Server) registerEndpoints(sm *http.ServeMux) error {
+	endpoints, err := s.endpoints()
+	if err != nil {
+		return err
+	}
+	for path, f := range endpoints {
+		sm.HandleFunc(path, f)
+	}
+	return nil
+}
+
+// Run runs a new HTTP service at the given addr, making data requests to the given c.
+// Run may be called repeatedly, and each time, will shut down any existing service first.
+// Run is NOT threadsafe, and MUST NOT be called concurrently by multiple goroutines.
+func (s Server) Run(f GetDataFunc, addr string, readTimeout time.Duration, writeTimeout time.Duration) error {
+	// TODO make an object, which itself is not threadsafe, but which encapsulates all data so multiple
+	//      objects can be created and Run.
+
+	if s.stoppableListener != nil {
+		log.Infof("Stopping Web Server\n")
+		s.stoppableListener.Stop()
+		s.stoppableListenerWaitGroup.Wait()
+	}
+	log.Infof("Starting Web Server\n")
+
+	var err error
+	var originalListener net.Listener
+	if originalListener, err = net.Listen("tcp", addr); err != nil {
+		return err
+	}
+	if s.stoppableListener, err = stoppableListener.New(originalListener); err != nil {
+		return err
+	}
+
+	s.getData = f
+
+	sm := http.NewServeMux()
+	err = s.registerEndpoints(sm)
+	if err != nil {
+		return err
+	}
+	server := &http.Server{
+		Addr:           addr,
+		Handler:        sm,
+		ReadTimeout:    readTimeout,
+		WriteTimeout:   writeTimeout,
+		MaxHeaderBytes: 1 << 20,
+	}
+
+	s.stoppableListenerWaitGroup = sync.WaitGroup{}
+	s.stoppableListenerWaitGroup.Add(1)
+	go func() {
+		defer s.stoppableListenerWaitGroup.Done()
+		server.Serve(s.stoppableListener)
+	}()
+
+	log.Infof("Web server listening on %s", addr)
+	return nil
+}
+
+type Type int
+
+const (
+	TRConfig Type = (1 << iota)
+	TRStateDerived
+	TRStateSelf
+	CacheStats
+	DSStats
+	EventLog
+	PeerStates
+	StatSummary
+	Stats
+	ConfigDoc
+	APICacheCount
+	APICacheAvailableCount
+	APICacheDownCount
+	APIVersion
+	APITrafficOpsURI
+	APICacheStates
+	APIBandwidthKbps
+	APIBandwidthCapacityKbps
+)
+
+func (t Type) String() string {
+	switch t {
+	case TRConfig:
+		return "TRConfig"
+	case TRStateDerived:
+		return "TRStateDerived"
+	case TRStateSelf:
+		return "TRStateSelf"
+	case CacheStats:
+		return "CacheStats"
+	case DSStats:
+		return "DSStats"
+	case EventLog:
+		return "EventLog"
+	case PeerStates:
+		return "PeerStates"
+	case StatSummary:
+		return "StatSummary"
+	case Stats:
+		return "Stats"
+	case ConfigDoc:
+		return "ConfigDoc"
+	case APICacheCount:
+		return "APICacheCount"
+	case APICacheAvailableCount:
+		return "APICacheAvailableCount"
+	case APICacheDownCount:
+		return "APICacheDownCount"
+	case APIVersion:
+		return "APIVersion"
+	case APITrafficOpsURI:
+		return "APITrafficOpsURI"
+	case APICacheStates:
+		return "APICacheStates"
+	case APIBandwidthKbps:
+		return "APIBandwidthKbps"
+	case APIBandwidthCapacityKbps:
+		return "APIBandwidthCapacityKbps"
+	default:
+		return "Invalid"
+	}
+}
+
+type Format int
+
+const (
+	XML Format = (1 << iota)
+	JSON
+)
+
+type DataRequest struct {
+	Type
+	Format
+	Date       string
+	Parameters map[string][]string
+}
+
+type GetDataFunc func(DataRequest) ([]byte, int)
+
+// ParametersStr takes the URL query parameters, and returns a string as used by the Traffic Monitor 1.0 endpoints "pp" key.
+func ParametersStr(params url.Values) string {
+	fmt.Println("debug4 ParametersStr 0")
+	pp := ""
+	for param, vals := range params {
+		for _, val := range vals {
+			pp += param + "=[" + val + "], "
+		}
+	}
+	if len(pp) > 2 {
+		pp = pp[:len(pp)-2]
+	}
+	return pp
+}
+
+// DateStr returns the given time in the format expected by Traffic Monitor 1.0 API users
+func DateStr(t time.Time) string {
+	return t.UTC().Format("Mon Jan 02 15:04:05 UTC 2006")
+}
+
+func (s Server) dataRequest(w http.ResponseWriter, req *http.Request, t Type, f Format) {
+	//pp: "0=[my-ats-edge-cache-0], hc=[1]",
+	//dateLayout := "Thu Oct 09 20:28:36 UTC 2014"
+	dateLayout := "Mon Jan 02 15:04:05 MST 2006"
+	data, responseCode := s.getData(DataRequest{
+		Type:       t,
+		Format:     f,
+		Date:       time.Now().UTC().Format(dateLayout),
+		Parameters: req.URL.Query(),
+	})
+	if len(data) > 0 {
+		w.WriteHeader(responseCode)
+		w.Write(data)
+	} else {
+		w.WriteHeader(http.StatusInternalServerError)
+		w.Write([]byte("Internal Server Error"))
+	}
+}
+
+func (s Server) handleRootFunc() (http.HandlerFunc, error) {
+	return s.handleFile("index.html")
+}
+
+func (s Server) handleSortableFunc() (http.HandlerFunc, error) {
+	return s.handleFile("sorttable.js")
+}
+
+func (s Server) handleFile(name string) (http.HandlerFunc, error) {
+	index, err := ioutil.ReadFile(name)
+	if err != nil {
+		return nil, err
+	}
+	return func(w http.ResponseWriter, req *http.Request) {
+		fmt.Fprintf(w, "%s", index)
+	}, nil
+}
+
+func (s Server) handleCrStatesFunc() http.HandlerFunc {
+	return func(w http.ResponseWriter, req *http.Request) {
+		t := TRStateDerived
+		if req.URL.RawQuery == "raw" {
+			t = TRStateSelf
+		}
+		s.dataRequest(w, req, t, JSON)
+	}
+}
+
+func (s Server) dataRequestFunc(t Type) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		s.dataRequest(w, r, t, JSON)
+	}
+}


[41/50] incubator-trafficcontrol git commit: Change TM2 Go imports to Apache

Posted by mi...@apache.org.
Change TM2 Go imports to Apache


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/56abc4b3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/56abc4b3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/56abc4b3

Branch: refs/heads/master
Commit: 56abc4b3bb2c40f62e19d584f7385d2c63837e95
Parents: 80387aa
Author: Robert Butts <ro...@gmail.com>
Authored: Thu Oct 20 13:28:36 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../experimental/common/fetcher/fetcher.go      |  4 ++--
 .../experimental/common/handler/handler.go      |  2 +-
 .../experimental/common/poller/poller.go        | 12 +++++------
 .../experimental/traffic_monitor/cache/cache.go | 16 +++++++-------
 .../traffic_monitor/deliveryservice/stat.go     | 18 ++++++++--------
 .../traffic_monitor/deliveryservicedata/stat.go |  5 +++--
 .../traffic_monitor/health/cache_health.go      |  6 +++---
 .../traffic_monitor/http_server/http_server.go  | 12 +++++------
 .../manager/cacheavailablestatus.go             |  2 +-
 .../traffic_monitor/manager/datarequest.go      | 22 ++++++++++----------
 .../traffic_monitor/manager/dsstats.go          |  4 ++--
 .../traffic_monitor/manager/events.go           |  2 +-
 .../traffic_monitor/manager/healthresult.go     | 14 ++++++-------
 .../traffic_monitor/manager/lastkbpsstats.go    |  2 +-
 .../traffic_monitor/manager/manager.go          | 18 ++++++++--------
 .../traffic_monitor/manager/monitorconfig.go    | 12 +++++------
 .../traffic_monitor/manager/opsconfig.go        | 18 ++++++++--------
 .../traffic_monitor/manager/peer.go             |  6 +++---
 .../traffic_monitor/manager/polledcaches.go     |  6 +++---
 .../traffic_monitor/manager/stathistory.go      | 14 ++++++-------
 .../traffic_monitor/peer/crstates.go            |  2 +-
 .../experimental/traffic_monitor/peer/peer.go   |  2 +-
 .../traffic_monitor/traffic_monitor.go          |  8 +++----
 .../trafficopsdata/trafficopsdata.go            |  4 ++--
 .../trafficopswrapper/trafficopswrapper.go      |  2 +-
 25 files changed, 107 insertions(+), 106 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/common/fetcher/fetcher.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/common/fetcher/fetcher.go b/traffic_monitor/experimental/common/fetcher/fetcher.go
index e439bb2..f1176ea 100644
--- a/traffic_monitor/experimental/common/fetcher/fetcher.go
+++ b/traffic_monitor/experimental/common/fetcher/fetcher.go
@@ -6,8 +6,8 @@ import (
 	"net/http"
 	"time"
 
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/handler"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/log"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/handler"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/log"
 	"github.com/davecheney/gmx"
 )
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/common/handler/handler.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/common/handler/handler.go b/traffic_monitor/experimental/common/handler/handler.go
index 46f9426..0b5f838 100644
--- a/traffic_monitor/experimental/common/handler/handler.go
+++ b/traffic_monitor/experimental/common/handler/handler.go
@@ -4,7 +4,7 @@ import (
 	"encoding/json"
 	"io"
 
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/log"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/log"
 )
 
 const (

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/common/poller/poller.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/common/poller/poller.go b/traffic_monitor/experimental/common/poller/poller.go
index 42a0d7d..f4a05b3 100644
--- a/traffic_monitor/experimental/common/poller/poller.go
+++ b/traffic_monitor/experimental/common/poller/poller.go
@@ -9,12 +9,12 @@ import (
 
 	"gopkg.in/fsnotify.v1"
 
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/fetcher"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/handler"
-	instr "github.com/Comcast/traffic_control/traffic_monitor/experimental/common/instrumentation"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/log"
-	towrap "github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/trafficopswrapper" // TODO move to common
-	to "github.com/Comcast/traffic_control/traffic_ops/client"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/fetcher"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/handler"
+	instr "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/instrumentation"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/log"
+	towrap "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopswrapper" // TODO move to common
+	to "github.com/apache/incubator-trafficcontrol/traffic_ops/client"
 )
 
 type Poller interface {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/traffic_monitor/cache/cache.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/cache/cache.go b/traffic_monitor/experimental/traffic_monitor/cache/cache.go
index b6f2f47..aa3a920 100644
--- a/traffic_monitor/experimental/traffic_monitor/cache/cache.go
+++ b/traffic_monitor/experimental/traffic_monitor/cache/cache.go
@@ -3,12 +3,12 @@ package cache
 import (
 	"encoding/json"
 	"fmt"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/log"
-	dsdata "github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/deliveryservicedata"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/enum"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/http_server"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/peer"
-	todata "github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/log"
+	dsdata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/deliveryservicedata"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/enum"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/http_server"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/peer"
+	todata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
 	"io"
 	"net/url"
 	"regexp"
@@ -86,8 +86,8 @@ type Filter interface {
 // StatsMarshall encodes the stats in JSON, encoding up to historyCount of each stat. If statsToUse is empty, all stats are encoded; otherwise, only the given stats are encoded. If wildcard is true, stats which contain the text in each statsToUse are returned, instead of exact stat names. If cacheType is not CacheTypeInvalid, only stats for the given type are returned. If hosts is not empty, only the given hosts are returned.
 func StatsMarshall(statHistory map[enum.CacheName][]Result, filter Filter, params url.Values) ([]byte, error) {
 	stats := Stats{
-		http_server.CommonAPIData: http_server.GetCommonAPIData(params, time.Now()),
-		Caches: map[enum.CacheName]map[string][]Stat{},
+		CommonAPIData: http_server.GetCommonAPIData(params, time.Now()),
+		Caches:        map[enum.CacheName]map[string][]Stat{},
 	}
 
 	// TODO in 1.0, stats are divided into 'location', 'cache', and 'type'. 'cache' are hidden by default.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
index e042fb4..d2b8821 100644
--- a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
+++ b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
@@ -2,13 +2,13 @@ package deliveryservice
 
 import (
 	"fmt"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/log"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/cache"
-	dsdata "github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/deliveryservicedata"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/enum"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/http_server"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/peer"
-	todata "github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/log"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/cache"
+	dsdata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/deliveryservicedata"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/enum"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/http_server"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/peer"
+	todata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
 	"net/url"
 	"strconv"
 	"time"
@@ -474,8 +474,8 @@ func addCommonData(s *dsdata.StatsOld, c *dsdata.StatCommon, deliveryService enu
 func (dsStats Stats) JSON(filter dsdata.Filter, params url.Values) dsdata.StatsOld {
 	now := time.Now().Unix()
 	jsonObj := &dsdata.StatsOld{
-		http_server.CommonAPIData: http_server.GetCommonAPIData(params, time.Now()),
-		DeliveryService:           map[enum.DeliveryServiceName]map[dsdata.StatName][]dsdata.StatOld{},
+		CommonAPIData:   http_server.GetCommonAPIData(params, time.Now()),
+		DeliveryService: map[enum.DeliveryServiceName]map[dsdata.StatName][]dsdata.StatOld{},
 	}
 
 	for deliveryService, stat := range dsStats.DeliveryService {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go b/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
index f60163d..e2f6e0f 100644
--- a/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
+++ b/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
@@ -2,7 +2,8 @@ package deliveryservicedata // TODO rename?
 
 import (
 	"errors"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/enum"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/enum"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/http_server"
 	"net/url"
 	"time"
 )
@@ -25,7 +26,7 @@ type StatOld struct {
 
 type StatsOld struct {
 	DeliveryService map[enum.DeliveryServiceName]map[StatName][]StatOld `json:"deliveryService"`
-	CommonAPIData
+	http_server.CommonAPIData
 }
 
 type StatsReadonly interface {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/traffic_monitor/health/cache_health.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/health/cache_health.go b/traffic_monitor/experimental/traffic_monitor/health/cache_health.go
index b8b180f..eba1d30 100644
--- a/traffic_monitor/experimental/traffic_monitor/health/cache_health.go
+++ b/traffic_monitor/experimental/traffic_monitor/health/cache_health.go
@@ -1,9 +1,9 @@
 package health
 
 import (
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/log"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/cache"
-	traffic_ops "github.com/Comcast/traffic_control/traffic_ops/client"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/log"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/cache"
+	traffic_ops "github.com/apache/incubator-trafficcontrol/traffic_ops/client"
 
 	"fmt"
 	"strconv"

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/traffic_monitor/http_server/http_server.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/http_server/http_server.go b/traffic_monitor/experimental/traffic_monitor/http_server/http_server.go
index a0a18dd..ab0668e 100644
--- a/traffic_monitor/experimental/traffic_monitor/http_server/http_server.go
+++ b/traffic_monitor/experimental/traffic_monitor/http_server/http_server.go
@@ -2,7 +2,7 @@ package http_server
 
 import (
 	"fmt"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/log"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/log"
 	"github.com/hydrogen18/stoppableListener"
 	"io/ioutil"
 	"net"
@@ -12,10 +12,10 @@ import (
 	"time"
 )
 
-func GetCommonAPIData(params url.Values, time time.Time) CommonAPIData {
+func GetCommonAPIData(params url.Values, t time.Time) CommonAPIData {
 	return CommonAPIData{
 		QueryParams: ParametersStr(params),
-		DateStr:     DateStr(time.Now()),
+		DateStr:     DateStr(t),
 	}
 }
 
@@ -265,15 +265,15 @@ func (s Server) dataRequest(w http.ResponseWriter, req *http.Request, t Type, f
 }
 
 func (s Server) handleRootFunc() (http.HandlerFunc, error) {
-	return handleFile("index.html")
+	return s.handleFile("index.html")
 }
 
 func (s Server) handleSortableFunc() (http.HandlerFunc, error) {
-	return handleFile("sorttable.js")
+	return s.handleFile("sorttable.js")
 }
 
 func (s Server) handleFile(name string) (http.HandlerFunc, error) {
-	index, err := ioutil.ReadFile(file)
+	index, err := ioutil.ReadFile(name)
 	if err != nil {
 		return nil, err
 	}

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/traffic_monitor/manager/cacheavailablestatus.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/cacheavailablestatus.go b/traffic_monitor/experimental/traffic_monitor/manager/cacheavailablestatus.go
index b66c392..31dcbee 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/cacheavailablestatus.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/cacheavailablestatus.go
@@ -1,7 +1,7 @@
 package manager
 
 import (
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/enum"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/enum"
 	"sync"
 )
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go b/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
index 38b4565..6c578cb 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
@@ -11,15 +11,15 @@ import (
 	"strings"
 	"time"
 
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/log"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/cache"
-	ds "github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/deliveryservice"
-	dsdata "github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/deliveryservicedata"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/enum"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/http_server"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/peer"
-	todata "github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
-	towrap "github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/trafficopswrapper"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/log"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/cache"
+	ds "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/deliveryservice"
+	dsdata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/deliveryservicedata"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/enum"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/http_server"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/peer"
+	todata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
+	towrap "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopswrapper"
 )
 
 type JSONEvents struct {
@@ -673,8 +673,8 @@ func cacheAvailableCount(caches map[enum.CacheName]peer.IsAvailable) int {
 
 func createApiPeerStates(peerStates map[enum.TrafficMonitorName]peer.Crstates, filter *PeerStateFilter, params url.Values) ApiPeerStates {
 	apiPeerStates := ApiPeerStates{
-		http_server.CommonAPIData: http_server.GetCommonAPIData(params, time.Now()),
-		Peers: map[enum.TrafficMonitorName]map[enum.CacheName][]CacheState{},
+		CommonAPIData: http_server.GetCommonAPIData(params, time.Now()),
+		Peers:         map[enum.TrafficMonitorName]map[enum.CacheName][]CacheState{},
 	}
 
 	for peer, state := range peerStates {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/traffic_monitor/manager/dsstats.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/dsstats.go b/traffic_monitor/experimental/traffic_monitor/manager/dsstats.go
index ae273d8..6ca7b8b 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/dsstats.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/dsstats.go
@@ -1,8 +1,8 @@
 package manager
 
 import (
-	ds "github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/deliveryservice"
-	dsdata "github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/deliveryservicedata"
+	ds "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/deliveryservice"
+	dsdata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/deliveryservicedata"
 	"sync"
 )
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/traffic_monitor/manager/events.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/events.go b/traffic_monitor/experimental/traffic_monitor/manager/events.go
index 19e4f5d..52c7bbb 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/events.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/events.go
@@ -3,7 +3,7 @@ package manager
 import (
 	"sync"
 
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/enum"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/enum"
 )
 
 type Event struct {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go b/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go
index a2cc876..b4ad2bb 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go
@@ -4,13 +4,13 @@ import (
 	"sync"
 	"time"
 
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/log"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/cache"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/config"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/enum"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/health"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/peer"
-	todata "github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/log"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/cache"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/config"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/enum"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/health"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/peer"
+	todata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
 )
 
 type DurationMap map[enum.CacheName]time.Duration

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/traffic_monitor/manager/lastkbpsstats.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/lastkbpsstats.go b/traffic_monitor/experimental/traffic_monitor/manager/lastkbpsstats.go
index 103ebd0..89ffa6b 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/lastkbpsstats.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/lastkbpsstats.go
@@ -1,7 +1,7 @@
 package manager
 
 import (
-	ds "github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/deliveryservice"
+	ds "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/deliveryservice"
 	"sync"
 )
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/traffic_monitor/manager/manager.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/manager.go b/traffic_monitor/experimental/traffic_monitor/manager/manager.go
index 003fb31..30d52c4 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/manager.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/manager.go
@@ -5,15 +5,15 @@ import (
 	"net/http"
 	"time"
 
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/fetcher"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/handler"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/poller"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/cache"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/config"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/peer"
-	todata "github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
-	towrap "github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/trafficopswrapper"
-	//	to "github.com/Comcast/traffic_control/traffic_ops/client"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/fetcher"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/handler"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/poller"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/cache"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/config"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/peer"
+	todata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
+	towrap "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopswrapper"
+	//	to "github.com/apache/incubator-trafficcontrol/traffic_ops/client"
 	"github.com/davecheney/gmx"
 )
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go b/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
index fe42dad..fa600a7 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
@@ -2,12 +2,12 @@ package manager
 
 import (
 	"fmt"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/log"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/poller"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/config"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/enum"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/peer"
-	to "github.com/Comcast/traffic_control/traffic_ops/client"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/log"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/poller"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/config"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/enum"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/peer"
+	to "github.com/apache/incubator-trafficcontrol/traffic_ops/client"
 	"strings"
 	"sync"
 )

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go b/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
index 875b67b..927776c 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
@@ -5,15 +5,15 @@ import (
 	"sync"
 	"time"
 
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/handler"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/log"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/poller"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/config"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/http_server"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/peer"
-	todata "github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
-	towrap "github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/trafficopswrapper"
-	to "github.com/Comcast/traffic_control/traffic_ops/client"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/handler"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/log"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/poller"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/config"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/http_server"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/peer"
+	todata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
+	towrap "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopswrapper"
+	to "github.com/apache/incubator-trafficcontrol/traffic_ops/client"
 )
 
 // This could be made lock-free, if the performance was necessary

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/traffic_monitor/manager/peer.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/peer.go b/traffic_monitor/experimental/traffic_monitor/manager/peer.go
index 2f1b783..dddc265 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/peer.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/peer.go
@@ -3,9 +3,9 @@ package manager
 import (
 	"sort"
 
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/log"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/enum"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/peer"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/log"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/enum"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/peer"
 )
 
 // StartPeerManager listens for peer results, and when it gets one, it adds it to the peerStates list, and optimistically combines the good results into combinedStates

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go b/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go
index c1cb999..48e4f71 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go
@@ -1,9 +1,9 @@
 package manager
 
 import (
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/log"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/cache"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/enum"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/log"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/cache"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/enum"
 	"sync"
 )
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go b/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
index cb0c7c3..455f2cb 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
@@ -4,13 +4,13 @@ import (
 	"sync"
 	"time"
 
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/log"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/cache"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/config"
-	ds "github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/deliveryservice"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/enum"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/peer"
-	todata "github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/log"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/cache"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/config"
+	ds "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/deliveryservice"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/enum"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/peer"
+	todata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
 )
 
 type StatHistory map[enum.CacheName][]cache.Result

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/traffic_monitor/peer/crstates.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/peer/crstates.go b/traffic_monitor/experimental/traffic_monitor/peer/crstates.go
index 7554043..6f4bda7 100644
--- a/traffic_monitor/experimental/traffic_monitor/peer/crstates.go
+++ b/traffic_monitor/experimental/traffic_monitor/peer/crstates.go
@@ -4,7 +4,7 @@ import (
 	"encoding/json"
 	"sync"
 
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/enum"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/enum"
 )
 
 type Crstates struct {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/traffic_monitor/peer/peer.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/peer/peer.go b/traffic_monitor/experimental/traffic_monitor/peer/peer.go
index b86c96e..f1788d9 100644
--- a/traffic_monitor/experimental/traffic_monitor/peer/peer.go
+++ b/traffic_monitor/experimental/traffic_monitor/peer/peer.go
@@ -4,7 +4,7 @@ import (
 	"encoding/json"
 	"io"
 
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/enum"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/enum"
 )
 
 type Handler struct {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/traffic_monitor/traffic_monitor.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/traffic_monitor.go b/traffic_monitor/experimental/traffic_monitor/traffic_monitor.go
index 2a96c9d..76cfdfc 100644
--- a/traffic_monitor/experimental/traffic_monitor/traffic_monitor.go
+++ b/traffic_monitor/experimental/traffic_monitor/traffic_monitor.go
@@ -12,10 +12,10 @@ import (
 	"runtime"
 	"time"
 
-	_ "github.com/Comcast/traffic_control/traffic_monitor/experimental/common/instrumentation"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/common/log"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/config"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/manager"
+	_ "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/instrumentation"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/log"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/config"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/manager"
 	_ "github.com/davecheney/gmx"
 )
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/traffic_monitor/trafficopsdata/trafficopsdata.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/trafficopsdata/trafficopsdata.go b/traffic_monitor/experimental/traffic_monitor/trafficopsdata/trafficopsdata.go
index 08d3031..33601bd 100644
--- a/traffic_monitor/experimental/traffic_monitor/trafficopsdata/trafficopsdata.go
+++ b/traffic_monitor/experimental/traffic_monitor/trafficopsdata/trafficopsdata.go
@@ -3,8 +3,8 @@ package trafficopsdata
 import (
 	"encoding/json"
 	"fmt"
-	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/enum"
-	towrap "github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/trafficopswrapper"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/enum"
+	towrap "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopswrapper"
 	"regexp"
 	"strings"
 	"sync"

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/56abc4b3/traffic_monitor/experimental/traffic_monitor/trafficopswrapper/trafficopswrapper.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/trafficopswrapper/trafficopswrapper.go b/traffic_monitor/experimental/traffic_monitor/trafficopswrapper/trafficopswrapper.go
index 5250039..110dd8f 100644
--- a/traffic_monitor/experimental/traffic_monitor/trafficopswrapper/trafficopswrapper.go
+++ b/traffic_monitor/experimental/traffic_monitor/trafficopswrapper/trafficopswrapper.go
@@ -4,7 +4,7 @@ import (
 	"fmt"
 	"sync"
 
-	to "github.com/Comcast/traffic_control/traffic_ops/client"
+	to "github.com/apache/incubator-trafficcontrol/traffic_ops/client"
 )
 
 type ITrafficOpsSession interface {



[23/50] incubator-trafficcontrol git commit: add wrap_count stats to seeds.sql

Posted by mi...@apache.org.
add wrap_count stats to seeds.sql


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/f20a8564
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/f20a8564
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/f20a8564

Branch: refs/heads/master
Commit: f20a8564fcdd88b7ddf123a02462f61f64090c52
Parents: 2b6b198
Author: Dave Neuman <ne...@apache.org>
Authored: Wed Oct 19 07:28:39 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 traffic_ops/app/db/seeds.sql | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/f20a8564/traffic_ops/app/db/seeds.sql
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/seeds.sql b/traffic_ops/app/db/seeds.sql
index e6f9078..4f47c4e 100644
--- a/traffic_ops/app/db/seeds.sql
+++ b/traffic_ops/app/db/seeds.sql
@@ -149,6 +149,8 @@ insert ignore into profile (name, description) values ('INFLUXDB', 'InfluxDb pro
 insert into parameter (name, config_file, value) select * from (select 'CacheStats', 'traffic_stats.config', 'bandwidth') as temp where not exists (select name from parameter where name = 'CacheStats' and config_file = 'traffic_stats.config' and value = 'bandwidth') limit 1;
 insert into parameter (name, config_file, value) select * from (select 'CacheStats', 'traffic_stats.config', 'maxKbps') as temp where not exists (select name from parameter where name = 'CacheStats' and config_file = 'traffic_stats.config' and value = 'maxKbps') limit 1;
 insert into parameter (name, config_file, value) select * from (select 'CacheStats', 'traffic_stats.config', 'ats.proxy.process.http.current_client_connections') as temp where not exists (select name from parameter where name = 'CacheStats' and config_file = 'traffic_stats.config' and value = 'ats.proxy.process.http.current_client_connections') limit 1;
+insert into parameter (name, config_file, value) select * from (select 'CacheStats', 'traffic_stats.config', 'ats.proxy.process.http.current_client_connections') as temp where not exists (select name from parameter where name = 'CacheStats' and config_file = 'traffic_stats.config' and value = 'ats.proxy.process.cache.volume_1.wrap_count') limit 1;
+insert into parameter (name, config_file, value) select * from (select 'CacheStats', 'traffic_stats.config', 'ats.proxy.process.http.current_client_connections') as temp where not exists (select name from parameter where name = 'CacheStats' and config_file = 'traffic_stats.config' and value = 'ats.proxy.process.cache.volume_1.wrap_count') limit 1;
 insert into parameter (name, config_file, value) select * from (select 'DsStats', 'traffic_stats.config', 'kbps') as temp where not exists (select name from parameter where name = 'DsStats' and config_file = 'traffic_stats.config' and value = 'kbps') limit 1;
 insert into parameter (name, config_file, value) select * from (select 'DsStats', 'traffic_stats.config', 'tps_2xx') as temp where not exists (select name from parameter where name = 'DsStats' and config_file = 'traffic_stats.config' and value = 'tps_2xx') limit 1;
 insert into parameter (name, config_file, value) select * from (select 'DsStats', 'traffic_stats.config', 'status_4xx') as temp where not exists (select name from parameter where name = 'DsStats' and config_file = 'traffic_stats.config' and value = 'status_4xx') limit 1;


[49/50] incubator-trafficcontrol git commit: This closes #12

Posted by mi...@apache.org.
This closes #12


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/fcc3e8c1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/fcc3e8c1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/fcc3e8c1

Branch: refs/heads/master
Commit: fcc3e8c1e05dd7415b5893a92bab6c3ee526b0b2
Parents: 6e00e60
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Fri Oct 28 15:04:40 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:40 2016 -0600

----------------------------------------------------------------------

----------------------------------------------------------------------



[47/50] incubator-trafficcontrol git commit: Fix TM2 DsStats error, isAvailable to match TM1

Posted by mi...@apache.org.
Fix TM2 DsStats error, isAvailable to match TM1

Fixes Traffic Monitor 2.0's /publish/DsStats endpoint 'isAvailable'
and 'error-string' stats to be prefixed with 'location.location.',
to match Traffic Monitor 1.0. Also changes 'error' to 'error-string'
to match.


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/487823a8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/487823a8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/487823a8

Branch: refs/heads/master
Commit: 487823a8c100efc9d91dd76065f2041e166880a8
Parents: 4d8a337
Author: Robert Butts <ro...@gmail.com>
Authored: Tue Oct 25 15:15:07 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../experimental/traffic_monitor/deliveryservice/stat.go  | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/487823a8/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
index 7c63cd1..5415634 100644
--- a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
+++ b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
@@ -449,7 +449,13 @@ func CreateStats(statHistory map[enum.CacheName][]cache.Result, toData todata.TO
 func addStatCacheStats(s *dsdata.StatsOld, c dsdata.StatCacheStats, deliveryService enum.DeliveryServiceName, prefix string, t int64, filter dsdata.Filter) *dsdata.StatsOld {
 	add := func(name, val string) {
 		if filter.UseStat(name) {
-			s.DeliveryService[deliveryService][dsdata.StatName(prefix+name)] = []dsdata.StatOld{dsdata.StatOld{Time: t, Value: val}}
+			// This is for compatibility with the Traffic Monitor 1.0 API.
+			// TODO abstract this? Or deprecate and remove it?
+			if name == "isAvailable" || name == "error-string" {
+				s.DeliveryService[deliveryService][dsdata.StatName("location."+prefix+name)] = []dsdata.StatOld{dsdata.StatOld{Time: t, Value: val}}
+			} else {
+				s.DeliveryService[deliveryService][dsdata.StatName(prefix+name)] = []dsdata.StatOld{dsdata.StatOld{Time: t, Value: val}}
+			}
 		}
 	}
 	add("out_bytes", strconv.Itoa(int(c.OutBytes.Value)))
@@ -464,7 +470,7 @@ func addStatCacheStats(s *dsdata.StatsOld, c dsdata.StatCacheStats, deliveryServ
 	add("tps_4xx", fmt.Sprintf("%f", c.Tps4xx.Value))
 	add("tps_3xx", fmt.Sprintf("%f", c.Tps3xx.Value))
 	add("tps_2xx", fmt.Sprintf("%f", c.Tps2xx.Value))
-	add("error", c.ErrorString.Value)
+	add("error-string", c.ErrorString.Value)
 	add("tps_total", strconv.Itoa(int(c.TpsTotal.Value)))
 	return s
 }


[36/50] incubator-trafficcontrol git commit: Fix TM2 package comment to be idiomatic

Posted by mi...@apache.org.
Fix TM2 package comment to be idiomatic


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/44d55b5d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/44d55b5d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/44d55b5d

Branch: refs/heads/master
Commit: 44d55b5ddc9abf7cc80db6fbdc2a658e46be8cd7
Parents: b1bd952
Author: Robert Butts <ro...@gmail.com>
Authored: Thu Oct 20 16:21:12 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 traffic_monitor/experimental/traffic_monitor/enum/enum.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/44d55b5d/traffic_monitor/experimental/traffic_monitor/enum/enum.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/enum/enum.go b/traffic_monitor/experimental/traffic_monitor/enum/enum.go
index d14593c..c807a55 100644
--- a/traffic_monitor/experimental/traffic_monitor/enum/enum.go
+++ b/traffic_monitor/experimental/traffic_monitor/enum/enum.go
@@ -1,4 +1,4 @@
-// enum contains enumerations and strongly typed names.
+// Package enum contains enumerations and strongly typed names.
 // The names are an experiment with strong typing of string types. The primary goal is to make code more self-documenting, especially map keys. If peole don't like it, we can get rid of it.
 package enum
 


[30/50] incubator-trafficcontrol git commit: add docker build steps to TO v2 build

Posted by mi...@apache.org.
add docker build steps to TO v2 build


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/e25fcdac
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/e25fcdac
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/e25fcdac

Branch: refs/heads/master
Commit: e25fcdaca5496502c18522fe99a71f2e9a979139
Parents: 2ee8942
Author: Dan Kirkwood <da...@gmail.com>
Authored: Thu Oct 20 10:19:40 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 traffic_ops/experimental/ui/build/README.md | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e25fcdac/traffic_ops/experimental/ui/build/README.md
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/build/README.md b/traffic_ops/experimental/ui/build/README.md
index c2bd4d5..90879f9 100644
--- a/traffic_ops/experimental/ui/build/README.md
+++ b/traffic_ops/experimental/ui/build/README.md
@@ -11,10 +11,13 @@
 * Build the RPM
 
     ```
-    $ cd traffic_control/build
-    $ ./docker-build.sh -r https://github.com/apache/incubator-trafficcontrol.git -b master traffic_ops_v2
+    $ cd traffic_ops/experimental/ui/build
+    $ docker build -t tov2-build .
+    $ docker run -v $(pwd)/artifacts:/artifacts -e GITREPO=https://github.com/apache/incubator-trafficcontrol.git -e BRANCH=master tov2-build
     ```
 
+    The rpm will be created the `artifacts` directory.
+
 ### 2. Install
 
 * Install the Node.js JavaScript runtime
@@ -27,7 +30,7 @@
 * Install the Traffic Ops v2 RPM
 
     ```
-    $ sudo yum install -y traffic_ops_v2-[version]-[commits].[sha].x86_64.rpm
+    $ sudo yum install -y ./artifacts/traffic_ops_v2-[version]-[commits].[sha].x86_64.rpm
     ```
 
 ### 3. Configure


[34/50] incubator-trafficcontrol git commit: Fix TM2 symbol names to be idiomatic

Posted by mi...@apache.org.
Fix TM2 symbol names to be idiomatic


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/32358a6a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/32358a6a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/32358a6a

Branch: refs/heads/master
Commit: 32358a6a77380c2175beedbe3a2eba79f3f1b3c0
Parents: 95ab789
Author: Robert Butts <ro...@gmail.com>
Authored: Thu Oct 20 15:57:05 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../experimental/traffic_monitor/cache/cache.go | 32 +++++------
 .../traffic_monitor/config/config.go            | 14 ++---
 .../traffic_monitor/health/cache_health.go      | 10 ++--
 .../traffic_monitor/manager/datarequest.go      | 10 ++--
 .../traffic_monitor/manager/healthresult.go     | 20 +++----
 .../traffic_monitor/manager/manager.go          |  2 +-
 .../traffic_monitor/manager/monitorconfig.go    | 24 ++++-----
 .../traffic_monitor/manager/peer.go             |  2 +-
 .../traffic_monitor/manager/polledcaches.go     |  2 +-
 .../traffic_monitor/manager/stathistory.go      | 24 ++++-----
 .../traffic_monitor/peer/crstates.go            | 56 ++++++++++----------
 .../experimental/traffic_monitor/peer/peer.go   |  8 +--
 12 files changed, 102 insertions(+), 102 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/32358a6a/traffic_monitor/experimental/traffic_monitor/cache/cache.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/cache/cache.go b/traffic_monitor/experimental/traffic_monitor/cache/cache.go
index 20eb2a5..f679cf5 100644
--- a/traffic_monitor/experimental/traffic_monitor/cache/cache.go
+++ b/traffic_monitor/experimental/traffic_monitor/cache/cache.go
@@ -6,8 +6,8 @@ import (
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/log"
 	dsdata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/deliveryservicedata"
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/enum"
-	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/srvhttp"
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/peer"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/srvhttp"
 	todata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
 	"io"
 	"net/url"
@@ -35,8 +35,8 @@ func NewPrecomputeHandler(toData todata.TODataThreadsafe, peerStates peer.CRStat
 	return Handler{ResultChannel: make(chan Result), MultipleSpaceRegex: regexp.MustCompile(" +"), ToData: &toData, PeerStates: &peerStates}
 }
 
-func (h Handler) Precompute() bool {
-	return h.ToData != nil && h.PeerStates != nil
+func (handler Handler) Precompute() bool {
+	return handler.ToData != nil && handler.PeerStates != nil
 }
 
 type PrecomputedData struct {
@@ -48,7 +48,7 @@ type PrecomputedData struct {
 }
 
 type Result struct {
-	Id        enum.CacheName
+	ID        enum.CacheName
 	Available bool
 	Error     error
 	Astats    Astats
@@ -126,12 +126,12 @@ func StatsMarshall(statHistory map[enum.CacheName][]Result, filter Filter, param
 	return json.Marshal(stats)
 }
 
-func (handler Handler) Handle(id string, r io.Reader, err error, pollId uint64, pollFinished chan<- uint64) {
-	log.Debugf("poll %v %v handle start\n", pollId, time.Now())
+func (handler Handler) Handle(id string, r io.Reader, err error, pollID uint64, pollFinished chan<- uint64) {
+	log.Debugf("poll %v %v handle start\n", pollID, time.Now())
 	result := Result{
-		Id:           enum.CacheName(id),
+		ID:           enum.CacheName(id),
 		Time:         time.Now(), // TODO change this to be computed the instant we get the result back, to minimise inaccuracy
-		PollID:       pollId,
+		PollID:       pollID,
 		PollFinished: pollFinished,
 	}
 
@@ -166,7 +166,7 @@ func (handler Handler) Handle(id string, r io.Reader, err error, pollId uint64,
 		log.Warnf("addkbps %s inf.speed empty\n", id)
 	}
 
-	log.Debugf("poll %v %v handle decode end\n", pollId, time.Now())
+	log.Debugf("poll %v %v handle decode end\n", pollID, time.Now())
 
 	if err != nil {
 		result.Error = err
@@ -176,13 +176,13 @@ func (handler Handler) Handle(id string, r io.Reader, err error, pollId uint64,
 	}
 
 	if handler.Precompute() {
-		log.Debugf("poll %v %v handle precompute start\n", pollId, time.Now())
+		log.Debugf("poll %v %v handle precompute start\n", pollID, time.Now())
 		result = handler.precompute(result)
-		log.Debugf("poll %v %v handle precompute end\n", pollId, time.Now())
+		log.Debugf("poll %v %v handle precompute end\n", pollID, time.Now())
 	}
-	log.Debugf("poll %v %v handle write start\n", pollId, time.Now())
+	log.Debugf("poll %v %v handle write start\n", pollID, time.Now())
 	handler.ResultChannel <- result
-	log.Debugf("poll %v %v handle end\n", pollId, time.Now())
+	log.Debugf("poll %v %v handle end\n", pollID, time.Now())
 }
 
 // outBytes takes the proc.net.dev string, and the interface name, and returns the bytes field
@@ -218,7 +218,7 @@ func (handler Handler) precompute(result Result) Result {
 	var err error
 	if result.PrecomputedData.OutBytes, err = outBytes(result.Astats.System.ProcNetDev, result.Astats.System.InfName, handler.MultipleSpaceRegex); err != nil {
 		result.PrecomputedData.OutBytes = 0
-		log.Errorf("addkbps %s handle precomputing outbytes '%v'\n", result.Id, err)
+		log.Errorf("addkbps %s handle precomputing outbytes '%v'\n", result.ID, err)
 	}
 
 	kbpsInMbps := int64(1000)
@@ -226,9 +226,9 @@ func (handler Handler) precompute(result Result) Result {
 
 	for stat, value := range result.Astats.Ats {
 		var err error
-		stats, err = processStat(result.Id, stats, todata, stat, value, result.Time)
+		stats, err = processStat(result.ID, stats, todata, stat, value, result.Time)
 		if err != nil && err != dsdata.ErrNotProcessedStat {
-			log.Errorf("precomputing cache %v stat %v value %v error %v", result.Id, stat, value, err)
+			log.Errorf("precomputing cache %v stat %v value %v error %v", result.ID, stat, value, err)
 			result.PrecomputedData.Errors = append(result.PrecomputedData.Errors, err)
 		}
 	}

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/32358a6a/traffic_monitor/experimental/traffic_monitor/config/config.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/config/config.go b/traffic_monitor/experimental/traffic_monitor/config/config.go
index 316651a..f8bbe30 100644
--- a/traffic_monitor/experimental/traffic_monitor/config/config.go
+++ b/traffic_monitor/experimental/traffic_monitor/config/config.go
@@ -16,7 +16,7 @@ type Config struct {
 	CacheHealthPollingInterval   time.Duration `json:"-"`
 	CacheStatPollingInterval     time.Duration `json:"-"`
 	MonitorConfigPollingInterval time.Duration `json:"-"`
-	HttpTimeout                  time.Duration `json:"-"`
+	HTTPTimeout                  time.Duration `json:"-"`
 	PeerPollingInterval          time.Duration `json:"-"`
 	MaxEvents                    uint64        `json:"max_events"`
 	MaxStatHistory               uint64        `json:"max_stat_history"`
@@ -35,7 +35,7 @@ var DefaultConfig = Config{
 	CacheHealthPollingInterval:   6 * time.Second,
 	CacheStatPollingInterval:     6 * time.Second,
 	MonitorConfigPollingInterval: 5 * time.Second,
-	HttpTimeout:                  2 * time.Second,
+	HTTPTimeout:                  2 * time.Second,
 	PeerPollingInterval:          5 * time.Second,
 	MaxEvents:                    200,
 	MaxStatHistory:               5,
@@ -57,7 +57,7 @@ func (c *Config) MarshalJSON() ([]byte, error) {
 		CacheHealthPollingIntervalMs   uint64 `json:"cache_health_polling_interval_ms"`
 		CacheStatPollingIntervalMs     uint64 `json:"cache_stat_polling_interval_ms"`
 		MonitorConfigPollingIntervalMs uint64 `json:"monitor_config_polling_interval_ms"`
-		HttpTimeoutMs                  uint64 `json:"http_timeout_ms"`
+		HTTPTimeoutMS                  uint64 `json:"http_timeout_ms"`
 		PeerPollingIntervalMs          uint64 `json:"peer_polling_interval_ms"`
 		HealthFlushIntervalMs          uint64 `json:"health_flush_interval_ms"`
 		StatFlushIntervalMs            uint64 `json:"stat_flush_interval_ms"`
@@ -68,7 +68,7 @@ func (c *Config) MarshalJSON() ([]byte, error) {
 		CacheHealthPollingIntervalMs:   uint64(c.CacheHealthPollingInterval / time.Millisecond),
 		CacheStatPollingIntervalMs:     uint64(c.CacheStatPollingInterval / time.Millisecond),
 		MonitorConfigPollingIntervalMs: uint64(c.MonitorConfigPollingInterval / time.Millisecond),
-		HttpTimeoutMs:                  uint64(c.HttpTimeout / time.Millisecond),
+		HTTPTimeoutMS:                  uint64(c.HTTPTimeout / time.Millisecond),
 		PeerPollingIntervalMs:          uint64(c.PeerPollingInterval / time.Millisecond),
 		HealthFlushIntervalMs:          uint64(c.HealthFlushInterval / time.Millisecond),
 		StatFlushIntervalMs:            uint64(c.StatFlushInterval / time.Millisecond),
@@ -82,7 +82,7 @@ func (c *Config) UnmarshalJSON(data []byte) error {
 		CacheHealthPollingIntervalMs   *uint64 `json:"cache_health_polling_interval_ms"`
 		CacheStatPollingIntervalMs     *uint64 `json:"cache_stat_polling_interval_ms"`
 		MonitorConfigPollingIntervalMs *uint64 `json:"monitor_config_polling_interval_ms"`
-		HttpTimeoutMs                  *uint64 `json:"http_timeout_ms"`
+		HTTPTimeoutMS                  *uint64 `json:"http_timeout_ms"`
 		PeerPollingIntervalMs          *uint64 `json:"peer_polling_interval_ms"`
 		HealthFlushIntervalMs          *uint64 `json:"health_flush_interval_ms"`
 		StatFlushIntervalMs            *uint64 `json:"stat_flush_interval_ms"`
@@ -105,8 +105,8 @@ func (c *Config) UnmarshalJSON(data []byte) error {
 	if aux.MonitorConfigPollingIntervalMs != nil {
 		c.MonitorConfigPollingInterval = time.Duration(*aux.MonitorConfigPollingIntervalMs) * time.Millisecond
 	}
-	if aux.HttpTimeoutMs != nil {
-		c.HttpTimeout = time.Duration(*aux.HttpTimeoutMs) * time.Millisecond
+	if aux.HTTPTimeoutMS != nil {
+		c.HTTPTimeout = time.Duration(*aux.HTTPTimeoutMS) * time.Millisecond
 	}
 	if aux.PeerPollingIntervalMs != nil {
 		c.PeerPollingInterval = time.Duration(*aux.PeerPollingIntervalMs) * time.Millisecond

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/32358a6a/traffic_monitor/experimental/traffic_monitor/health/cache_health.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/health/cache_health.go b/traffic_monitor/experimental/traffic_monitor/health/cache_health.go
index cf1acff..11e746e 100644
--- a/traffic_monitor/experimental/traffic_monitor/health/cache_health.go
+++ b/traffic_monitor/experimental/traffic_monitor/health/cache_health.go
@@ -32,7 +32,7 @@ func GetVitals(newResult *cache.Result, prevResult *cache.Result, mc *traffic_op
 		}
 		newResult.Vitals.LoadAvg = oneMinAvg
 	} else {
-		setError(newResult, fmt.Errorf("Can't make sense of '%s' as a load average for %s", newResult.Astats.System.ProcLoadavg, newResult.Id))
+		setError(newResult, fmt.Errorf("Can't make sense of '%s' as a load average for %s", newResult.Astats.System.ProcLoadavg, newResult.ID))
 		return
 	}
 
@@ -68,14 +68,14 @@ func GetVitals(newResult *cache.Result, prevResult *cache.Result, mc *traffic_op
 	// inf.speed -- value looks like "10000" (without the quotes) so it is in Mbps.
 	// TODO JvD: Should we really be running this code every second for every cache polled????? I don't think so.
 	interfaceBandwidth := newResult.Astats.System.InfSpeed
-	newResult.Vitals.MaxKbpsOut = int64(interfaceBandwidth)*1000 - mc.Profile[mc.TrafficServer[string(newResult.Id)].Profile].Parameters.MinFreeKbps
+	newResult.Vitals.MaxKbpsOut = int64(interfaceBandwidth)*1000 - mc.Profile[mc.TrafficServer[string(newResult.ID)].Profile].Parameters.MinFreeKbps
 
 	// log.Infoln(newResult.Id, "BytesOut", newResult.Vitals.BytesOut, "BytesIn", newResult.Vitals.BytesIn, "Kbps", newResult.Vitals.KbpsOut, "max", newResult.Vitals.MaxKbpsOut)
 }
 
 // EvalCache returns whether the given cache should be marked available, and a string describing why
 func EvalCache(result cache.Result, mc *traffic_ops.TrafficMonitorConfigMap) (bool, string) {
-	status := mc.TrafficServer[string(result.Id)].Status
+	status := mc.TrafficServer[string(result.ID)].Status
 	switch {
 	case status == "ADMIN_DOWN":
 		return false, "set to ADMIN_DOWN"
@@ -85,8 +85,8 @@ func EvalCache(result cache.Result, mc *traffic_ops.TrafficMonitorConfigMap) (bo
 		return true, "set to ONLINE"
 	case result.Error != nil:
 		return false, fmt.Sprintf("error: %v", result.Error)
-	case result.Vitals.LoadAvg > mc.Profile[mc.TrafficServer[string(result.Id)].Profile].Parameters.HealthThresholdLoadAvg:
-		return false, fmt.Sprintf("load average %f exceeds threshold %f", result.Vitals.LoadAvg, mc.Profile[mc.TrafficServer[string(result.Id)].Profile].Parameters.HealthThresholdLoadAvg)
+	case result.Vitals.LoadAvg > mc.Profile[mc.TrafficServer[string(result.ID)].Profile].Parameters.HealthThresholdLoadAvg:
+		return false, fmt.Sprintf("load average %f exceeds threshold %f", result.Vitals.LoadAvg, mc.Profile[mc.TrafficServer[string(result.ID)].Profile].Parameters.HealthThresholdLoadAvg)
 	case result.Vitals.MaxKbpsOut < result.Vitals.KbpsOut:
 		return false, fmt.Sprintf("%dkbps exceeds max %dkbps", result.Vitals.KbpsOut, result.Vitals.MaxKbpsOut)
 	default:

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/32358a6a/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go b/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
index 52d2d17..e754f89 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
@@ -16,8 +16,8 @@ import (
 	ds "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/deliveryservice"
 	dsdata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/deliveryservicedata"
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/enum"
-	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/srvhttp"
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/peer"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/srvhttp"
 	todata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
 	towrap "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopswrapper"
 )
@@ -30,7 +30,7 @@ type CacheState struct {
 	Value bool `json:"value"`
 }
 
-type ApiPeerStates struct {
+type APIPeerStates struct {
 	srvhttp.CommonAPIData
 	Peers map[enum.TrafficMonitorName]map[enum.CacheName][]CacheState `json:"peers"`
 }
@@ -487,7 +487,7 @@ func DataRequest(
 			return []byte(err.Error()), http.StatusBadRequest
 		}
 
-		body, err = json.Marshal(createApiPeerStates(peerStates.Get(), filter, req.Parameters))
+		body, err = json.Marshal(createAPIPeerStates(peerStates.Get(), filter, req.Parameters))
 		return commonReturn(body, err)
 	case srvhttp.StatSummary:
 		return nil, http.StatusNotImplemented
@@ -671,8 +671,8 @@ func cacheAvailableCount(caches map[enum.CacheName]peer.IsAvailable) int {
 	return len(caches) - cacheDownCount(caches)
 }
 
-func createApiPeerStates(peerStates map[enum.TrafficMonitorName]peer.Crstates, filter *PeerStateFilter, params url.Values) ApiPeerStates {
-	apiPeerStates := ApiPeerStates{
+func createAPIPeerStates(peerStates map[enum.TrafficMonitorName]peer.Crstates, filter *PeerStateFilter, params url.Values) APIPeerStates {
+	apiPeerStates := APIPeerStates{
 		CommonAPIData: srvhttp.GetCommonAPIData(params, time.Now()),
 		Peers:         map[enum.TrafficMonitorName]map[enum.CacheName][]CacheState{},
 	}

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/32358a6a/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go b/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go
index dda4d27..5074f26 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go
@@ -189,7 +189,7 @@ func processHealthResult(
 		log.Debugf("poll %v %v healthresultman start\n", healthResult.PollID, time.Now())
 		fetchCount.Inc()
 		var prevResult cache.Result
-		healthResultHistory := healthHistory[enum.CacheName(healthResult.Id)]
+		healthResultHistory := healthHistory[enum.CacheName(healthResult.ID)]
 		if len(healthResultHistory) != 0 {
 			prevResult = healthResultHistory[len(healthResultHistory)-1]
 		}
@@ -198,16 +198,16 @@ func processHealthResult(
 			health.GetVitals(&healthResult, &prevResult, &monitorConfigCopy)
 		}
 
-		healthHistory[enum.CacheName(healthResult.Id)] = pruneHistory(append(healthHistory[enum.CacheName(healthResult.Id)], healthResult), cfg.MaxHealthHistory)
+		healthHistory[enum.CacheName(healthResult.ID)] = pruneHistory(append(healthHistory[enum.CacheName(healthResult.ID)], healthResult), cfg.MaxHealthHistory)
 
 		isAvailable, whyAvailable := health.EvalCache(healthResult, &monitorConfigCopy)
-		if localStates.Get().Caches[healthResult.Id].IsAvailable != isAvailable {
-			log.Infof("Changing state for %s was: %t now: %t because %s error: %v", healthResult.Id, prevResult.Available, isAvailable, whyAvailable, healthResult.Error)
-			events.Add(Event{Time: time.Now().Unix(), Description: whyAvailable, Name: healthResult.Id, Hostname: healthResult.Id, Type: toDataCopy.ServerTypes[healthResult.Id].String(), Available: isAvailable})
+		if localStates.Get().Caches[healthResult.ID].IsAvailable != isAvailable {
+			log.Infof("Changing state for %s was: %t now: %t because %s error: %v", healthResult.ID, prevResult.Available, isAvailable, whyAvailable, healthResult.Error)
+			events.Add(Event{Time: time.Now().Unix(), Description: whyAvailable, Name: healthResult.ID, Hostname: healthResult.ID, Type: toDataCopy.ServerTypes[healthResult.ID].String(), Available: isAvailable})
 		}
 
-		localCacheStatus[healthResult.Id] = CacheAvailableStatus{Available: isAvailable, Status: monitorConfigCopy.TrafficServer[string(healthResult.Id)].Status} // TODO move within localStates?
-		localStates.SetCache(healthResult.Id, peer.IsAvailable{IsAvailable: isAvailable})
+		localCacheStatus[healthResult.ID] = CacheAvailableStatus{Available: isAvailable, Status: monitorConfigCopy.TrafficServer[string(healthResult.ID)].Status} // TODO move within localStates?
+		localStates.SetCache(healthResult.ID, peer.IsAvailable{IsAvailable: isAvailable})
 		log.Debugf("poll %v %v calculateDeliveryServiceState start\n", healthResult.PollID, time.Now())
 		calculateDeliveryServiceState(toDataCopy.DeliveryServiceServers, localStates)
 		log.Debugf("poll %v %v calculateDeliveryServiceState end\n", healthResult.PollID, time.Now())
@@ -217,11 +217,11 @@ func processHealthResult(
 
 	lastHealthDurations := lastHealthDurationsThreadsafe.Get().Copy()
 	for _, healthResult := range results {
-		if lastHealthStart, ok := lastHealthEndTimes[enum.CacheName(healthResult.Id)]; ok {
+		if lastHealthStart, ok := lastHealthEndTimes[enum.CacheName(healthResult.ID)]; ok {
 			d := time.Since(lastHealthStart)
-			lastHealthDurations[enum.CacheName(healthResult.Id)] = d
+			lastHealthDurations[enum.CacheName(healthResult.ID)] = d
 		}
-		lastHealthEndTimes[enum.CacheName(healthResult.Id)] = time.Now()
+		lastHealthEndTimes[enum.CacheName(healthResult.ID)] = time.Now()
 
 		log.Debugf("poll %v %v finish\n", healthResult.PollID, time.Now())
 		healthResult.PollFinished <- healthResult.PollID

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/32358a6a/traffic_monitor/experimental/traffic_monitor/manager/manager.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/manager.go b/traffic_monitor/experimental/traffic_monitor/manager/manager.go
index fe87d90..ea4b106 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/manager.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/manager.go
@@ -41,7 +41,7 @@ func Start(opsConfigFile string, cfg config.Config, staticAppData StaticAppData)
 
 	// TODO investigate whether a unique client per cache to be polled is faster
 	sharedClient := &http.Client{
-		Timeout:   cfg.HttpTimeout,
+		Timeout:   cfg.HTTPTimeout,
 		Transport: &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}},
 	}
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/32358a6a/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go b/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
index 2e39771..fa24f04 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
@@ -67,9 +67,9 @@ func (t *TrafficMonitorConfigMapThreadsafe) Set(c to.TrafficMonitorConfigMap) {
 func StartMonitorConfigManager(
 	monitorConfigPollChan <-chan to.TrafficMonitorConfigMap,
 	localStates peer.CRStatesThreadsafe,
-	statUrlSubscriber chan<- poller.HttpPollerConfig,
-	healthUrlSubscriber chan<- poller.HttpPollerConfig,
-	peerUrlSubscriber chan<- poller.HttpPollerConfig,
+	statURLSubscriber chan<- poller.HttpPollerConfig,
+	healthURLSubscriber chan<- poller.HttpPollerConfig,
+	peerURLSubscriber chan<- poller.HttpPollerConfig,
 	cachesChangeSubscriber chan<- struct{},
 	cfg config.Config,
 	staticAppData StaticAppData,
@@ -78,9 +78,9 @@ func StartMonitorConfigManager(
 	go monitorConfigListen(monitorConfig,
 		monitorConfigPollChan,
 		localStates,
-		statUrlSubscriber,
-		healthUrlSubscriber,
-		peerUrlSubscriber,
+		statURLSubscriber,
+		healthURLSubscriber,
+		peerURLSubscriber,
 		cachesChangeSubscriber,
 		cfg,
 		staticAppData,
@@ -94,9 +94,9 @@ func monitorConfigListen(
 	monitorConfigTS TrafficMonitorConfigMapThreadsafe,
 	monitorConfigPollChan <-chan to.TrafficMonitorConfigMap,
 	localStates peer.CRStatesThreadsafe,
-	statUrlSubscriber chan<- poller.HttpPollerConfig,
-	healthUrlSubscriber chan<- poller.HttpPollerConfig,
-	peerUrlSubscriber chan<- poller.HttpPollerConfig,
+	statURLSubscriber chan<- poller.HttpPollerConfig,
+	healthURLSubscriber chan<- poller.HttpPollerConfig,
+	peerURLSubscriber chan<- poller.HttpPollerConfig,
 	cachesChangeSubscriber chan<- struct{},
 	cfg config.Config,
 	staticAppData StaticAppData,
@@ -152,9 +152,9 @@ func monitorConfigListen(
 			peerUrls[srv.HostName] = url
 		}
 
-		statUrlSubscriber <- poller.HttpPollerConfig{Urls: statUrls, Interval: cfg.CacheStatPollingInterval}
-		healthUrlSubscriber <- poller.HttpPollerConfig{Urls: healthUrls, Interval: cfg.CacheHealthPollingInterval}
-		peerUrlSubscriber <- poller.HttpPollerConfig{Urls: peerUrls, Interval: cfg.PeerPollingInterval}
+		statURLSubscriber <- poller.HttpPollerConfig{Urls: statUrls, Interval: cfg.CacheStatPollingInterval}
+		healthURLSubscriber <- poller.HttpPollerConfig{Urls: healthUrls, Interval: cfg.CacheHealthPollingInterval}
+		peerURLSubscriber <- poller.HttpPollerConfig{Urls: peerUrls, Interval: cfg.PeerPollingInterval}
 
 		for cacheName := range localStates.GetCaches() {
 			if _, exists := monitorConfig.TrafficServer[string(cacheName)]; !exists {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/32358a6a/traffic_monitor/experimental/traffic_monitor/manager/peer.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/peer.go b/traffic_monitor/experimental/traffic_monitor/manager/peer.go
index 111ffc6..2bca917 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/peer.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/peer.go
@@ -17,7 +17,7 @@ func StartPeerManager(
 	combinedStates := peer.NewCRStatesThreadsafe()
 	go func() {
 		for crStatesResult := range peerChan {
-			peerStates.Set(crStatesResult.Id, crStatesResult.PeerStats)
+			peerStates.Set(crStatesResult.ID, crStatesResult.PeerStats)
 			combinedStates.Set(combineCrStates(peerStates.Get(), localStates.Get()))
 			crStatesResult.PollFinished <- crStatesResult.PollID
 		}

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/32358a6a/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go b/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go
index 48e4f71..9b66a8d 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go
@@ -96,7 +96,7 @@ func (t *UnpolledCachesThreadsafe) SetPolled(results []cache.Result, lastStatsTh
 	for cache, _ := range unpolledCaches {
 	innerLoop:
 		for _, result := range results {
-			if result.Id != cache {
+			if result.ID != cache {
 				continue
 			}
 			if !result.Available || len(result.Errors) > 0 {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/32358a6a/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go b/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
index 9cf0fdc..ac1c7a6 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
@@ -47,17 +47,17 @@ func NewStatHistoryThreadsafe(maxHistory uint64) StatHistoryThreadsafe {
 }
 
 // Get returns the StatHistory. Callers MUST NOT modify. If mutation is necessary, call StatHistory.Copy()
-func (t *StatHistoryThreadsafe) Get() StatHistory {
-	t.m.RLock()
-	defer t.m.RUnlock()
-	return *t.statHistory
+func (h *StatHistoryThreadsafe) Get() StatHistory {
+	h.m.RLock()
+	defer h.m.RUnlock()
+	return *h.statHistory
 }
 
 // Set sets the internal StatHistory. This is only safe for one thread of execution. This MUST NOT be called from multiple threads.
-func (t *StatHistoryThreadsafe) Set(v StatHistory) {
-	t.m.Lock()
-	*t.statHistory = v
-	t.m.Unlock()
+func (h *StatHistoryThreadsafe) Set(v StatHistory) {
+	h.m.Lock()
+	*h.statHistory = v
+	h.m.Unlock()
 }
 
 func pruneHistory(history []cache.Result, limit uint64) []cache.Result {
@@ -151,7 +151,7 @@ func processStatResults(
 	maxStats := statHistoryThreadsafe.Max()
 	for _, result := range results {
 		// TODO determine if we want to add results with errors, or just print the errors now and don't add them.
-		statHistory[enum.CacheName(result.Id)] = pruneHistory(append(statHistory[enum.CacheName(result.Id)], result), maxStats)
+		statHistory[enum.CacheName(result.ID)] = pruneHistory(append(statHistory[enum.CacheName(result.ID)], result), maxStats)
 	}
 	statHistoryThreadsafe.Set(statHistory)
 
@@ -176,11 +176,11 @@ func processStatResults(
 	endTime := time.Now()
 	lastStatDurations := lastStatDurationsThreadsafe.Get().Copy()
 	for _, result := range results {
-		if lastStatStart, ok := lastStatEndTimes[enum.CacheName(result.Id)]; ok {
+		if lastStatStart, ok := lastStatEndTimes[enum.CacheName(result.ID)]; ok {
 			d := time.Since(lastStatStart)
-			lastStatDurations[enum.CacheName(result.Id)] = d
+			lastStatDurations[enum.CacheName(result.ID)] = d
 		}
-		lastStatEndTimes[enum.CacheName(result.Id)] = endTime
+		lastStatEndTimes[enum.CacheName(result.ID)] = endTime
 
 		// log.Debugf("poll %v %v statfinish\n", result.PollID, endTime)
 		result.PollFinished <- result.PollID

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/32358a6a/traffic_monitor/experimental/traffic_monitor/peer/crstates.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/peer/crstates.go b/traffic_monitor/experimental/traffic_monitor/peer/crstates.go
index 6f4bda7..1aaf314 100644
--- a/traffic_monitor/experimental/traffic_monitor/peer/crstates.go
+++ b/traffic_monitor/experimental/traffic_monitor/peer/crstates.go
@@ -110,40 +110,40 @@ func (t *CRStatesThreadsafe) GetDeliveryService(name enum.DeliveryServiceName) D
 	return t.crStates.Deliveryservice[name]
 }
 
-func (o *CRStatesThreadsafe) Set(newCRStates Crstates) {
-	o.m.Lock()
-	*o.crStates = newCRStates
-	o.m.Unlock()
+func (t *CRStatesThreadsafe) Set(newCRStates Crstates) {
+	t.m.Lock()
+	*t.crStates = newCRStates
+	t.m.Unlock()
 }
 
-func (o *CRStatesThreadsafe) SetCache(cacheName enum.CacheName, available IsAvailable) {
-	o.m.Lock()
-	o.crStates.Caches[cacheName] = available
-	o.m.Unlock()
+func (t *CRStatesThreadsafe) SetCache(cacheName enum.CacheName, available IsAvailable) {
+	t.m.Lock()
+	t.crStates.Caches[cacheName] = available
+	t.m.Unlock()
 }
 
-func (o *CRStatesThreadsafe) DeleteCache(name enum.CacheName) {
-	o.m.Lock()
-	delete(o.crStates.Caches, name)
-	o.m.Unlock()
+func (t *CRStatesThreadsafe) DeleteCache(name enum.CacheName) {
+	t.m.Lock()
+	delete(t.crStates.Caches, name)
+	t.m.Unlock()
 }
 
-func (o *CRStatesThreadsafe) SetDeliveryService(name enum.DeliveryServiceName, ds Deliveryservice) {
-	o.m.Lock()
-	o.crStates.Deliveryservice[name] = ds
-	o.m.Unlock()
+func (t *CRStatesThreadsafe) SetDeliveryService(name enum.DeliveryServiceName, ds Deliveryservice) {
+	t.m.Lock()
+	t.crStates.Deliveryservice[name] = ds
+	t.m.Unlock()
 }
 
-func (o *CRStatesThreadsafe) SetDeliveryServices(deliveryServices map[enum.DeliveryServiceName]Deliveryservice) {
-	o.m.Lock()
-	o.crStates.Deliveryservice = deliveryServices
-	o.m.Unlock()
+func (t *CRStatesThreadsafe) SetDeliveryServices(deliveryServices map[enum.DeliveryServiceName]Deliveryservice) {
+	t.m.Lock()
+	t.crStates.Deliveryservice = deliveryServices
+	t.m.Unlock()
 }
 
-func (o *CRStatesThreadsafe) DeleteDeliveryService(name enum.DeliveryServiceName) {
-	o.m.Lock()
-	delete(o.crStates.Deliveryservice, name)
-	o.m.Unlock()
+func (t *CRStatesThreadsafe) DeleteDeliveryService(name enum.DeliveryServiceName) {
+	t.m.Lock()
+	delete(t.crStates.Deliveryservice, name)
+	t.m.Unlock()
 }
 
 // This could be made lock-free, if the performance was necessary
@@ -166,8 +166,8 @@ func (t *CRStatesPeersThreadsafe) Get() map[enum.TrafficMonitorName]Crstates {
 	return m
 }
 
-func (o *CRStatesPeersThreadsafe) Set(peerName enum.TrafficMonitorName, peerState Crstates) {
-	o.m.Lock()
-	o.crStates[peerName] = peerState
-	o.m.Unlock()
+func (t *CRStatesPeersThreadsafe) Set(peerName enum.TrafficMonitorName, peerState Crstates) {
+	t.m.Lock()
+	t.crStates[peerName] = peerState
+	t.m.Unlock()
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/32358a6a/traffic_monitor/experimental/traffic_monitor/peer/peer.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/peer/peer.go b/traffic_monitor/experimental/traffic_monitor/peer/peer.go
index f1788d9..ae898eb 100644
--- a/traffic_monitor/experimental/traffic_monitor/peer/peer.go
+++ b/traffic_monitor/experimental/traffic_monitor/peer/peer.go
@@ -17,7 +17,7 @@ func NewHandler() Handler {
 }
 
 type Result struct {
-	Id           enum.TrafficMonitorName
+	ID           enum.TrafficMonitorName
 	Available    bool
 	Errors       []error
 	PeerStats    Crstates
@@ -25,12 +25,12 @@ type Result struct {
 	PollFinished chan<- uint64
 }
 
-func (handler Handler) Handle(id string, r io.Reader, err error, pollId uint64, pollFinished chan<- uint64) {
+func (handler Handler) Handle(id string, r io.Reader, err error, pollID uint64, pollFinished chan<- uint64) {
 	result := Result{
-		Id:           enum.TrafficMonitorName(id),
+		ID:           enum.TrafficMonitorName(id),
 		Available:    false,
 		Errors:       []error{},
-		PollID:       pollId,
+		PollID:       pollID,
 		PollFinished: pollFinished,
 	}
 


[19/50] incubator-trafficcontrol git commit: [TC-9] Update DISCLAIMER, NOTICE, CONTRIBUTING.md. Moved Cisco copyrights to NOTICE.

Posted by mi...@apache.org.
[TC-9] Update DISCLAIMER, NOTICE, CONTRIBUTING.md. Moved Cisco copyrights to NOTICE.


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/e11cbd3e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/e11cbd3e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/e11cbd3e

Branch: refs/heads/master
Commit: e11cbd3e8ab031214e217a4330a79819b2f868d6
Parents: 036195d
Author: Eric Friedrich <ef...@cisco.com>
Authored: Wed Oct 26 16:08:15 2016 -0700
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 CONTRIBUTING.md                                        | 10 +++++-----
 DISCLAIMER                                             |  1 +
 NOTICE                                                 | 13 ++++++++++---
 docs/source/admin/quick_howto/regionalgeo.rst          |  1 -
 .../development/traffic_ops_api/v12/division.rst       |  1 -
 .../20160202000000_add_regional_geo_blocking.sql       |  2 --
 .../20160630000000_add_multisite_algrithom.sql         |  1 -
 .../migrations/20160630010009_add_secure_parameter.sql |  1 -
 .../20160729000000_add_geolimit_redirect_url.sql       |  1 -
 traffic_ops/app/lib/API/Topology.pm                    |  1 -
 .../traffic_router/core/loc/RegionalGeo.java           |  1 -
 .../traffic_router/core/loc/RegionalGeoDsvc.java       |  1 -
 .../traffic_router/core/loc/RegionalGeoResult.java     |  1 -
 .../traffic_router/core/loc/RegionalGeoRule.java       |  1 -
 .../traffic_router/core/loc/RegionalGeoUpdater.java    |  1 -
 .../traffic_router/core/loc/RegionalGeoRuleTest.java   |  1 -
 .../traffic_router/core/loc/RegionalGeoTest.java       |  1 -
 17 files changed, 16 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e11cbd3e/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 6e6addf..642784c 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -3,13 +3,13 @@ How To Contribute
 
 We love pull requests! We simply don't have the time or resources to add every feature and support every platform. If you have improvements for Traffic Control, we're more than happy to merge them in.
 
-We have a few [guidelines](https://github.com/Comcast/traffic_control/blob/master/CONTRIBUTING.md#guidelines) to help maintain code quality and ensure the pull request process goes smoothly.
+We have a few [guidelines](https://github.com/apache/incubator-trafficcontrol/blob/master/CONTRIBUTING.md#guidelines) to help maintain code quality and ensure the pull request process goes smoothly.
 
 Remember, it doesn't have to be perfect. If you want to help, hack it together and submit a [pull request](https://help.github.com/articles/using-pull-requests/). We'll work with you to make sure it fits properly into the project.
 
-Contributor License Agreement
+CONTRIBUTORS.md
 -----------------------------
-First things first, we need you to sign the [Contributor License Agreement (CLA)](http://traffic-control-cdn.net/ComcastContributorLicenseAgreement_03-07-14.pdf) before we can accept your code. This protects us, you, and everyone else using and contributing to Traffic Control. Once you have signed the CLA and had your first pull request merged, your name will be added to the [list of contributors](https://github.com/Comcast/traffic_control/blob/master/CONTRIBUTORS.md).
+Please take the opportunity of submitting your first PR to additionally include your name in CONTRIBUTORS.md
 
 Making a pull request
 ---------------------
@@ -21,9 +21,9 @@ Following the project conventions will make the pull request process go faster a
 
 #### Create an issue
 
-If you want to add a new feature, make a [Github issue](https://github.com/Comcast/traffic_control/issues) and discuss it with us first at [Traffic Control Google Group](https://groups.google.com/forum/#!forum/traffic_control-discuss). We might already be working on it, or there might be an existing way to do it.
+If you want to add a new feature, make a [JIRA issue](https://issues.apache.org/jira/browse/TC) and discuss it with us first on the [users@trafficcontrol.incubator.apache.org](mailto:users@trafficcontrol.incubator.apache.org) mailing list. We might already be working on it, or there might be an existing way to do it.
 
-If it's a bug fix, we need to know what the problem is and how to reproduce it so please create a [Github issue](https://github.com/Comcast/traffic_control/issues) for that as well.
+If it's a bug fix, we need to know what the problem is and how to reproduce it so please create a [JIRA issue](https://issues.apache.org/jira/browse/TC) for that as well.
 
 #### Documentation
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e11cbd3e/DISCLAIMER
----------------------------------------------------------------------
diff --git a/DISCLAIMER b/DISCLAIMER
new file mode 100644
index 0000000..0c91830
--- /dev/null
+++ b/DISCLAIMER
@@ -0,0 +1 @@
+Apache Traffic Control is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e11cbd3e/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
index f286598..607f549 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,4 +1,11 @@
-Traffic Control
-Copyright 2012-2015 Comcast Cable Communications Management, LLC
+Apache Traffic Control (incubating)
+Copyright 2016 The Apache Software Foundation
 
-This product includes software developed at Comcast (http://www.comcast.com/).
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+Portions of this software were developed at
+Comcast (http://www.comcast.com/).
+
+Portions of this software were developed at
+Cisco Systems, Inc. (http://www.cisco.com)

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e11cbd3e/docs/source/admin/quick_howto/regionalgeo.rst
----------------------------------------------------------------------
diff --git a/docs/source/admin/quick_howto/regionalgeo.rst b/docs/source/admin/quick_howto/regionalgeo.rst
index 58f8851..a903c8a 100644
--- a/docs/source/admin/quick_howto/regionalgeo.rst
+++ b/docs/source/admin/quick_howto/regionalgeo.rst
@@ -1,5 +1,4 @@
 ..
-.. Copyright 2015 Cisco Systems, Inc.
 ..
 .. Licensed under the Apache License, Version 2.0 (the "License");
 .. you may not use this file except in compliance with the License.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e11cbd3e/docs/source/development/traffic_ops_api/v12/division.rst
----------------------------------------------------------------------
diff --git a/docs/source/development/traffic_ops_api/v12/division.rst b/docs/source/development/traffic_ops_api/v12/division.rst
index 2d9403a..934c393 100644
--- a/docs/source/development/traffic_ops_api/v12/division.rst
+++ b/docs/source/development/traffic_ops_api/v12/division.rst
@@ -1,5 +1,4 @@
 .. 
-.. Copyright 2016 Cisco
 .. 
 .. Licensed under the Apache License, Version 2.0 (the "License");
 .. you may not use this file except in compliance with the License.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e11cbd3e/traffic_ops/app/db/migrations/20160202000000_add_regional_geo_blocking.sql
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/migrations/20160202000000_add_regional_geo_blocking.sql b/traffic_ops/app/db/migrations/20160202000000_add_regional_geo_blocking.sql
index b5d58fd..b929945 100644
--- a/traffic_ops/app/db/migrations/20160202000000_add_regional_geo_blocking.sql
+++ b/traffic_ops/app/db/migrations/20160202000000_add_regional_geo_blocking.sql
@@ -1,6 +1,4 @@
 /*
-	Copyright 2015 Cisco Systems, Inc.
-
 	Licensed under the Apache License, Version 2.0 (the "License");
 	you may not use this file except in compliance with the License.
 	You may obtain a copy of the License at

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e11cbd3e/traffic_ops/app/db/migrations/20160630000000_add_multisite_algrithom.sql
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/migrations/20160630000000_add_multisite_algrithom.sql b/traffic_ops/app/db/migrations/20160630000000_add_multisite_algrithom.sql
index dfaff38..b7a1a04 100644
--- a/traffic_ops/app/db/migrations/20160630000000_add_multisite_algrithom.sql
+++ b/traffic_ops/app/db/migrations/20160630000000_add_multisite_algrithom.sql
@@ -1,5 +1,4 @@
 /*
-	Copyright 2016 Cisco Systems, Inc.
 
 	Licensed under the Apache License, Version 2.0 (the "License");
 	you may not use this file except in compliance with the License.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e11cbd3e/traffic_ops/app/db/migrations/20160630010009_add_secure_parameter.sql
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/migrations/20160630010009_add_secure_parameter.sql b/traffic_ops/app/db/migrations/20160630010009_add_secure_parameter.sql
index 17a0545..eacc13b 100644
--- a/traffic_ops/app/db/migrations/20160630010009_add_secure_parameter.sql
+++ b/traffic_ops/app/db/migrations/20160630010009_add_secure_parameter.sql
@@ -1,5 +1,4 @@
 /*
-	Copyright 2015 Cisco Systems, Inc.
 
 	Licensed under the Apache License, Version 2.0 (the "License");
 	you may not use this file except in compliance with the License.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e11cbd3e/traffic_ops/app/db/migrations/20160729000000_add_geolimit_redirect_url.sql
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/migrations/20160729000000_add_geolimit_redirect_url.sql b/traffic_ops/app/db/migrations/20160729000000_add_geolimit_redirect_url.sql
index eea27cd..959362b 100644
--- a/traffic_ops/app/db/migrations/20160729000000_add_geolimit_redirect_url.sql
+++ b/traffic_ops/app/db/migrations/20160729000000_add_geolimit_redirect_url.sql
@@ -1,5 +1,4 @@
 /*
-       Copyright 2016 Cisco,
        
        Licensed under the Apache License, Version 2.0 (the "License");
        you may not use this file except in compliance with the License.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e11cbd3e/traffic_ops/app/lib/API/Topology.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/API/Topology.pm b/traffic_ops/app/lib/API/Topology.pm
index f07e875..fa4dcb7 100644
--- a/traffic_ops/app/lib/API/Topology.pm
+++ b/traffic_ops/app/lib/API/Topology.pm
@@ -1,6 +1,5 @@
 package API::Topology;
 #
-## Copyright 2016 Cisco, LLC
 ##
 ## Licensed under the Apache License, Version 2.0 (the "License");
 ## you may not use this file except in compliance with the License.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e11cbd3e/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeo.java
----------------------------------------------------------------------
diff --git a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeo.java b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeo.java
index 92235d0..26a8a96 100644
--- a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeo.java
+++ b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeo.java
@@ -1,5 +1,4 @@
 /*
- * Copyright 2015 Cisco Systems, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e11cbd3e/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoDsvc.java
----------------------------------------------------------------------
diff --git a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoDsvc.java b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoDsvc.java
index 7a2fabf..9f9d7d1 100644
--- a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoDsvc.java
+++ b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoDsvc.java
@@ -1,5 +1,4 @@
 /*
- * Copyright 2015 Cisco Systems, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e11cbd3e/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoResult.java
----------------------------------------------------------------------
diff --git a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoResult.java b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoResult.java
index 5ae9b2f..c9d9de5 100644
--- a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoResult.java
+++ b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoResult.java
@@ -1,5 +1,4 @@
 /*
- * Copyright 2015 Cisco Systems, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e11cbd3e/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoRule.java
----------------------------------------------------------------------
diff --git a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoRule.java b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoRule.java
index 52b1ea3..0b5b749 100644
--- a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoRule.java
+++ b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoRule.java
@@ -1,5 +1,4 @@
 /*
- * Copyright 2015 Cisco Systems, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e11cbd3e/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoUpdater.java
----------------------------------------------------------------------
diff --git a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoUpdater.java b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoUpdater.java
index 2fb0261..4d8ce36 100644
--- a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoUpdater.java
+++ b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoUpdater.java
@@ -1,5 +1,4 @@
 /*
- * Copyright 2015 Cisco Systems, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e11cbd3e/traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoRuleTest.java
----------------------------------------------------------------------
diff --git a/traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoRuleTest.java b/traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoRuleTest.java
index 09c0c46..2be1a8f 100644
--- a/traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoRuleTest.java
+++ b/traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoRuleTest.java
@@ -1,5 +1,4 @@
 /*
- * Copyright 2015 Cisco Systems, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e11cbd3e/traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoTest.java
----------------------------------------------------------------------
diff --git a/traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoTest.java b/traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoTest.java
index eede364..900fd1c 100644
--- a/traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoTest.java
+++ b/traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/RegionalGeoTest.java
@@ -1,5 +1,4 @@
 /*
- * Copyright 2015 Cisco Systems, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.


[26/50] incubator-trafficcontrol git commit: Fix TM2 error message missing format value

Posted by mi...@apache.org.
Fix TM2 error message missing format value


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/105c35ce
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/105c35ce
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/105c35ce

Branch: refs/heads/master
Commit: 105c35cecf43e803845af3a3dbb34108831b8ab6
Parents: ef0f50c
Author: Robert Butts <ro...@gmail.com>
Authored: Thu Oct 20 09:57:26 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../experimental/traffic_monitor/deliveryservice/stat.go           | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/105c35ce/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
index 3ff93d2..86178fe 100644
--- a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
+++ b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
@@ -298,7 +298,7 @@ func addDSPerSecStats(dsName enum.DeliveryServiceName, stat dsdata.Stat, lastSta
 	for cacheName, cacheStats := range stat.Caches {
 		lastStat.Caches[cacheName], err = addLastStats(lastStat.Caches[cacheName], cacheStats, dsStatsTime)
 		if err != nil {
-			log.Errorf("debugq %v Error adding kbps for cache %v: %v", cacheName, err)
+			log.Errorf("%v adding kbps for cache %v: %v", dsName, cacheName, err)
 			continue
 		}
 		cacheStats.Kbps.Value = lastStat.Caches[cacheName].Bytes.PerSec / BytesPerKilobit


[38/50] incubator-trafficcontrol git commit: create continuous queries for wrap_count

Posted by mi...@apache.org.
create continuous queries for wrap_count


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/c5576109
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/c5576109
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/c5576109

Branch: refs/heads/master
Commit: c55761091baea2074d7c2ce45cbdfe66a5ed0473
Parents: f20a856
Author: Dave Neuman <ne...@apache.org>
Authored: Wed Oct 19 07:45:07 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 traffic_stats/influxdb_tools/create_ts_databases.go | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c5576109/traffic_stats/influxdb_tools/create_ts_databases.go
----------------------------------------------------------------------
diff --git a/traffic_stats/influxdb_tools/create_ts_databases.go b/traffic_stats/influxdb_tools/create_ts_databases.go
index 8e02220..e065b30 100644
--- a/traffic_stats/influxdb_tools/create_ts_databases.go
+++ b/traffic_stats/influxdb_tools/create_ts_databases.go
@@ -83,6 +83,8 @@ func createCacheStats(client influx.Client, replication *string) {
 	createContinuousQuery(client, "connections_cdn_type_1min", `CREATE CONTINUOUS QUERY connections_cdn_type_1min ON cache_stats RESAMPLE FOR 5m BEGIN SELECT sum(value) AS "value" INTO "cache_stats"."monthly"."connections.cdn.type.1min" FROM "cache_stats"."monthly"."connections.1min" GROUP BY time(1m), cdn, type END`)
 	createContinuousQuery(client, "maxKbps_1min", `CREATE CONTINUOUS QUERY maxKbps_1min ON cache_stats RESAMPLE FOR 2m BEGIN SELECT mean(value) AS value INTO cache_stats.monthly."maxkbps.1min" FROM cache_stats.daily.maxKbps GROUP BY time(1m), * END`)
 	createContinuousQuery(client, "maxkbps_cdn_1min", `CREATE CONTINUOUS QUERY maxkbps_cdn_1min ON cache_stats RESAMPLE FOR 5m BEGIN SELECT sum(value) AS value INTO cache_stats.monthly."maxkbps.cdn.1min" FROM cache_stats.monthly."maxkbps.1min" GROUP BY time(1m), cdn END`)
+	createContinuousQuery(client, "wrap_count_vol1_1m", `CREATE CONTINUOUS QUERY wrap_count_vol1_1m ON cache_stats RESAMPLE FOR 2m BEGIN SELECT mean(value) AS vol1_wrap_count INTO cache_stats.monthly."wrap_count.1min" FROM cache_stats.daily."ats.proxy.process.cache.volume_1.wrap_count" GROUP BY time(1m), * END`)
+	createContinuousQuery(client, "wrap_count_vol2_1m", `CREATE CONTINUOUS QUERY wrap_count_vol2_1m ON cache_stats RESAMPLE FOR 2m BEGIN SELECT mean(value) AS vol2_wrap_count INTO cache_stats.monthly."wrap_count.1min" FROM cache_stats.daily."ats.proxy.process.cache.volume_2.wrap_count" GROUP BY time(1m), * END`)
 }
 
 func createDeliveryServiceStats(client influx.Client, replication *string) {


[13/50] incubator-trafficcontrol git commit: test push 2

Posted by mi...@apache.org.
test push 2


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/2ea04e7b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/2ea04e7b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/2ea04e7b

Branch: refs/heads/master
Commit: 2ea04e7b9e76ed1655871abcc114e6faf683c9fc
Parents: 13d8538
Author: Mark Torluemke <mt...@apache.org>
Authored: Sat Oct 22 21:06:20 2016 +0000
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 docs/source/admin/traffic_ops_using.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/2ea04e7b/docs/source/admin/traffic_ops_using.rst
----------------------------------------------------------------------
diff --git a/docs/source/admin/traffic_ops_using.rst b/docs/source/admin/traffic_ops_using.rst
index 4a50742..4700f04 100644
--- a/docs/source/admin/traffic_ops_using.rst
+++ b/docs/source/admin/traffic_ops_using.rst
@@ -1026,7 +1026,7 @@ Fairly straight forward, this button set the **dnssec.enabled** param to either
 
 **Generate Keys**
 
-Generate Keys will generate dnssec keys for the CDN TLD as well as for each Delivery Service in the CDN.  It is important to note that this button will create a new KSK for the TLD and, therefore, a new DS Record.  Any time a new DS Record is created, it will need to be added to the parent zone of the TLD in order for DNSSEC to work properly.  When a user clicks the **Generate Keys** button, they will be presented with a screen with the following fields:
+Generate Keys will generate DNSSEC keys for the CDN TLD as well as for each Delivery Service in the CDN.  It is important to note that this button will create a new KSK for the TLD and, therefore, a new DS Record.  Any time a new DS Record is created, it will need to be added to the parent zone of the TLD in order for DNSSEC to work properly.  When a user clicks the **Generate Keys** button, they will be presented with a screen with the following fields:
 
   - **CDN:** This is not editable and displays the CDN for which keys will be generated
   - **ZSK Expiration (Days):**  Sets how long (in days) the Zone Signing Key will be valid for the CDN and associated Delivery Services. The default is 30 days.


[32/50] incubator-trafficcontrol git commit: Change TM2 Go to be simpler

Posted by mi...@apache.org.
Change TM2 Go to be simpler

Changes `for{ select{ case` to `for range` for single-case selects.
Changes array copies to use `copy` builtin.

This makes all packages in traffic_monitor/experimental satisfy
`gosimple`.


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/b59a93fa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/b59a93fa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/b59a93fa

Branch: refs/heads/master
Commit: b59a93fa4bb7b0a9c93e582569af692aa47f7f93
Parents: 3cbd646
Author: Robert Butts <ro...@gmail.com>
Authored: Thu Oct 20 14:44:38 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../experimental/common/poller/poller.go        |  27 ++--
 .../traffic_monitor/manager/events.go           |   4 +-
 .../traffic_monitor/manager/manager.go          |   7 +-
 .../traffic_monitor/manager/monitorconfig.go    | 133 +++++++++----------
 .../traffic_monitor/manager/opsconfig.go        | 127 +++++++++---------
 .../traffic_monitor/manager/peer.go             |  11 +-
 .../traffic_monitor/manager/stathistory.go      |   4 +-
 7 files changed, 147 insertions(+), 166 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b59a93fa/traffic_monitor/experimental/common/poller/poller.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/common/poller/poller.go b/traffic_monitor/experimental/common/poller/poller.go
index f4a05b3..9a7402f 100644
--- a/traffic_monitor/experimental/common/poller/poller.go
+++ b/traffic_monitor/experimental/common/poller/poller.go
@@ -114,22 +114,19 @@ func (p HttpPoller) Poll() {
 	// iterationCount++ // on tick<:
 	// case p.TickChan <- iterationCount:
 	killChans := map[string]chan<- struct{}{}
-	for {
-		select {
-		case newConfig := <-p.ConfigChannel:
-			deletions, additions := diffConfigs(p.Config, newConfig)
-			for _, id := range deletions {
-				killChan := killChans[id]
-				go func() { killChan <- struct{}{} }() // go - we don't want to wait for old polls to die.
-				delete(killChans, id)
-			}
-			for _, info := range additions {
-				kill := make(chan struct{})
-				killChans[info.ID] = kill
-				go pollHttp(info.Interval, info.ID, info.URL, p.Fetcher, kill)
-			}
-			p.Config = newConfig
+	for newConfig := range p.ConfigChannel {
+		deletions, additions := diffConfigs(p.Config, newConfig)
+		for _, id := range deletions {
+			killChan := killChans[id]
+			go func() { killChan <- struct{}{} }() // go - we don't want to wait for old polls to die.
+			delete(killChans, id)
+		}
+		for _, info := range additions {
+			kill := make(chan struct{})
+			killChans[info.ID] = kill
+			go pollHttp(info.Interval, info.ID, info.URL, p.Fetcher, kill)
 		}
+		p.Config = newConfig
 	}
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b59a93fa/traffic_monitor/experimental/traffic_monitor/manager/events.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/events.go b/traffic_monitor/experimental/traffic_monitor/manager/events.go
index 52c7bbb..3d6c139 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/events.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/events.go
@@ -25,9 +25,7 @@ type EventsThreadsafe struct {
 
 func copyEvents(a []Event) []Event {
 	b := make([]Event, len(a), len(a))
-	for i, v := range a {
-		b[i] = v
-	}
+	copy(b, a)
 	return b
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b59a93fa/traffic_monitor/experimental/traffic_monitor/manager/manager.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/manager.go b/traffic_monitor/experimental/traffic_monitor/manager/manager.go
index 30d52c4..fe87d90 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/manager.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/manager.go
@@ -138,10 +138,7 @@ func Start(opsConfigFile string, cfg config.Config, staticAppData StaticAppData)
 
 // healthTickListener listens for health ticks, and writes to the health iteration variable. Does not return.
 func healthTickListener(cacheHealthTick <-chan uint64, healthIteration UintThreadsafe) {
-	for {
-		select {
-		case i := <-cacheHealthTick:
-			healthIteration.Set(i)
-		}
+	for i := range cacheHealthTick {
+		healthIteration.Set(i)
 	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b59a93fa/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go b/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
index fa600a7..2e39771 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
@@ -101,83 +101,80 @@ func monitorConfigListen(
 	cfg config.Config,
 	staticAppData StaticAppData,
 ) {
-	for {
-		select {
-		case monitorConfig := <-monitorConfigPollChan:
-			monitorConfigTS.Set(monitorConfig)
-			healthUrls := map[string]string{}
-			statUrls := map[string]string{}
-			peerUrls := map[string]string{}
-			caches := map[string]string{}
-
-			for _, srv := range monitorConfig.TrafficServer {
-				caches[srv.HostName] = srv.Status
-
-				cacheName := enum.CacheName(srv.HostName)
-
-				if srv.Status == "ONLINE" {
-					localStates.SetCache(cacheName, peer.IsAvailable{IsAvailable: true})
-					continue
-				}
-				if srv.Status == "OFFLINE" {
-					localStates.SetCache(cacheName, peer.IsAvailable{IsAvailable: false})
-					continue
-				}
-				// seed states with available = false until our polling cycle picks up a result
-				if _, exists := localStates.Get().Caches[cacheName]; !exists {
-					localStates.SetCache(cacheName, peer.IsAvailable{IsAvailable: false})
-				}
-
-				url := monitorConfig.Profile[srv.Profile].Parameters.HealthPollingURL
-				r := strings.NewReplacer(
-					"${hostname}", srv.FQDN,
-					"${interface_name}", srv.InterfaceName,
-					"application=system", "application=plugin.remap",
-					"application=", "application=plugin.remap",
-				)
-				url = r.Replace(url)
-				healthUrls[srv.HostName] = url
-				r = strings.NewReplacer("application=plugin.remap", "application=")
-				url = r.Replace(url)
-				statUrls[srv.HostName] = url
+	for monitorConfig := range monitorConfigPollChan {
+		monitorConfigTS.Set(monitorConfig)
+		healthUrls := map[string]string{}
+		statUrls := map[string]string{}
+		peerUrls := map[string]string{}
+		caches := map[string]string{}
+
+		for _, srv := range monitorConfig.TrafficServer {
+			caches[srv.HostName] = srv.Status
+
+			cacheName := enum.CacheName(srv.HostName)
+
+			if srv.Status == "ONLINE" {
+				localStates.SetCache(cacheName, peer.IsAvailable{IsAvailable: true})
+				continue
+			}
+			if srv.Status == "OFFLINE" {
+				localStates.SetCache(cacheName, peer.IsAvailable{IsAvailable: false})
+				continue
+			}
+			// seed states with available = false until our polling cycle picks up a result
+			if _, exists := localStates.Get().Caches[cacheName]; !exists {
+				localStates.SetCache(cacheName, peer.IsAvailable{IsAvailable: false})
 			}
 
-			for _, srv := range monitorConfig.TrafficMonitor {
-				if srv.HostName == staticAppData.Hostname {
-					continue
-				}
-				if srv.Status != "ONLINE" {
-					continue
-				}
-				// TODO: the URL should be config driven. -jse
-				url := fmt.Sprintf("http://%s:%d/publish/CrStates?raw", srv.IP, srv.Port)
-				peerUrls[srv.HostName] = url
+			url := monitorConfig.Profile[srv.Profile].Parameters.HealthPollingURL
+			r := strings.NewReplacer(
+				"${hostname}", srv.FQDN,
+				"${interface_name}", srv.InterfaceName,
+				"application=system", "application=plugin.remap",
+				"application=", "application=plugin.remap",
+			)
+			url = r.Replace(url)
+			healthUrls[srv.HostName] = url
+			r = strings.NewReplacer("application=plugin.remap", "application=")
+			url = r.Replace(url)
+			statUrls[srv.HostName] = url
+		}
+
+		for _, srv := range monitorConfig.TrafficMonitor {
+			if srv.HostName == staticAppData.Hostname {
+				continue
+			}
+			if srv.Status != "ONLINE" {
+				continue
 			}
+			// TODO: the URL should be config driven. -jse
+			url := fmt.Sprintf("http://%s:%d/publish/CrStates?raw", srv.IP, srv.Port)
+			peerUrls[srv.HostName] = url
+		}
 
-			statUrlSubscriber <- poller.HttpPollerConfig{Urls: statUrls, Interval: cfg.CacheStatPollingInterval}
-			healthUrlSubscriber <- poller.HttpPollerConfig{Urls: healthUrls, Interval: cfg.CacheHealthPollingInterval}
-			peerUrlSubscriber <- poller.HttpPollerConfig{Urls: peerUrls, Interval: cfg.PeerPollingInterval}
+		statUrlSubscriber <- poller.HttpPollerConfig{Urls: statUrls, Interval: cfg.CacheStatPollingInterval}
+		healthUrlSubscriber <- poller.HttpPollerConfig{Urls: healthUrls, Interval: cfg.CacheHealthPollingInterval}
+		peerUrlSubscriber <- poller.HttpPollerConfig{Urls: peerUrls, Interval: cfg.PeerPollingInterval}
 
-			for cacheName := range localStates.GetCaches() {
-				if _, exists := monitorConfig.TrafficServer[string(cacheName)]; !exists {
-					log.Warnf("Removing %s from localStates", cacheName)
-					localStates.DeleteCache(cacheName)
-				}
+		for cacheName := range localStates.GetCaches() {
+			if _, exists := monitorConfig.TrafficServer[string(cacheName)]; !exists {
+				log.Warnf("Removing %s from localStates", cacheName)
+				localStates.DeleteCache(cacheName)
 			}
+		}
 
-			cachesChangeSubscriber <- struct{}{}
+		cachesChangeSubscriber <- struct{}{}
 
-			// TODO because there are multiple writers to localStates.DeliveryService, there is a race condition, where MonitorConfig (this func) and HealthResultManager could write at the same time, and the HealthResultManager could overwrite a delivery service addition or deletion here. Probably the simplest and most performant fix would be a lock-free algorithm using atomic compare-and-swaps.
-			for _, ds := range monitorConfig.DeliveryService {
-				// since caches default to unavailable, also default DS false
-				if _, exists := localStates.Get().Deliveryservice[enum.DeliveryServiceName(ds.XMLID)]; !exists {
-					localStates.SetDeliveryService(enum.DeliveryServiceName(ds.XMLID), peer.Deliveryservice{IsAvailable: false, DisabledLocations: []enum.CacheName{}}) // important to initialize DisabledLocations, so JSON is `[]` not `null`
-				}
+		// TODO because there are multiple writers to localStates.DeliveryService, there is a race condition, where MonitorConfig (this func) and HealthResultManager could write at the same time, and the HealthResultManager could overwrite a delivery service addition or deletion here. Probably the simplest and most performant fix would be a lock-free algorithm using atomic compare-and-swaps.
+		for _, ds := range monitorConfig.DeliveryService {
+			// since caches default to unavailable, also default DS false
+			if _, exists := localStates.Get().Deliveryservice[enum.DeliveryServiceName(ds.XMLID)]; !exists {
+				localStates.SetDeliveryService(enum.DeliveryServiceName(ds.XMLID), peer.Deliveryservice{IsAvailable: false, DisabledLocations: []enum.CacheName{}}) // important to initialize DisabledLocations, so JSON is `[]` not `null`
 			}
-			for ds, _ := range localStates.Get().Deliveryservice {
-				if _, exists := monitorConfig.DeliveryService[string(ds)]; !exists {
-					localStates.DeleteDeliveryService(ds)
-				}
+		}
+		for ds, _ := range localStates.Get().Deliveryservice {
+			if _, exists := monitorConfig.DeliveryService[string(ds)]; !exists {
+				localStates.DeleteDeliveryService(ds)
 			}
 		}
 	}

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b59a93fa/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go b/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
index 927776c..03bc5c9 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
@@ -84,71 +84,68 @@ func StartOpsConfigManager(
 	go func() {
 		httpServer := http_server.Server{}
 
-		for {
-			select {
-			case newOpsConfig := <-opsConfigChannel:
-				var err error
-				opsConfig.Set(newOpsConfig)
-
-				listenAddress := ":80" // default
-
-				if newOpsConfig.HttpListener != "" {
-					listenAddress = newOpsConfig.HttpListener
-				}
-
-				handleErr := func(err error) {
-					errorCount.Inc()
-					log.Errorf("OpsConfigManager: %v\n", err)
-				}
-
-				err = httpServer.Run(func(req http_server.DataRequest) ([]byte, int) {
-					return DataRequest(
-						req,
-						opsConfig,
-						toSession,
-						localStates,
-						peerStates,
-						combinedStates,
-						statHistory,
-						dsStats,
-						events,
-						staticAppData,
-						healthPollInterval,
-						lastHealthDurations,
-						fetchCount,
-						healthIteration,
-						errorCount,
-						toData,
-						localCacheStatus,
-						lastStats,
-						unpolledCaches,
-					)
-				}, listenAddress, cfg.ServeReadTimeout, cfg.ServeWriteTimeout)
-				if err != nil {
-					handleErr(fmt.Errorf("MonitorConfigPoller: error creating HTTP server: %s\n", err))
-					continue
-				}
-
-				realToSession, err := to.Login(newOpsConfig.Url, newOpsConfig.Username, newOpsConfig.Password, newOpsConfig.Insecure)
-				if err != nil {
-					handleErr(fmt.Errorf("MonitorConfigPoller: error instantiating Session with traffic_ops: %s\n", err))
-					continue
-				}
-				toSession.Set(realToSession)
-
-				if err := toData.Fetch(toSession, newOpsConfig.CdnName); err != nil {
-					handleErr(fmt.Errorf("Error getting Traffic Ops data: %v\n", err))
-					continue
-				}
-
-				// These must be in a goroutine, because the monitorConfigPoller tick sends to a channel this select listens for. Thus, if we block on sends to the monitorConfigPoller, we have a livelock race condition.
-				// More generically, we're using goroutines as an infinite chan buffer, to avoid potential livelocks
-				for _, subscriber := range opsConfigChangeSubscribers {
-					go func(s chan<- handler.OpsConfig) { s <- newOpsConfig }(subscriber)
-				}
-				for _, subscriber := range toChangeSubscribers {
-					go func(s chan<- towrap.ITrafficOpsSession) { s <- toSession }(subscriber)
-				}
+		for newOpsConfig := range opsConfigChannel {
+			var err error
+			opsConfig.Set(newOpsConfig)
+
+			listenAddress := ":80" // default
+
+			if newOpsConfig.HttpListener != "" {
+				listenAddress = newOpsConfig.HttpListener
+			}
+
+			handleErr := func(err error) {
+				errorCount.Inc()
+				log.Errorf("OpsConfigManager: %v\n", err)
+			}
+
+			err = httpServer.Run(func(req http_server.DataRequest) ([]byte, int) {
+				return DataRequest(
+					req,
+					opsConfig,
+					toSession,
+					localStates,
+					peerStates,
+					combinedStates,
+					statHistory,
+					dsStats,
+					events,
+					staticAppData,
+					healthPollInterval,
+					lastHealthDurations,
+					fetchCount,
+					healthIteration,
+					errorCount,
+					toData,
+					localCacheStatus,
+					lastStats,
+					unpolledCaches,
+				)
+			}, listenAddress, cfg.ServeReadTimeout, cfg.ServeWriteTimeout)
+			if err != nil {
+				handleErr(fmt.Errorf("MonitorConfigPoller: error creating HTTP server: %s\n", err))
+				continue
+			}
+
+			realToSession, err := to.Login(newOpsConfig.Url, newOpsConfig.Username, newOpsConfig.Password, newOpsConfig.Insecure)
+			if err != nil {
+				handleErr(fmt.Errorf("MonitorConfigPoller: error instantiating Session with traffic_ops: %s\n", err))
+				continue
+			}
+			toSession.Set(realToSession)
+
+			if err := toData.Fetch(toSession, newOpsConfig.CdnName); err != nil {
+				handleErr(fmt.Errorf("Error getting Traffic Ops data: %v\n", err))
+				continue
+			}
+
+			// These must be in a goroutine, because the monitorConfigPoller tick sends to a channel this select listens for. Thus, if we block on sends to the monitorConfigPoller, we have a livelock race condition.
+			// More generically, we're using goroutines as an infinite chan buffer, to avoid potential livelocks
+			for _, subscriber := range opsConfigChangeSubscribers {
+				go func(s chan<- handler.OpsConfig) { s <- newOpsConfig }(subscriber)
+			}
+			for _, subscriber := range toChangeSubscribers {
+				go func(s chan<- towrap.ITrafficOpsSession) { s <- toSession }(subscriber)
 			}
 		}
 	}()

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b59a93fa/traffic_monitor/experimental/traffic_monitor/manager/peer.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/peer.go b/traffic_monitor/experimental/traffic_monitor/manager/peer.go
index dddc265..111ffc6 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/peer.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/peer.go
@@ -16,13 +16,10 @@ func StartPeerManager(
 ) peer.CRStatesThreadsafe {
 	combinedStates := peer.NewCRStatesThreadsafe()
 	go func() {
-		for {
-			select {
-			case crStatesResult := <-peerChan:
-				peerStates.Set(crStatesResult.Id, crStatesResult.PeerStats)
-				combinedStates.Set(combineCrStates(peerStates.Get(), localStates.Get()))
-				crStatesResult.PollFinished <- crStatesResult.PollID
-			}
+		for crStatesResult := range peerChan {
+			peerStates.Set(crStatesResult.Id, crStatesResult.PeerStats)
+			combinedStates.Set(combineCrStates(peerStates.Get(), localStates.Get()))
+			crStatesResult.PollFinished <- crStatesResult.PollID
 		}
 	}()
 	return combinedStates

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b59a93fa/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go b/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
index 455f2cb..9cf0fdc 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
@@ -17,9 +17,7 @@ type StatHistory map[enum.CacheName][]cache.Result
 
 func copyStat(a []cache.Result) []cache.Result {
 	b := make([]cache.Result, len(a), len(a))
-	for i, v := range a {
-		b[i] = v
-	}
+	copy(b, a)
 	return b
 }
 


[16/50] incubator-trafficcontrol git commit: updated logo in help->about to new logo

Posted by mi...@apache.org.
updated logo in help->about to new logo


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/52a09081
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/52a09081
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/52a09081

Branch: refs/heads/master
Commit: 52a09081d094347f5a16ac4100a44f92be2bc49f
Parents: b08c090
Author: Dave Neuman <ne...@apache.org>
Authored: Mon Oct 24 13:24:16 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 traffic_ops/app/public/images/tc_logo.png | Bin 89813 -> 32879 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/52a09081/traffic_ops/app/public/images/tc_logo.png
----------------------------------------------------------------------
diff --git a/traffic_ops/app/public/images/tc_logo.png b/traffic_ops/app/public/images/tc_logo.png
index e30944c..6abb40d 100644
Binary files a/traffic_ops/app/public/images/tc_logo.png and b/traffic_ops/app/public/images/tc_logo.png differ


[18/50] incubator-trafficcontrol git commit: fix traffic-ops dockerfile for cpan

Posted by mi...@apache.org.
fix traffic-ops dockerfile for cpan


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/036195d5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/036195d5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/036195d5

Branch: refs/heads/master
Commit: 036195d57b428a8ddc93523e7c196833714bc6dd
Parents: 781362d
Author: Sarp <bu...@turkcell.com.tr>
Authored: Tue Oct 25 15:46:03 2016 +0300
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 infrastructure/docker/traffic_ops/Dockerfile | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/036195d5/infrastructure/docker/traffic_ops/Dockerfile
----------------------------------------------------------------------
diff --git a/infrastructure/docker/traffic_ops/Dockerfile b/infrastructure/docker/traffic_ops/Dockerfile
index d9d4271..a28c7c4 100644
--- a/infrastructure/docker/traffic_ops/Dockerfile
+++ b/infrastructure/docker/traffic_ops/Dockerfile
@@ -5,7 +5,7 @@
 
 # Example Build and Run:
 # docker network create cdnet
-# docker build --rm --tag traffic_ops:1.6.0 --build-arg=RPM=http://traffic-control-cdn.net/downloads/1.6.0/RELEASE-1.6.0/traffic_ops-1.6.0-3503.4899d302.x86_64.rpm traffic_ops
+# docker build --rm --tag traffic_ops:1.7.0 --build-arg=RPM=http://traffic-control-cdn.net/downloads/1.7.0/RELEASE-1.7.0/traffic_ops-1.7.0-3908.5b77f60f.x86_64.rpm traffic_ops
 #
 # docker run --name my-traffic-ops-mysql --hostname my-traffic-ops-mysql --net cdnet --env MYSQL_ROOT_PASSWORD=secretrootpass --detach mysql:5.5
 #
@@ -14,15 +14,16 @@
 FROM centos:6.6
 MAINTAINER Dan Kirkwood
 
-RUN yum install -y tar gcc-c++ perl cpan openssl-devel mysql-devel expect
+RUN yum -y update 
+RUN yum install -y tar gcc-c++ perl perl-core openssl-devel mysql-devel expect curl
+RUN yum clean all
 
-# Configure cpan to follow prereqs
-RUN perl -MCPAN -e 'my $c = "CPAN::HandleConfig"; $c->load(doit => 1, autoconfig => 1); $c->edit(prerequisites_policy => "follow"); $c->edit(build_requires_install_policy => "yes"); $c->commit'
-
-RUN cpan Carton
+RUN curl -L https://raw.githubusercontent.com/miyagawa/cpanminus/master/cpanm | perl - App::cpanminus \
+    && cpanm Carton \
+    && rm -rf /root/.cpanm
 
 # Override RPM arg to use a different one using --build-arg RPM=...  Can be local file or http://...
-ARG RPM=http://traffic-control-cdn.net/downloads/1.6.0/RELEASE-1.6.0/traffic_ops-1.6.0-3503.4899d302.x86_64.rpm
+ARG RPM=http://traffic-control-cdn.net/downloads/1.7.0/RELEASE-1.7.0/traffic_ops-1.7.0-3908.5b77f60f.x86_64.rpm
 ADD $RPM /
 RUN yum install -y /$(basename $RPM)
 


[29/50] incubator-trafficcontrol git commit: Fix TM2 CommonAPIData uses to qualify namespace

Posted by mi...@apache.org.
Fix TM2 CommonAPIData uses to qualify namespace


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/80387aa6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/80387aa6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/80387aa6

Branch: refs/heads/master
Commit: 80387aa60c0518215877bdb6babe08fdb928f1ab
Parents: 9509510
Author: Robert Butts <ro...@gmail.com>
Authored: Thu Oct 20 10:41:55 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 traffic_monitor/experimental/traffic_monitor/cache/cache.go    | 6 +++---
 .../experimental/traffic_monitor/deliveryservice/stat.go       | 4 ++--
 .../experimental/traffic_monitor/manager/datarequest.go        | 6 +++---
 3 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/80387aa6/traffic_monitor/experimental/traffic_monitor/cache/cache.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/cache/cache.go b/traffic_monitor/experimental/traffic_monitor/cache/cache.go
index 8f0b3f9..b6f2f47 100644
--- a/traffic_monitor/experimental/traffic_monitor/cache/cache.go
+++ b/traffic_monitor/experimental/traffic_monitor/cache/cache.go
@@ -73,8 +73,8 @@ type Stat struct {
 }
 
 type Stats struct {
+	http_server.CommonAPIData
 	Caches map[enum.CacheName]map[string][]Stat `json:"caches"`
-	CommonAPIData
 }
 
 type Filter interface {
@@ -86,8 +86,8 @@ type Filter interface {
 // StatsMarshall encodes the stats in JSON, encoding up to historyCount of each stat. If statsToUse is empty, all stats are encoded; otherwise, only the given stats are encoded. If wildcard is true, stats which contain the text in each statsToUse are returned, instead of exact stat names. If cacheType is not CacheTypeInvalid, only stats for the given type are returned. If hosts is not empty, only the given hosts are returned.
 func StatsMarshall(statHistory map[enum.CacheName][]Result, filter Filter, params url.Values) ([]byte, error) {
 	stats := Stats{
-		Caches:        map[enum.CacheName]map[string][]Stat{},
-		CommonAPIData: http_server.GetCommonAPIData(params, time.Now()),
+		http_server.CommonAPIData: http_server.GetCommonAPIData(params, time.Now()),
+		Caches: map[enum.CacheName]map[string][]Stat{},
 	}
 
 	// TODO in 1.0, stats are divided into 'location', 'cache', and 'type'. 'cache' are hidden by default.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/80387aa6/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
index 86178fe..e042fb4 100644
--- a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
+++ b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
@@ -474,8 +474,8 @@ func addCommonData(s *dsdata.StatsOld, c *dsdata.StatCommon, deliveryService enu
 func (dsStats Stats) JSON(filter dsdata.Filter, params url.Values) dsdata.StatsOld {
 	now := time.Now().Unix()
 	jsonObj := &dsdata.StatsOld{
-		DeliveryService: map[enum.DeliveryServiceName]map[dsdata.StatName][]dsdata.StatOld{},
-		CommonAPIData:   http_server.GetCommonAPIData(params, time.Now()),
+		http_server.CommonAPIData: http_server.GetCommonAPIData(params, time.Now()),
+		DeliveryService:           map[enum.DeliveryServiceName]map[dsdata.StatName][]dsdata.StatOld{},
 	}
 
 	for deliveryService, stat := range dsStats.DeliveryService {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/80387aa6/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go b/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
index 7d91e5c..38b4565 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
@@ -31,8 +31,8 @@ type CacheState struct {
 }
 
 type ApiPeerStates struct {
+	http_server.CommonAPIData
 	Peers map[enum.TrafficMonitorName]map[enum.CacheName][]CacheState `json:"peers"`
-	CommonAPIData
 }
 
 // TODO make fields nullable, so error fields can be omitted, letting API callers still get updates for unerrored fields
@@ -673,8 +673,8 @@ func cacheAvailableCount(caches map[enum.CacheName]peer.IsAvailable) int {
 
 func createApiPeerStates(peerStates map[enum.TrafficMonitorName]peer.Crstates, filter *PeerStateFilter, params url.Values) ApiPeerStates {
 	apiPeerStates := ApiPeerStates{
-		Peers:         map[enum.TrafficMonitorName]map[enum.CacheName][]CacheState{},
-		CommonAPIData: http_server.GetCommonAPIData(params, time.Now()),
+		http_server.CommonAPIData: http_server.GetCommonAPIData(params, time.Now()),
+		Peers: map[enum.TrafficMonitorName]map[enum.CacheName][]CacheState{},
 	}
 
 	for peer, state := range peerStates {


[03/50] incubator-trafficcontrol git commit: Fix TM2 DsStats time to ms since epoch

Posted by mi...@apache.org.
Fix TM2 DsStats time to ms since epoch

Fixes Traffic Monitor 2.0 /publish/DsStats endpoint stat times to
be milliseconds since the epoch, matching Traffic Monitor 1.0.


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/ba497730
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/ba497730
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/ba497730

Branch: refs/heads/master
Commit: ba4977304dfc1f0d082bb23dec14e90fe9e32728
Parents: bdf5b59
Author: Robert Butts <ro...@gmail.com>
Authored: Mon Oct 24 16:00:03 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../experimental/traffic_monitor/deliveryservice/stat.go          | 3 ++-
 .../experimental/traffic_monitor/deliveryservicedata/stat.go      | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/ba497730/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
index ff94e42..f2734bb 100644
--- a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
+++ b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
@@ -484,7 +484,8 @@ func addCommonData(s *dsdata.StatsOld, c *dsdata.StatCommon, deliveryService enu
 
 // JSON returns an object formatted as expected to be serialized to JSON and served.
 func (s Stats) JSON(filter dsdata.Filter, params url.Values) dsdata.StatsOld {
-	now := time.Now().Unix()
+	// TODO fix to be the time calculated, not the time requested
+	now := time.Now().UnixNano() / int64(time.Millisecond) // Traffic Monitor 1.0 API is 'ms since the epoch'
 	jsonObj := &dsdata.StatsOld{
 		CommonAPIData:   srvhttp.GetCommonAPIData(params, time.Now()),
 		DeliveryService: map[enum.DeliveryServiceName]map[dsdata.StatName][]dsdata.StatOld{},

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/ba497730/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go b/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
index c9eb77f..ef692c0 100644
--- a/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
+++ b/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
@@ -62,7 +62,7 @@ type StatCommonReadonly interface {
 
 // StatMeta includes metadata about a particular stat.
 type StatMeta struct {
-	Time int `json:"time"`
+	Time int64 `json:"time"`
 }
 
 // StatFloat is a float stat, combined with its metadata


[17/50] incubator-trafficcontrol git commit: udpated to use transparent background logo

Posted by mi...@apache.org.
udpated to use transparent background logo


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/781362db
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/781362db
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/781362db

Branch: refs/heads/master
Commit: 781362dbc2ce0fb435061189a3fcd0a375dff9b6
Parents: 52a0908
Author: Dave Neuman <ne...@apache.org>
Authored: Mon Oct 24 13:28:55 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 traffic_ops/app/public/images/tc_logo.png | Bin 32879 -> 101717 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/781362db/traffic_ops/app/public/images/tc_logo.png
----------------------------------------------------------------------
diff --git a/traffic_ops/app/public/images/tc_logo.png b/traffic_ops/app/public/images/tc_logo.png
index 6abb40d..9ea6966 100644
Binary files a/traffic_ops/app/public/images/tc_logo.png and b/traffic_ops/app/public/images/tc_logo.png differ


[37/50] incubator-trafficcontrol git commit: Fix TM2 member func self var to be idiomatic

Posted by mi...@apache.org.
Fix TM2 member func self var to be idiomatic


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/5d87c73a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/5d87c73a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/5d87c73a

Branch: refs/heads/master
Commit: 5d87c73a77a1452bff893d2371fce1f235fbb4c0
Parents: 44d55b5
Author: Robert Butts <ro...@gmail.com>
Authored: Thu Oct 20 16:23:03 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../traffic_monitor/deliveryservice/stat.go             | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/5d87c73a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
index 16330b6..a7d9312 100644
--- a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
+++ b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
@@ -21,16 +21,16 @@ type Stats struct {
 	DeliveryService map[enum.DeliveryServiceName]dsdata.Stat `json:"deliveryService"`
 }
 
-func (a Stats) Copy() Stats {
+func (s Stats) Copy() Stats {
 	b := NewStats()
-	for k, v := range a.DeliveryService {
+	for k, v := range s.DeliveryService {
 		b.DeliveryService[k] = v.Copy()
 	}
 	return b
 }
 
-func (a Stats) Get(name enum.DeliveryServiceName) (dsdata.StatReadonly, bool) {
-	ds, ok := a.DeliveryService[name]
+func (s Stats) Get(name enum.DeliveryServiceName) (dsdata.StatReadonly, bool) {
+	ds, ok := s.DeliveryService[name]
 	return ds, ok
 }
 
@@ -471,14 +471,14 @@ func addCommonData(s *dsdata.StatsOld, c *dsdata.StatCommon, deliveryService enu
 }
 
 // StatsJSON returns an object formatted as expected to be serialized to JSON and served.
-func (dsStats Stats) JSON(filter dsdata.Filter, params url.Values) dsdata.StatsOld {
+func (s Stats) JSON(filter dsdata.Filter, params url.Values) dsdata.StatsOld {
 	now := time.Now().Unix()
 	jsonObj := &dsdata.StatsOld{
 		CommonAPIData:   srvhttp.GetCommonAPIData(params, time.Now()),
 		DeliveryService: map[enum.DeliveryServiceName]map[dsdata.StatName][]dsdata.StatOld{},
 	}
 
-	for deliveryService, stat := range dsStats.DeliveryService {
+	for deliveryService, stat := range s.DeliveryService {
 		if !filter.UseDeliveryService(deliveryService) {
 			continue
 		}


[22/50] incubator-trafficcontrol git commit: updated server scripted dashboard to add netstat and wrap_count, fixed read/write time to be a derivative

Posted by mi...@apache.org.
updated server scripted dashboard to add netstat and wrap_count, fixed read/write time to be a derivative


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/2b6b198c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/2b6b198c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/2b6b198c

Branch: refs/heads/master
Commit: 2b6b198c9fcbc58a34cb0a548cf0ef2a8c278e7f
Parents: 9ceebd3
Author: Dave Neuman <ne...@apache.org>
Authored: Wed Oct 19 07:25:15 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 traffic_stats/grafana/traffic_ops_server.js | 684 +++++++++++++++++++++--
 1 file changed, 641 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/2b6b198c/traffic_stats/grafana/traffic_ops_server.js
----------------------------------------------------------------------
diff --git a/traffic_stats/grafana/traffic_ops_server.js b/traffic_stats/grafana/traffic_ops_server.js
index 10ef058..2178095 100644
--- a/traffic_stats/grafana/traffic_ops_server.js
+++ b/traffic_stats/grafana/traffic_ops_server.js
@@ -60,8 +60,7 @@ dashboard.refresh = "30s";
 
 
 {
-  dashboard.rows.push(
-    {
+  dashboard.rows.push(    {
       "height": "250px",
       "panels": [
         {
@@ -73,19 +72,7 @@ dashboard.refresh = "30s";
           "id": 1,
           "datasource": "cache_stats",
           "renderer": "flot",
-          "x-axis": true,
-          "y-axis": true,
-          "y_formats": [
-            "bps",
-            "short"
-          ],
           "grid": {
-            "leftLogBase": 1,
-            "leftMax": null,
-            "rightMax": null,
-            "leftMin": null,
-            "rightMin": null,
-            "rightLogBase": 1,
             "threshold1": null,
             "threshold2": null,
             "threshold1Color": "rgba(216, 200, 27, 0.27)",
@@ -112,7 +99,9 @@ dashboard.refresh = "30s";
           "steppedLine": false,
           "tooltip": {
             "value_type": "cumulative",
-            "shared": true
+            "shared": true,
+            "sort": 0,
+            "msResolution": false
           },
           "timeFrom": null,
           "timeShift": null,
@@ -120,13 +109,65 @@ dashboard.refresh = "30s";
             {
               "measurement": "bandwidth.1min",
               "tags": {},
-              "query": "SELECT mean(value)*1000 FROM \"monthly\".\"bandwidth.1min\" WHERE hostname='" + which + "'  and $timeFilter GROUP BY time(60s)",
-              "rawQuery": true
+              "query": "SELECT mean(value) FROM \"monthly\".\"bandwidth.1min\" WHERE hostname= '" + which + "' and $timeFilter GROUP BY time(60s)",
+              "rawQuery": true,
+              "refId": "A",
+              "policy": "default",
+              "dsType": "influxdb",
+              "resultFormat": "time_series",
+              "groupBy": [
+                {
+                  "type": "time",
+                  "params": [
+                    "$interval"
+                  ]
+                },
+                {
+                  "type": "fill",
+                  "params": [
+                    "null"
+                  ]
+                }
+              ],
+              "select": [
+                [
+                  {
+                    "type": "field",
+                    "params": [
+                      "value"
+                    ]
+                  },
+                  {
+                    "type": "mean",
+                    "params": []
+                  }
+                ]
+              ],
+              "alias": "bandwidth"
             }
           ],
           "aliasColors": {},
           "seriesOverrides": [],
-          "links": []
+          "links": [],
+          "yaxes": [
+            {
+              "show": true,
+              "min": null,
+              "max": null,
+              "logBase": 1,
+              "format": "Kbits"
+            },
+            {
+              "show": true,
+              "min": null,
+              "max": null,
+              "logBase": 1,
+              "format": "short"
+            }
+          ],
+          "xaxis": {
+            "show": true
+          }
         }
       ],
       "title": "Row",
@@ -145,18 +186,7 @@ dashboard.refresh = "30s";
           "id": 2,
           "datasource": "cache_stats",
           "renderer": "flot",
-          "x-axis": true,
-          "y-axis": true,
-          "y_formats": [
-            "short"
-          ],
           "grid": {
-            "leftLogBase": 1,
-            "leftMax": null,
-            "rightMax": null,
-            "leftMin": null,
-            "rightMin": null,
-            "rightLogBase": 1,
             "threshold1": null,
             "threshold2": null,
             "threshold1Color": "rgba(216, 200, 27, 0.27)",
@@ -183,7 +213,9 @@ dashboard.refresh = "30s";
           "steppedLine": false,
           "tooltip": {
             "value_type": "cumulative",
-            "shared": true
+            "shared": true,
+            "sort": 0,
+            "msResolution": false
           },
           "timeFrom": null,
           "timeShift": null,
@@ -191,13 +223,64 @@ dashboard.refresh = "30s";
             {
               "measurement": "connections.1min",
               "tags": {},
-              "query": "SELECT mean(value) FROM \"monthly\".\"connections.1min\" WHERE hostname='" + which + "'  and $timeFilter GROUP BY time(60s)",
-              "rawQuery": true
+              "query": "SELECT mean(value) FROM \"monthly\".\"connections.1min\" WHERE hostname= '" + which + "' and $timeFilter GROUP BY time(60s)",
+              "rawQuery": true,
+              "refId": "A",
+              "policy": "default",
+              "dsType": "influxdb",
+              "resultFormat": "time_series",
+              "groupBy": [
+                {
+                  "type": "time",
+                  "params": [
+                    "$interval"
+                  ]
+                },
+                {
+                  "type": "fill",
+                  "params": [
+                    "null"
+                  ]
+                }
+              ],
+              "select": [
+                [
+                  {
+                    "type": "field",
+                    "params": [
+                      "value"
+                    ]
+                  },
+                  {
+                    "type": "mean",
+                    "params": []
+                  }
+                ]
+              ],
+              "alias": "connections"
             }
           ],
           "aliasColors": {},
           "seriesOverrides": [],
-          "links": []
+          "links": [],
+          "yaxes": [
+            {
+              "show": true,
+              "min": null,
+              "max": null,
+              "logBase": 1,
+              "format": "short"
+            },
+            {
+              "show": true,
+              "min": null,
+              "max": null,
+              "logBase": 1
+            }
+          ],
+          "xaxis": {
+            "show": true
+          }
         }
       ],
       "title": "Row",
@@ -299,9 +382,46 @@ dashboard.refresh = "30s";
                       "cpu_user"
                     ]
                   }
+                ],
+                [
+                  {
+                    "type": "field",
+                    "params": [
+                      "usage_guest"
+                    ]
+                  },
+                  {
+                    "type": "mean",
+                    "params": []
+                  },
+                  {
+                    "type": "alias",
+                    "params": [
+                      "cpu_guest"
+                    ]
+                  }
+                ],
+                [
+                  {
+                    "type": "field",
+                    "params": [
+                      "usage_steal"
+                    ]
+                  },
+                  {
+                    "type": "mean",
+                    "params": []
+                  },
+                  {
+                    "type": "alias",
+                    "params": [
+                      "cpu_steal"
+                    ]
+                  }
                 ]
               ],
-              "measurement": "cpu"
+              "measurement": "cpu",
+              "alias": "$col"
             }
           ],
           "datasource": "telegraf",
@@ -355,7 +475,8 @@ dashboard.refresh = "30s";
           "tooltip": {
             "value_type": "individual",
             "shared": true,
-            "msResolution": true
+            "msResolution": true,
+            "sort": 2
           },
           "timeFrom": null,
           "timeShift": null,
@@ -418,7 +539,8 @@ dashboard.refresh = "30s";
                   }
                 ]
               ],
-              "measurement": "mem"
+              "measurement": "mem",
+              "alias": "$col"
             }
           ],
           "datasource": "telegraf",
@@ -472,7 +594,8 @@ dashboard.refresh = "30s";
           "tooltip": {
             "value_type": "individual",
             "shared": true,
-            "msResolution": true
+            "msResolution": true,
+            "sort": 0
           },
           "timeFrom": null,
           "timeShift": null,
@@ -579,7 +702,8 @@ dashboard.refresh = "30s";
                   }
                 ]
               ],
-              "measurement": "system"
+              "measurement": "system",
+              "alias": "$col"
             }
           ],
           "datasource": "telegraf",
@@ -633,7 +757,8 @@ dashboard.refresh = "30s";
           "tooltip": {
             "value_type": "cumulative",
             "shared": true,
-            "msResolution": true
+            "msResolution": true,
+            "sort": 0
           },
           "timeFrom": null,
           "timeShift": null,
@@ -685,16 +810,53 @@ dashboard.refresh = "30s";
                     ]
                   },
                   {
-                    "type": "mean",
+                    "type": "sum",
                     "params": []
                   },
                   {
+                    "type": "non_negative_derivative",
+                    "params": [
+                      "10s"
+                    ]
+                  },
+                  {
                     "type": "alias",
                     "params": [
                       "read_time"
                     ]
                   }
-                ],
+                ]
+              ],
+              "measurement": "diskio",
+              "alias": "$col"
+            },
+            {
+              "refId": "B",
+              "policy": "default",
+              "dsType": "influxdb",
+              "resultFormat": "time_series",
+              "tags": [
+                {
+                  "key": "host",
+                  "operator": "=~",
+                  "value": "/" + which + "/"
+                }
+              ],
+              "groupBy": [
+                {
+                  "type": "time",
+                  "params": [
+                    "$interval"
+                  ]
+                },
+                {
+                  "type": "fill",
+                  "params": [
+                    "null"
+                  ]
+                }
+              ],
+              "select": [
                 [
                   {
                     "type": "field",
@@ -703,10 +865,16 @@ dashboard.refresh = "30s";
                     ]
                   },
                   {
-                    "type": "mean",
+                    "type": "sum",
                     "params": []
                   },
                   {
+                    "type": "non_negative_derivative",
+                    "params": [
+                      "10s"
+                    ]
+                  },
+                  {
                     "type": "alias",
                     "params": [
                       "write_time"
@@ -714,7 +882,8 @@ dashboard.refresh = "30s";
                   }
                 ]
               ],
-              "measurement": "diskio"
+              "measurement": "diskio",
+              "alias": "$col"
             }
           ],
           "datasource": "telegraf",
@@ -768,6 +937,435 @@ dashboard.refresh = "30s";
           "tooltip": {
             "value_type": "cumulative",
             "shared": true,
+            "msResolution": true,
+            "sort": 0
+          },
+          "timeFrom": null,
+          "timeShift": null,
+          "aliasColors": {},
+          "seriesOverrides": [],
+          "links": []
+        }
+      ]
+    },
+    {
+      "title": "Wrap Count and netstat",
+      "height": "250px",
+      "editable": true,
+      "collapse": false,
+      "panels": [
+        {
+          "title": "wrap count",
+          "error": false,
+          "span": 6,
+          "editable": true,
+          "type": "graph",
+          "isNew": true,
+          "id": 7,
+          "targets": [
+            {
+              "refId": "A",
+              "policy": "monthly",
+              "dsType": "influxdb",
+              "resultFormat": "time_series",
+              "tags": [
+              {
+                  "key": "hostname",
+                  "operator": "=~",
+                  "value": "/" + which + "/"
+                }
+              ],
+              "groupBy": [
+                {
+                  "type": "time",
+                  "params": [
+                    "$interval"
+                  ]
+                },
+                {
+                  "type": "fill",
+                  "params": [
+                    "null"
+                  ]
+                }
+              ],
+              "select": [
+                [
+                  {
+                    "type": "field",
+                    "params": [
+                      "vol1_wrap_count"
+                    ]
+                  },
+                  {
+                    "type": "mean",
+                    "params": []
+                  },
+                  {
+                    "type": "alias",
+                    "params": [
+                      "vol1"
+                    ]
+                  }
+                ],
+                [
+                  {
+                    "type": "field",
+                    "params": [
+                      "vol2_wrap_count"
+                    ]
+                  },
+                  {
+                    "type": "mean",
+                    "params": []
+                  },
+                  {
+                    "type": "alias",
+                    "params": [
+                      "vol2"
+                    ]
+                  }
+                ]
+              ],
+              "measurement": "wrap_count.1min",
+              "alias": "$col"
+            }
+          ],
+          "datasource": "cache_stats",
+          "renderer": "flot",
+          "yaxes": [
+            {
+              "label": null,
+              "show": true,
+              "logBase": 1,
+              "min": null,
+              "max": null,
+              "format": "short"
+            },
+            {
+              "label": null,
+              "show": true,
+              "logBase": 1,
+              "min": null,
+              "max": null,
+              "format": "short"
+            }
+          ],
+          "xaxis": {
+            "show": true
+          },
+          "grid": {
+            "threshold1": null,
+            "threshold2": null,
+            "threshold1Color": "rgba(216, 200, 27, 0.27)",
+            "threshold2Color": "rgba(234, 112, 112, 0.22)"
+          },
+          "lines": true,
+          "fill": 1,
+          "linewidth": 2,
+          "points": false,
+          "pointradius": 5,
+          "bars": false,
+          "stack": false,
+          "percentage": false,
+          "legend": {
+            "show": true,
+            "values": false,
+            "min": false,
+            "max": false,
+            "current": false,
+            "total": false,
+            "avg": false
+          },
+          "nullPointMode": "connected",
+          "steppedLine": false,
+          "tooltip": {
+            "value_type": "cumulative",
+            "shared": true,
+            "sort": 0,
+            "msResolution": true
+          },
+          "timeFrom": null,
+          "timeShift": null,
+          "aliasColors": {},
+          "seriesOverrides": [],
+          "links": []
+        },
+        {
+          "title": "netstat",
+          "error": false,
+          "span": 6,
+          "editable": true,
+          "type": "graph",
+          "isNew": true,
+          "id": 8,
+          "targets": [
+            {
+              "refId": "A",
+              "policy": "default",
+              "dsType": "influxdb",
+              "resultFormat": "time_series",
+              "tags": [
+                {
+                  "key": "host",
+                  "operator": "=~",
+                  "value": "/" + which + "/"
+                }
+              ],
+              "groupBy": [
+                {
+                  "type": "time",
+                  "params": [
+                    "$interval"
+                  ]
+                },
+                {
+                  "type": "fill",
+                  "params": [
+                    "null"
+                  ]
+                }
+              ],
+              "select": [
+                [
+                  {
+                    "type": "field",
+                    "params": [
+                      "tcp_close"
+                    ]
+                  },
+                  {
+                    "type": "mean",
+                    "params": []
+                  },
+                  {
+                    "type": "alias",
+                    "params": [
+                      "tcp_close"
+                    ]
+                  }
+                ],
+                [
+                  {
+                    "type": "field",
+                    "params": [
+                      "tcp_close_wait"
+                    ]
+                  },
+                  {
+                    "type": "mean",
+                    "params": []
+                  },
+                  {
+                    "type": "alias",
+                    "params": [
+                      "tcp_close_wait"
+                    ]
+                  }
+                ],
+                [
+                  {
+                    "type": "field",
+                    "params": [
+                      "tcp_established"
+                    ]
+                  },
+                  {
+                    "type": "mean",
+                    "params": []
+                  },
+                  {
+                    "type": "alias",
+                    "params": [
+                      "tcp_established"
+                    ]
+                  }
+                ],
+                [
+                  {
+                    "type": "field",
+                    "params": [
+                      "tcp_time_wait"
+                    ]
+                  },
+                  {
+                    "type": "mean",
+                    "params": []
+                  },
+                  {
+                    "type": "alias",
+                    "params": [
+                      "tcp_time_wait"
+                    ]
+                  }
+                ],
+                [
+                  {
+                    "type": "field",
+                    "params": [
+                      "tcp_closing"
+                    ]
+                  },
+                  {
+                    "type": "mean",
+                    "params": []
+                  },
+                  {
+                    "type": "alias",
+                    "params": [
+                      "tcp_closing"
+                    ]
+                  }
+                ],
+                [
+                  {
+                    "type": "field",
+                    "params": [
+                      "tcp_fin_wait1"
+                    ]
+                  },
+                  {
+                    "type": "mean",
+                    "params": []
+                  },
+                  {
+                    "type": "alias",
+                    "params": [
+                      "tcp_fin_wait1"
+                    ]
+                  }
+                ],
+                [
+                  {
+                    "type": "field",
+                    "params": [
+                      "tcp_fin_wait2"
+                    ]
+                  },
+                  {
+                    "type": "mean",
+                    "params": []
+                  },
+                  {
+                    "type": "alias",
+                    "params": [
+                      "tcp_fin_wait2"
+                    ]
+                  }
+                ],
+                [
+                  {
+                    "type": "field",
+                    "params": [
+                      "tcp_last_ack"
+                    ]
+                  },
+                  {
+                    "type": "mean",
+                    "params": []
+                  },
+                  {
+                    "type": "alias",
+                    "params": [
+                      "tcp_last_ack"
+                    ]
+                  }
+                ],
+                [
+                  {
+                    "type": "field",
+                    "params": [
+                      "tcp_syn_recv"
+                    ]
+                  },
+                  {
+                    "type": "mean",
+                    "params": []
+                  },
+                  {
+                    "type": "alias",
+                    "params": [
+                      "tcp_syn_recv"
+                    ]
+                  }
+                ],
+                [
+                  {
+                    "type": "field",
+                    "params": [
+                      "tcp_syn_sent"
+                    ]
+                  },
+                  {
+                    "type": "mean",
+                    "params": []
+                  },
+                  {
+                    "type": "alias",
+                    "params": [
+                      "tcp_syn_sent"
+                    ]
+                  }
+                ]
+              ],
+              "measurement": "netstat",
+              "alias": "$col"
+            }
+          ],
+          "datasource": "telegraf",
+          "renderer": "flot",
+          "yaxes": [
+            {
+              "label": null,
+              "show": true,
+              "logBase": 1,
+              "min": null,
+              "max": null,
+              "format": "short"
+            },
+            {
+              "label": null,
+              "show": true,
+              "logBase": 1,
+              "min": null,
+              "max": null,
+              "format": "short"
+            }
+          ],
+          "xaxis": {
+            "show": true
+          },
+          "grid": {
+            "threshold1": null,
+            "threshold2": null,
+            "threshold1Color": "rgba(216, 200, 27, 0.27)",
+            "threshold2Color": "rgba(234, 112, 112, 0.22)"
+          },
+          "lines": true,
+          "fill": 1,
+          "linewidth": 2,
+          "points": false,
+          "pointradius": 5,
+          "bars": false,
+          "stack": false,
+          "percentage": false,
+          "legend": {
+            "show": true,
+            "values": false,
+            "min": false,
+            "max": false,
+            "current": false,
+            "total": false,
+            "avg": false,
+            "hideEmpty": true,
+            "hideZero": true
+          },
+          "nullPointMode": "connected",
+          "steppedLine": false,
+          "tooltip": {
+            "value_type": "cumulative",
+            "shared": true,
+            "sort": 2,
             "msResolution": true
           },
           "timeFrom": null,


[50/50] incubator-trafficcontrol git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol

Posted by mi...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/c6de3089
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/c6de3089
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/c6de3089

Branch: refs/heads/master
Commit: c6de3089521fb40bd6c7665c0c5bf5ab91474dde
Parents: fcc3e8c 9c94dde
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Fri Oct 28 15:06:03 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:06:03 2016 -0600

----------------------------------------------------------------------

----------------------------------------------------------------------



[31/50] incubator-trafficcontrol git commit: Remove TM2 unused symbols

Posted by mi...@apache.org.
Remove TM2 unused symbols


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/3cbd6466
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/3cbd6466
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/3cbd6466

Branch: refs/heads/master
Commit: 3cbd64662b8ab4c6f304cd3aba83b672432f5c44
Parents: 56abc4b
Author: Robert Butts <ro...@gmail.com>
Authored: Thu Oct 20 14:33:24 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../traffic_monitor/health/cache_health.go      | 22 --------------------
 .../traffic_monitor/manager/healthresult.go     |  3 ---
 2 files changed, 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/3cbd6466/traffic_monitor/experimental/traffic_monitor/health/cache_health.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/health/cache_health.go b/traffic_monitor/experimental/traffic_monitor/health/cache_health.go
index eba1d30..cf1acff 100644
--- a/traffic_monitor/experimental/traffic_monitor/health/cache_health.go
+++ b/traffic_monitor/experimental/traffic_monitor/health/cache_health.go
@@ -10,28 +10,6 @@ import (
 	"strings"
 )
 
-// Get the String value of one of those pesky map[string]interface{} things that seem so easy
-func getString(key string, intface map[string]interface{}) (string, error) {
-	str, ok := intface[key].(string)
-
-	if ok {
-		return str, nil
-	} else {
-		return "", fmt.Errorf("Error in getString: No string found for key %s", key)
-	}
-}
-
-// Get the float64 value of one of those pesky map[string]interface{} things that seem so easy
-func getNumber(key string, intface map[string]interface{}) (float64, error) {
-	val, ok := intface[key].(float64)
-
-	if ok {
-		return val, nil
-	} else {
-		return -1, fmt.Errorf("Error in getNumber: No number found for %s", key)
-	}
-}
-
 func setError(newResult *cache.Result, err error) {
 	newResult.Error = err
 	newResult.Available = false

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/3cbd6466/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go b/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go
index b4ad2bb..dda4d27 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go
@@ -84,9 +84,6 @@ func StartHealthResultManager(
 	return lastHealthDurations, events, localCacheStatus
 }
 
-// cacheAggregateSeconds is how often to aggregate stats, if the health chan is never empty. (Otherwise, we read from the chan until it's empty, then aggregate, continuously)
-const cacheAggregateSeconds = 1
-
 func healthResultManagerListen(
 	cacheHealthChan <-chan cache.Result,
 	toData todata.TODataThreadsafe,


[46/50] incubator-trafficcontrol git commit: Fix TM2 to poll IPs not Hostnames

Posted by mi...@apache.org.
Fix TM2 to poll IPs not Hostnames


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/9051b518
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/9051b518
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/9051b518

Branch: refs/heads/master
Commit: 9051b5182fb355de1097fc687b7fe3068a77cc3b
Parents: 487823a
Author: Robert Butts <ro...@gmail.com>
Authored: Wed Oct 26 13:46:49 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../experimental/traffic_monitor/manager/monitorconfig.go          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9051b518/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go b/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
index e092cb2..dc8ca41 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
@@ -131,7 +131,7 @@ func monitorConfigListen(
 
 			url := monitorConfig.Profile[srv.Profile].Parameters.HealthPollingURL
 			r := strings.NewReplacer(
-				"${hostname}", srv.FQDN,
+				"${hostname}", srv.IP,
 				"${interface_name}", srv.InterfaceName,
 				"application=system", "application=plugin.remap",
 				"application=", "application=plugin.remap",


[43/50] incubator-trafficcontrol git commit: Fix TM2 HTTP serving to log write errors

Posted by mi...@apache.org.
Fix TM2 HTTP serving to log write errors


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/3c17dab7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/3c17dab7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/3c17dab7

Branch: refs/heads/master
Commit: 3c17dab74725ba7f9aafe8c4124399d8edb1206f
Parents: 044b759
Author: Robert Butts <ro...@gmail.com>
Authored: Fri Oct 21 15:35:51 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../experimental/traffic_monitor/srvhttp/srvhttp.go   | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/3c17dab7/traffic_monitor/experimental/traffic_monitor/srvhttp/srvhttp.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/srvhttp/srvhttp.go b/traffic_monitor/experimental/traffic_monitor/srvhttp/srvhttp.go
index ebbad03..a1ef6af 100644
--- a/traffic_monitor/experimental/traffic_monitor/srvhttp/srvhttp.go
+++ b/traffic_monitor/experimental/traffic_monitor/srvhttp/srvhttp.go
@@ -138,7 +138,10 @@ func (s Server) Run(f GetDataFunc, addr string, readTimeout time.Duration, write
 	s.stoppableListenerWaitGroup.Add(1)
 	go func() {
 		defer s.stoppableListenerWaitGroup.Done()
-		server.Serve(s.stoppableListener)
+		err := server.Serve(s.stoppableListener)
+		if err != nil {
+			log.Warnf("HTTP server stopped with error: %v\n", err)
+		}
 	}()
 
 	log.Infof("Web server listening on %s", addr)
@@ -284,10 +287,15 @@ func (s Server) dataRequest(w http.ResponseWriter, req *http.Request, t Type, f
 	})
 	if len(data) > 0 {
 		w.WriteHeader(responseCode)
-		w.Write(data)
+		if _, err := w.Write(data); err != nil {
+			log.Warnf("received error writing data request %v: %v\n", t, err)
+		}
+
 	} else {
 		w.WriteHeader(http.StatusInternalServerError)
-		w.Write([]byte("Internal Server Error"))
+		if _, err := w.Write([]byte("Internal Server Error")); err != nil {
+			log.Warnf("received error writing data request %v: %v\n", t, err)
+		}
 	}
 }
 


[06/50] incubator-trafficcontrol git commit: refer to new apache product in docker build files

Posted by mi...@apache.org.
refer to new apache product in docker build files


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/136ec75e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/136ec75e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/136ec75e

Branch: refs/heads/master
Commit: 136ec75ee672daf2b9ca2f650fcadd4e805b0ae3
Parents: bacf184
Author: Dan Kirkwood <da...@gmail.com>
Authored: Wed Oct 19 14:58:41 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 infrastructure/docker/build/Dockerfile-traffic_monitor | 2 +-
 infrastructure/docker/build/Dockerfile-traffic_ops     | 2 +-
 infrastructure/docker/build/Dockerfile-traffic_portal  | 2 +-
 infrastructure/docker/build/Dockerfile-traffic_router  | 2 +-
 infrastructure/docker/build/Dockerfile-traffic_stats   | 2 +-
 infrastructure/docker/build/README.md                  | 6 +++---
 infrastructure/docker/build/docker-compose.yml         | 6 +++---
 infrastructure/docker/build/run-build.sh               | 9 +++++----
 8 files changed, 16 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/136ec75e/infrastructure/docker/build/Dockerfile-traffic_monitor
----------------------------------------------------------------------
diff --git a/infrastructure/docker/build/Dockerfile-traffic_monitor b/infrastructure/docker/build/Dockerfile-traffic_monitor
index 1a253b7..ec8aa69 100644
--- a/infrastructure/docker/build/Dockerfile-traffic_monitor
+++ b/infrastructure/docker/build/Dockerfile-traffic_monitor
@@ -8,7 +8,7 @@ RUN	yum -y install \
 		rpm-build && \
 	yum -y clean all
 
-ENV GITREPO=https://github.com/Comcast/traffic_control
+ENV GITREPO=https://github.com/apache/incubator-trafficcontrol
 ENV BRANCH=master
 
 # Above are common for all sub-projects.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/136ec75e/infrastructure/docker/build/Dockerfile-traffic_ops
----------------------------------------------------------------------
diff --git a/infrastructure/docker/build/Dockerfile-traffic_ops b/infrastructure/docker/build/Dockerfile-traffic_ops
index 87c6458..9ab2b0a 100644
--- a/infrastructure/docker/build/Dockerfile-traffic_ops
+++ b/infrastructure/docker/build/Dockerfile-traffic_ops
@@ -26,7 +26,7 @@ RUN yum install -y \
 
 
 # all ENV vars can be controlled by, e.g. `docker run -e BRANCH=1.6.x <image>`
-ENV GITREPO=https://github.com/Comcast/traffic_control
+ENV GITREPO=https://github.com/apache/incubator-trafficcontrol
 ENV BRANCH=master
 
 WORKDIR /repo

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/136ec75e/infrastructure/docker/build/Dockerfile-traffic_portal
----------------------------------------------------------------------
diff --git a/infrastructure/docker/build/Dockerfile-traffic_portal b/infrastructure/docker/build/Dockerfile-traffic_portal
index 5763459..37fa848 100644
--- a/infrastructure/docker/build/Dockerfile-traffic_portal
+++ b/infrastructure/docker/build/Dockerfile-traffic_portal
@@ -8,7 +8,7 @@ RUN	yum -y install \
 		rpm-build && \
 	yum -y clean all
 
-ENV GITREPO https://github.com/Comcast/traffic_control
+ENV GITREPO https://github.com/apache/incubator-trafficcontrol
 ENV BRANCH master
 
 WORKDIR /repo

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/136ec75e/infrastructure/docker/build/Dockerfile-traffic_router
----------------------------------------------------------------------
diff --git a/infrastructure/docker/build/Dockerfile-traffic_router b/infrastructure/docker/build/Dockerfile-traffic_router
index 733c738..8f7c139 100644
--- a/infrastructure/docker/build/Dockerfile-traffic_router
+++ b/infrastructure/docker/build/Dockerfile-traffic_router
@@ -8,7 +8,7 @@ RUN	yum -y install \
 		rpm-build && \
 	yum -y clean all
 
-ENV GITREPO https://github.com/Comcast/traffic_control
+ENV GITREPO https://github.com/apache/incubator-trafficcontrol
 ENV BRANCH master
 
 WORKDIR /repo

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/136ec75e/infrastructure/docker/build/Dockerfile-traffic_stats
----------------------------------------------------------------------
diff --git a/infrastructure/docker/build/Dockerfile-traffic_stats b/infrastructure/docker/build/Dockerfile-traffic_stats
index dbf66c8..d81914f 100644
--- a/infrastructure/docker/build/Dockerfile-traffic_stats
+++ b/infrastructure/docker/build/Dockerfile-traffic_stats
@@ -8,7 +8,7 @@ RUN	yum -y install \
 		rpm-build && \
 	yum -y clean all
 
-ENV GITREPO https://github.com/Comcast/traffic_control
+ENV GITREPO https://github.com/apache/incubator-trafficcontrol
 ENV BRANCH master
 
 WORKDIR /repo

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/136ec75e/infrastructure/docker/build/README.md
----------------------------------------------------------------------
diff --git a/infrastructure/docker/build/README.md b/infrastructure/docker/build/README.md
index 6e7a7bd..a600340 100644
--- a/infrastructure/docker/build/README.md
+++ b/infrastructure/docker/build/README.md
@@ -1,9 +1,9 @@
 
-# Building *traffic_control* using *docker-compose*
+# Building *trafficcontrol* using *docker-compose*
 
 - install `docker-engine` and `docker-compose`
-- `cd traffic_control/infrastructure/docker/build`
-- `export GITREPO=https://github.com/<username>/traffic_control`
+- `cd incubator-trafficcontrol/infrastructure/docker/build`
+- `export GITREPO=https://github.com/<username>/incubator-trafficcontrol`
 - `export BRANCH=mynewbranch`
 - `docker-compose up traffic_monitor_build traffic_ops_build ...`
 - new rpm files will be in `./artifacts`

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/136ec75e/infrastructure/docker/build/docker-compose.yml
----------------------------------------------------------------------
diff --git a/infrastructure/docker/build/docker-compose.yml b/infrastructure/docker/build/docker-compose.yml
index b219c5f..861a3f3 100644
--- a/infrastructure/docker/build/docker-compose.yml
+++ b/infrastructure/docker/build/docker-compose.yml
@@ -1,11 +1,11 @@
 ---
 
-# Build configuration for traffic_control
+# Build configuration for trafficcontrol
 # Usage:
 #    GITREPO=...  BRANCH=...  docker-compose up [<service>...]
 #
-# where GITREPO is https path to traffic_control clone
-#   (default: https://github.com/Comcast/traffic_control)
+# where GITREPO is https path to trafficcontrol clone
+#   (default: https://github.com/apache/incubator-trafficcontrol)
 # and <branch> is name of branch to test
 #   (default: master).
 #

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/136ec75e/infrastructure/docker/build/run-build.sh
----------------------------------------------------------------------
diff --git a/infrastructure/docker/build/run-build.sh b/infrastructure/docker/build/run-build.sh
index cbe00a9..fd6b784 100755
--- a/infrastructure/docker/build/run-build.sh
+++ b/infrastructure/docker/build/run-build.sh
@@ -4,17 +4,18 @@ target=$1
 [[ -z $target ]] && echo "No target specified"
 echo "Building $target"
 
-echo "GITREPO=${GITREPO:=https://github.com/Comcast/traffic_control}"
+echo "GITREPO=${GITREPO:=https://github.com/apache/incubator-trafficcontrol}"
 echo "BRANCH=${BRANCH:=master}"
 
+dir=$(basename $GITREPO)
 set -x
-git clone $GITREPO -b $BRANCH traffic_control
+git clone "$GITREPO" -b "$BRANCH" $dir || echo "Clone failed: $!"
 
-cd traffic_control/$target
+cd $dir/$target
 ./build/build_rpm.sh
 mkdir -p /artifacts
 cp ../dist/* /artifacts/.
 
 # Clean up for next build
 cd -
-rm -r traffic_control
+rm -r $dir


[11/50] incubator-trafficcontrol git commit: changes to handle ints (postgres) instead of strings

Posted by mi...@apache.org.
changes to handle ints (postgres) instead of 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/ada70b4c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/ada70b4c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/ada70b4c

Branch: refs/heads/master
Commit: ada70b4c9efa39c7e9e58ad7a3be61deff9c2da2
Parents: 6e8a618
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Thu Oct 20 13:40:27 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../FormDeliveryServiceController.js            | 102 +++++++++----------
 1 file changed, 51 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/ada70b4c/traffic_ops/experimental/ui/app/src/common/modules/form/deliveryService/FormDeliveryServiceController.js
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/form/deliveryService/FormDeliveryServiceController.js b/traffic_ops/experimental/ui/app/src/common/modules/form/deliveryService/FormDeliveryServiceController.js
index 51619ad..6c76d67 100644
--- a/traffic_ops/experimental/ui/app/src/common/modules/form/deliveryService/FormDeliveryServiceController.js
+++ b/traffic_ops/experimental/ui/app/src/common/modules/form/deliveryService/FormDeliveryServiceController.js
@@ -29,78 +29,78 @@ var FormDeliveryServiceController = function(deliveryService, $scope, formUtils,
     ];
 
     $scope.protocols = [
-        { value: "0", label: '0 - HTTP' },
-        { value: "1", label: '1 - HTTPS' },
-        { value: "2", label: '2 - HTTP AND HTTPS' },
-        { value: "3", label: '3 - HTTP TO HTTPS' }
+        { value: 0, label: '0 - HTTP' },
+        { value: 1, label: '1 - HTTPS' },
+        { value: 2, label: '2 - HTTP AND HTTPS' },
+        { value: 3, label: '3 - HTTP TO HTTPS' }
     ];
 
     $scope.qStrings = [
-        { value: "0", label: '0 - use qstring in cache key, and pass up' },
-        { value: "1", label: '1 - ignore in cache key, and pass up' },
-        { value: "2", label: '2 - drop at edge' }
+        { value: 0, label: '0 - use qstring in cache key, and pass up' },
+        { value: 1, label: '1 - ignore in cache key, and pass up' },
+        { value: 2, label: '2 - drop at edge' }
     ];
 
     $scope.geoLimits = [
-        { value: "0", label: '0 - None' },
-        { value: "1", label: '1 - CZF only' },
-        { value: "2", label: '2 - CZF + Country Code(s)' }
+        { value: 0, label: '0 - None' },
+        { value: 1, label: '1 - CZF only' },
+        { value: 2, label: '2 - CZF + Country Code(s)' }
     ];
 
     $scope.geoProviders = [
-        { value: "0", label: '0 - Maxmind (Default)' },
-        { value: "1", label: '1 - Neustar' }
+        { value: 0, label: '0 - Maxmind (Default)' },
+        { value: 1, label: '1 - Neustar' }
     ];
 
     $scope.dscps = [
-        { value: "0", label: '0  - Best Effort' },
-        { value: "10", label: '10 - AF11' },
-        { value: "12", label: '12 - AF12' },
-        { value: "14", label: '14 - AF13' },
-        { value: "18", label: '18  - AF21' },
-        { value: "20", label: '20  - AF22' },
-        { value: "22", label: '22  - AF23' },
-        { value: "26", label: '26  - AF31' },
-        { value: "28", label: '28  - AF32' },
-        { value: "30", label: '30  - AF33' },
-        { value: "34", label: '34  - AF41' },
-        { value: "36", label: '36  - AF42' },
-        { value: "37", label: '37  - ' },
-        { value: "38", label: '38  - AF43' },
-        { value: "8", label: '8  - CS1' },
-        { value: "16", label: '16  - CS2' },
-        { value: "24", label: '24  - CS3' },
-        { value: "32", label: '32  - CS4' },
-        { value: "40", label: '40  - CS5' },
-        { value: "48", label: '48  - CS6' },
-        { value: "56", label: '56  - CS7' }
+        { value: 0, label: '0  - Best Effort' },
+        { value: 10, label: '10 - AF11' },
+        { value: 12, label: '12 - AF12' },
+        { value: 14, label: '14 - AF13' },
+        { value: 18, label: '18  - AF21' },
+        { value: 20, label: '20  - AF22' },
+        { value: 22, label: '22  - AF23' },
+        { value: 26, label: '26  - AF31' },
+        { value: 28, label: '28  - AF32' },
+        { value: 30, label: '30  - AF33' },
+        { value: 34, label: '34  - AF41' },
+        { value: 36, label: '36  - AF42' },
+        { value: 37, label: '37  - ' },
+        { value: 38, label: '38  - AF43' },
+        { value: 8, label: '8  - CS1' },
+        { value: 16, label: '16  - CS2' },
+        { value: 24, label: '24  - CS3' },
+        { value: 32, label: '32  - CS4' },
+        { value: 40, label: '40  - CS5' },
+        { value: 48, label: '48  - CS6' },
+        { value: 56, label: '56  - CS7' }
     ];
 
     $scope.dispersions = [
-        { value: "1", label: '1 - OFF' },
-        { value: "2", label: '2' },
-        { value: "3", label: '3' },
-        { value: "4", label: '4' },
-        { value: "5", label: '5' },
-        { value: "6", label: '6' },
-        { value: "7", label: '7' },
-        { value: "8", label: '8' },
-        { value: "9", label: '9' },
-        { value: "10", label: '10' }
+        { value: 1, label: '1 - OFF' },
+        { value: 2, label: '2' },
+        { value: 3, label: '3' },
+        { value: 4, label: '4' },
+        { value: 5, label: '5' },
+        { value: 6, label: '6' },
+        { value: 7, label: '7' },
+        { value: 8, label: '8' },
+        { value: 9, label: '9' },
+        { value: 10, label: '10' }
     ];
 
     $scope.rrhs = [
-        { value: "0", label: "0 - Don't cache" },
-        { value: "1", label: "1 - Use background_fetch plugin" },
-        { value: "2", label: "2 - Use cache_range_requests plugin" }
+        { value: 0, label: "0 - Don't cache" },
+        { value: 1, label: "1 - Use background_fetch plugin" },
+        { value: 2, label: "2 - Use cache_range_requests plugin" }
     ];
 
     $scope.msoAlgos = [
-        { value: "0", label: "0 - Consistent Hash" },
-        { value: "1", label: "1 - Primary/Backup" },
-        { value: "2", label: "2 - Strict Round Robin" },
-        { value: "3", label: "3 - IP-based Round Robin" },
-        { value: "4", label: "4 - Latch on Failover" }
+        { value: 0, label: "0 - Consistent Hash" },
+        { value: 1, label: "1 - Primary/Backup" },
+        { value: 2, label: "2 - Strict Round Robin" },
+        { value: 3, label: "3 - IP-based Round Robin" },
+        { value: 4, label: "4 - Latch on Failover" }
     ];
 
     $scope.navigateToPath = locationUtils.navigateToPath;


[14/50] incubator-trafficcontrol git commit: test push 3

Posted by mi...@apache.org.
test push 3


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/3493a0ac
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/3493a0ac
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/3493a0ac

Branch: refs/heads/master
Commit: 3493a0ac6a1fbe84a667c3adaa430743dd091108
Parents: 2ea04e7
Author: Mark Torluemke <mt...@apache.org>
Authored: Sat Oct 22 22:18:22 2016 +0000
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 traffic_ops/experimental/ui/build/README.md | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/3493a0ac/traffic_ops/experimental/ui/build/README.md
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/build/README.md b/traffic_ops/experimental/ui/build/README.md
index 5cdc42e..7492cd4 100644
--- a/traffic_ops/experimental/ui/build/README.md
+++ b/traffic_ops/experimental/ui/build/README.md
@@ -11,9 +11,9 @@
 * Build the RPM
 
     ```
-    $ cd traffic_ops/experimental/ui/build
-    $ docker build -t tov2-image .
-    $ docker run -v $(pwd)/artifacts:/artifacts -e GITREPO=https://github.com/apache/incubator-trafficcontrol.git -e BRANCH=master tov2-image
+    $ cd incubator-trafficcontrol/traffic_ops/experimental/ui/build
+    $ sudo docker build -t tov2-image .
+    $ sudo docker run -v $(pwd)/artifacts:/artifacts -e GITREPO=https://github.com/apache/incubator-trafficcontrol.git -e BRANCH=master tov2-image
     ```
 
     The rpm will be created the `artifacts` directory.
@@ -54,7 +54,7 @@
 * Navigate to Traffic Ops v2
 
     ```
-    $ http://localhost:8080
+    $ http://localhost[:port]
     ```
 
 #### Notes


[48/50] incubator-trafficcontrol git commit: Fix TM2 endpoints to exclude offline caches

Posted by mi...@apache.org.
Fix TM2 endpoints to exclude offline caches


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/bdf5b59a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/bdf5b59a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/bdf5b59a

Branch: refs/heads/master
Commit: bdf5b59abff7cec0e1d9ad112125a3c505fa3646
Parents: 286ed23
Author: Robert Butts <ro...@gmail.com>
Authored: Mon Oct 24 10:59:23 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../experimental/traffic_monitor/manager/monitorconfig.go           | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/bdf5b59a/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go b/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
index ec82f2f..e092cb2 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
@@ -122,7 +122,6 @@ func monitorConfigListen(
 				continue
 			}
 			if srv.Status == "OFFLINE" {
-				localStates.SetCache(cacheName, peer.IsAvailable{IsAvailable: false})
 				continue
 			}
 			// seed states with available = false until our polling cycle picks up a result


[21/50] incubator-trafficcontrol git commit: update `traffic_ops/client/tests` import paths

Posted by mi...@apache.org.
update `traffic_ops/client/tests` import paths

This updates the import paths to reference the new
`apache/incubator-trafficcontrol` over the old `Comcast/traffic_control`
in `traffic_ops/client/tests`


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/9ceebd39
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/9ceebd39
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/9ceebd39

Branch: refs/heads/master
Commit: 9ceebd39ede78df984d0a03fbd6d216ade5461c1
Parents: 31defa0
Author: Mike Ball <mi...@gmail.com>
Authored: Thu Oct 27 21:16:44 2016 -0400
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 traffic_ops/client/tests/cachegroup_test.go             | 4 ++--
 traffic_ops/client/tests/cdn_test.go                    | 4 ++--
 traffic_ops/client/tests/delivery_service_test.go       | 4 ++--
 traffic_ops/client/tests/hardware_test.go               | 4 ++--
 traffic_ops/client/tests/parameter_test.go              | 4 ++--
 traffic_ops/client/tests/profile_test.go                | 4 ++--
 traffic_ops/client/tests/server_test.go                 | 4 ++--
 traffic_ops/client/tests/stats_summary_test.go          | 4 ++--
 traffic_ops/client/tests/traffic_monitor_config_test.go | 4 ++--
 traffic_ops/client/tests/traffic_ops_test.go            | 2 +-
 traffic_ops/client/tests/traffic_router_config_test.go  | 4 ++--
 traffic_ops/client/tests/type_test.go                   | 4 ++--
 traffic_ops/client/tests/user_test.go                   | 4 ++--
 13 files changed, 25 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9ceebd39/traffic_ops/client/tests/cachegroup_test.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/tests/cachegroup_test.go b/traffic_ops/client/tests/cachegroup_test.go
index 10cac61..2911258 100644
--- a/traffic_ops/client/tests/cachegroup_test.go
+++ b/traffic_ops/client/tests/cachegroup_test.go
@@ -20,8 +20,8 @@ import (
 	"net/http"
 	"testing"
 
-	"github.com/Comcast/traffic_control/traffic_ops/client"
-	"github.com/Comcast/traffic_control/traffic_ops/client/fixtures"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client/fixtures"
 	"github.com/jheitz200/test_helper"
 )
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9ceebd39/traffic_ops/client/tests/cdn_test.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/tests/cdn_test.go b/traffic_ops/client/tests/cdn_test.go
index 977fbbc..c508641 100644
--- a/traffic_ops/client/tests/cdn_test.go
+++ b/traffic_ops/client/tests/cdn_test.go
@@ -20,8 +20,8 @@ import (
 	"net/http"
 	"testing"
 
-	"github.com/Comcast/traffic_control/traffic_ops/client"
-	"github.com/Comcast/traffic_control/traffic_ops/client/fixtures"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client/fixtures"
 	"github.com/jheitz200/test_helper"
 )
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9ceebd39/traffic_ops/client/tests/delivery_service_test.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/tests/delivery_service_test.go b/traffic_ops/client/tests/delivery_service_test.go
index 595639d..ade38f9 100644
--- a/traffic_ops/client/tests/delivery_service_test.go
+++ b/traffic_ops/client/tests/delivery_service_test.go
@@ -20,8 +20,8 @@ import (
 	"net/http"
 	"testing"
 
-	"github.com/Comcast/traffic_control/traffic_ops/client"
-	"github.com/Comcast/traffic_control/traffic_ops/client/fixtures"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client/fixtures"
 	"github.com/jheitz200/test_helper"
 )
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9ceebd39/traffic_ops/client/tests/hardware_test.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/tests/hardware_test.go b/traffic_ops/client/tests/hardware_test.go
index 3b85ff6..e62488d 100644
--- a/traffic_ops/client/tests/hardware_test.go
+++ b/traffic_ops/client/tests/hardware_test.go
@@ -20,8 +20,8 @@ import (
 	"net/http"
 	"testing"
 
-	"github.com/Comcast/traffic_control/traffic_ops/client"
-	"github.com/Comcast/traffic_control/traffic_ops/client/fixtures"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client/fixtures"
 	"github.com/jheitz200/test_helper"
 )
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9ceebd39/traffic_ops/client/tests/parameter_test.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/tests/parameter_test.go b/traffic_ops/client/tests/parameter_test.go
index 78de24e..763d333 100644
--- a/traffic_ops/client/tests/parameter_test.go
+++ b/traffic_ops/client/tests/parameter_test.go
@@ -20,8 +20,8 @@ import (
 	"net/http"
 	"testing"
 
-	"github.com/Comcast/traffic_control/traffic_ops/client"
-	"github.com/Comcast/traffic_control/traffic_ops/client/fixtures"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client/fixtures"
 	"github.com/jheitz200/test_helper"
 )
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9ceebd39/traffic_ops/client/tests/profile_test.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/tests/profile_test.go b/traffic_ops/client/tests/profile_test.go
index 600f97e..9fc4802 100644
--- a/traffic_ops/client/tests/profile_test.go
+++ b/traffic_ops/client/tests/profile_test.go
@@ -20,8 +20,8 @@ import (
 	"net/http"
 	"testing"
 
-	"github.com/Comcast/traffic_control/traffic_ops/client"
-	"github.com/Comcast/traffic_control/traffic_ops/client/fixtures"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client/fixtures"
 	"github.com/jheitz200/test_helper"
 )
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9ceebd39/traffic_ops/client/tests/server_test.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/tests/server_test.go b/traffic_ops/client/tests/server_test.go
index 76e355c..fdada86 100644
--- a/traffic_ops/client/tests/server_test.go
+++ b/traffic_ops/client/tests/server_test.go
@@ -21,8 +21,8 @@ import (
 	"net/url"
 	"testing"
 
-	"github.com/Comcast/traffic_control/traffic_ops/client"
-	"github.com/Comcast/traffic_control/traffic_ops/client/fixtures"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client/fixtures"
 	"github.com/jheitz200/test_helper"
 )
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9ceebd39/traffic_ops/client/tests/stats_summary_test.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/tests/stats_summary_test.go b/traffic_ops/client/tests/stats_summary_test.go
index 35d5ff6..6f5a806 100644
--- a/traffic_ops/client/tests/stats_summary_test.go
+++ b/traffic_ops/client/tests/stats_summary_test.go
@@ -20,8 +20,8 @@ import (
 	"net/http"
 	"testing"
 
-	"github.com/Comcast/traffic_control/traffic_ops/client"
-	"github.com/Comcast/traffic_control/traffic_ops/client/fixtures"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client/fixtures"
 	"github.com/jheitz200/test_helper"
 )
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9ceebd39/traffic_ops/client/tests/traffic_monitor_config_test.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/tests/traffic_monitor_config_test.go b/traffic_ops/client/tests/traffic_monitor_config_test.go
index c6d2b99..a38ccdc 100644
--- a/traffic_ops/client/tests/traffic_monitor_config_test.go
+++ b/traffic_ops/client/tests/traffic_monitor_config_test.go
@@ -20,8 +20,8 @@ import (
 	"net/http"
 	"testing"
 
-	"github.com/Comcast/traffic_control/traffic_ops/client"
-	"github.com/Comcast/traffic_control/traffic_ops/client/fixtures"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client/fixtures"
 	"github.com/jheitz200/test_helper"
 )
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9ceebd39/traffic_ops/client/tests/traffic_ops_test.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/tests/traffic_ops_test.go b/traffic_ops/client/tests/traffic_ops_test.go
index 92ff73e..f7f4fb3 100644
--- a/traffic_ops/client/tests/traffic_ops_test.go
+++ b/traffic_ops/client/tests/traffic_ops_test.go
@@ -20,7 +20,7 @@ import (
 	"net/http"
 	"testing"
 
-	"github.com/Comcast/traffic_control/traffic_ops/client"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client"
 	"github.com/jheitz200/test_helper"
 )
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9ceebd39/traffic_ops/client/tests/traffic_router_config_test.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/tests/traffic_router_config_test.go b/traffic_ops/client/tests/traffic_router_config_test.go
index 8784836..259eeb5 100644
--- a/traffic_ops/client/tests/traffic_router_config_test.go
+++ b/traffic_ops/client/tests/traffic_router_config_test.go
@@ -20,8 +20,8 @@ import (
 	"net/http"
 	"testing"
 
-	"github.com/Comcast/traffic_control/traffic_ops/client"
-	"github.com/Comcast/traffic_control/traffic_ops/client/fixtures"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client/fixtures"
 	"github.com/jheitz200/test_helper"
 )
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9ceebd39/traffic_ops/client/tests/type_test.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/tests/type_test.go b/traffic_ops/client/tests/type_test.go
index 13b0f8c..48f0091 100644
--- a/traffic_ops/client/tests/type_test.go
+++ b/traffic_ops/client/tests/type_test.go
@@ -20,8 +20,8 @@ import (
 	"net/http"
 	"testing"
 
-	"github.com/Comcast/traffic_control/traffic_ops/client"
-	"github.com/Comcast/traffic_control/traffic_ops/client/fixtures"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client/fixtures"
 	"github.com/jheitz200/test_helper"
 )
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9ceebd39/traffic_ops/client/tests/user_test.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/tests/user_test.go b/traffic_ops/client/tests/user_test.go
index c9c92d6..bd49c34 100644
--- a/traffic_ops/client/tests/user_test.go
+++ b/traffic_ops/client/tests/user_test.go
@@ -20,8 +20,8 @@ import (
 	"net/http"
 	"testing"
 
-	"github.com/Comcast/traffic_control/traffic_ops/client"
-	"github.com/Comcast/traffic_control/traffic_ops/client/fixtures"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client"
+	"github.com/apache/incubator-trafficcontrol/traffic_ops/client/fixtures"
 	"github.com/jheitz200/test_helper"
 )
 


[04/50] incubator-trafficcontrol git commit: Add TM2 godoc comments

Posted by mi...@apache.org.
Add TM2 godoc comments


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/b182dd83
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/b182dd83
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/b182dd83

Branch: refs/heads/master
Commit: b182dd836f9bdba5d971b7c3d9339381b256c697
Parents: 4fd8fbe
Author: Robert Butts <ro...@gmail.com>
Authored: Fri Oct 21 14:57:03 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../traffic_monitor/cache/astats.go             | 21 ++--------
 .../experimental/traffic_monitor/cache/cache.go | 13 +++++-
 .../traffic_monitor/config/config.go            | 15 +++++--
 .../traffic_monitor/deliveryservice/stat.go     |  9 +++++
 .../traffic_monitor/deliveryservicedata/stat.go | 42 ++++++++++++++++++++
 .../experimental/traffic_monitor/enum/enum.go   | 23 +++++++++--
 .../manager/cacheavailablestatus.go             |  7 ++++
 .../traffic_monitor/manager/datarequest.go      | 13 ++++++
 .../traffic_monitor/manager/dsstats.go          |  5 +++
 .../traffic_monitor/manager/events.go           |  4 ++
 .../traffic_monitor/manager/healthresult.go     |  5 +++
 .../traffic_monitor/manager/lastkbpsstats.go    |  3 ++
 .../traffic_monitor/manager/manager.go          |  1 +
 .../traffic_monitor/manager/monitorconfig.go    |  4 ++
 .../traffic_monitor/manager/opsconfig.go        |  3 ++
 .../traffic_monitor/manager/peer.go             |  1 +
 .../traffic_monitor/manager/stathistory.go      |  4 ++
 .../traffic_monitor/manager/uintman.go          |  4 ++
 .../traffic_monitor/peer/crstates.go            | 24 ++++++++++-
 .../experimental/traffic_monitor/peer/peer.go   |  4 ++
 .../traffic_monitor/srvhttp/srvhttp.go          | 29 +++++++++++++-
 .../traffic_monitor/traffic_monitor.go          |  3 ++
 .../trafficopsdata/trafficopsdata.go            |  4 ++
 .../trafficopswrapper/trafficopswrapper.go      |  6 +++
 .../experimental/traffic_monitor/version.go     |  1 +
 25 files changed, 219 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/cache/astats.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/cache/astats.go b/traffic_monitor/experimental/traffic_monitor/cache/astats.go
index ad658f8..55bbd6f 100644
--- a/traffic_monitor/experimental/traffic_monitor/cache/astats.go
+++ b/traffic_monitor/experimental/traffic_monitor/cache/astats.go
@@ -2,14 +2,15 @@ package cache
 
 import (
 	"encoding/json"
-	"io"
 )
 
+// Astats contains ATS data returned from the Astats ATS plugin. This includes generic stats, as well as fixed system stats.
 type Astats struct {
 	Ats    map[string]interface{} `json:"ats"`
 	System AstatsSystem           `json:"system"`
 }
 
+// AstatsSystem represents fixed system stats returne from ATS by the Astats plugin.
 type AstatsSystem struct {
 	InfName           string `json:"inf.name"`
 	InfSpeed          int    `json:"inf.speed"`
@@ -22,25 +23,9 @@ type AstatsSystem struct {
 	AstatsLoad        int    `json:"astatsLoad"`
 }
 
-type AstatsAdapter struct{}
-
+// Unmarshal unmarshalls the given bytes, which must be JSON Astats data, into an Astats object.
 func Unmarshal(body []byte) (Astats, error) {
 	var aStats Astats
 	err := json.Unmarshal(body, &aStats)
 	return aStats, err
 }
-
-func (AstatsAdapter) Transform(r io.Reader) ([]Astats, error) {
-	dec := json.NewDecoder(r)
-	var as []Astats
-
-	for {
-		var a Astats
-		if err := dec.Decode(&a); err == io.EOF {
-			return as, nil
-		} else if err != nil {
-			return as, err
-		}
-		as = append(as, a)
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/cache/cache.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/cache/cache.go b/traffic_monitor/experimental/traffic_monitor/cache/cache.go
index f679cf5..0d5a95c 100644
--- a/traffic_monitor/experimental/traffic_monitor/cache/cache.go
+++ b/traffic_monitor/experimental/traffic_monitor/cache/cache.go
@@ -17,6 +17,7 @@ import (
 	"time"
 )
 
+// Handler is a cache handler, which fulfills the common/handler `Handler` interface.
 type Handler struct {
 	ResultChannel      chan Result
 	Notify             int
@@ -25,20 +26,22 @@ type Handler struct {
 	MultipleSpaceRegex *regexp.Regexp
 }
 
-// NewHandler does NOT precomputes stat data before calling ResultChannel, and Result.Precomputed will be nil
+// NewHandler returns a new cache handler. Note this handler does NOT precomputes stat data before calling ResultChannel, and Result.Precomputed will be nil
 func NewHandler() Handler {
 	return Handler{ResultChannel: make(chan Result), MultipleSpaceRegex: regexp.MustCompile(" +")}
 }
 
-// NewPrecomputeHandler precomputes stat data and populates result.Precomputed before passing to ResultChannel.
+// NewPrecomputeHandler constructs a new cache Handler, which precomputes stat data and populates result.Precomputed before passing to ResultChannel.
 func NewPrecomputeHandler(toData todata.TODataThreadsafe, peerStates peer.CRStatesPeersThreadsafe) Handler {
 	return Handler{ResultChannel: make(chan Result), MultipleSpaceRegex: regexp.MustCompile(" +"), ToData: &toData, PeerStates: &peerStates}
 }
 
+// Precompute returns whether this handler precomputes data before passing the result to the ResultChannel
 func (handler Handler) Precompute() bool {
 	return handler.ToData != nil && handler.PeerStates != nil
 }
 
+// PrecomputedData represents data parsed and pre-computed from the Result.
 type PrecomputedData struct {
 	DeliveryServiceStats map[enum.DeliveryServiceName]dsdata.Stat
 	OutBytes             int64
@@ -47,6 +50,7 @@ type PrecomputedData struct {
 	Reporting            bool
 }
 
+// Result is the data result returned by a cache.
 type Result struct {
 	ID        enum.CacheName
 	Available bool
@@ -59,6 +63,7 @@ type Result struct {
 	PollFinished chan<- uint64
 }
 
+// Vitals is the vitals data returned from a cache.
 type Vitals struct {
 	LoadAvg    float64
 	BytesOut   int64
@@ -67,16 +72,19 @@ type Vitals struct {
 	MaxKbpsOut int64
 }
 
+// Stat is a generic stat, including the untyped value and the time the stat was taken.
 type Stat struct {
 	Time  int64       `json:"time"`
 	Value interface{} `json:"value"`
 }
 
+// Stats is designed for returning via the API. It contains result history for each cache, as well as common API data.
 type Stats struct {
 	srvhttp.CommonAPIData
 	Caches map[enum.CacheName]map[string][]Stat `json:"caches"`
 }
 
+// Filter filters whether stats and caches should be returned from a data set.
 type Filter interface {
 	UseStat(name string) bool
 	UseCache(name enum.CacheName) bool
@@ -126,6 +134,7 @@ func StatsMarshall(statHistory map[enum.CacheName][]Result, filter Filter, param
 	return json.Marshal(stats)
 }
 
+// Handle handles results fetched from a cache, parsing the raw Reader data and passing it along to a chan for further processing.
 func (handler Handler) Handle(id string, r io.Reader, err error, pollID uint64, pollFinished chan<- uint64) {
 	log.Debugf("poll %v %v handle start\n", pollID, time.Now())
 	result := Result{

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/config/config.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/config/config.go b/traffic_monitor/experimental/traffic_monitor/config/config.go
index f8bbe30..9e56f51 100644
--- a/traffic_monitor/experimental/traffic_monitor/config/config.go
+++ b/traffic_monitor/experimental/traffic_monitor/config/config.go
@@ -6,12 +6,19 @@ import (
 	"time"
 )
 
+// LogLocation is a location to log to. This may be stdout, stderr, null (/dev/null), or a valid file path.
 type LogLocation string
 
-const LogLocationStdout = "stdout"
-const LogLocationStderr = "stderr"
-const LogLocationNull = "null"
+const (
+	// LogLocationStdout indicates the stdout IO stream
+	LogLocationStdout = "stdout"
+	// LogLocationStderr indicates the stderr IO stream
+	LogLocationStderr = "stderr"
+	// LogLocationNull indicates the null IO stream (/dev/null)
+	LogLocationNull = "null"
+)
 
+// Config is the configuration for the application. It includes myriad data, such as polling intervals and log locations.
 type Config struct {
 	CacheHealthPollingInterval   time.Duration `json:"-"`
 	CacheStatPollingInterval     time.Duration `json:"-"`
@@ -31,6 +38,7 @@ type Config struct {
 	ServeWriteTimeout            time.Duration `json:"-"`
 }
 
+// DefaultConfig is the default configuration for the application, if no configuration file is given, or if a given config setting doesn't exist in the config file.
 var DefaultConfig = Config{
 	CacheHealthPollingInterval:   6 * time.Second,
 	CacheStatPollingInterval:     6 * time.Second,
@@ -76,6 +84,7 @@ func (c *Config) MarshalJSON() ([]byte, error) {
 	})
 }
 
+// UnmarshalJSON populates this config object from given JSON bytes.
 func (c *Config) UnmarshalJSON(data []byte) error {
 	type Alias Config
 	aux := &struct {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
index 2fe8586..d8dd30c 100644
--- a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
+++ b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
@@ -22,6 +22,7 @@ type Stats struct {
 	DeliveryService map[enum.DeliveryServiceName]dsdata.Stat `json:"deliveryService"`
 }
 
+// Copy performs a deep copy of this Stats object.
 func (s Stats) Copy() Stats {
 	b := NewStats()
 	for k, v := range s.DeliveryService {
@@ -30,6 +31,7 @@ func (s Stats) Copy() Stats {
 	return b
 }
 
+// Get returns the stats for the given delivery service, and whether it exists.
 func (s Stats) Get(name enum.DeliveryServiceName) (dsdata.StatReadonly, bool) {
 	ds, ok := s.DeliveryService[name]
 	return ds, ok
@@ -120,10 +122,12 @@ type LastStats struct {
 	Caches           map[enum.CacheName]LastStatsData
 }
 
+// NewLastStats returns a new LastStats object, initializing internal pointer values.
 func NewLastStats() LastStats {
 	return LastStats{DeliveryServices: map[enum.DeliveryServiceName]LastDSStat{}, Caches: map[enum.CacheName]LastStatsData{}}
 }
 
+// Copy performs a deep copy of this LastStats object.
 func (a LastStats) Copy() LastStats {
 	b := NewLastStats()
 	for k, v := range a.DeliveryServices {
@@ -144,6 +148,7 @@ type LastDSStat struct {
 	Total       LastStatsData
 }
 
+// Copy performs a deep copy of this LastDSStat object.
 func (a LastDSStat) Copy() LastDSStat {
 	b := LastDSStat{
 		CacheGroups: map[enum.CacheGroupName]LastStatsData{},
@@ -171,6 +176,7 @@ func newLastDSStat() LastDSStat {
 	}
 }
 
+// LastStatsData contains the last stats and per-second calculations for bytes and status codes received from a cache.
 type LastStatsData struct {
 	Bytes     LastStatData
 	Status2xx LastStatData
@@ -190,6 +196,7 @@ func (a LastStatsData) Sum(b LastStatsData) LastStatsData {
 	}
 }
 
+// LastStatData contains the value, time it was received, and per-second calculation since the previous stat, for a stat from a cache.
 type LastStatData struct {
 	PerSec float64
 	Stat   int64
@@ -204,6 +211,7 @@ func (a LastStatData) Sum(b LastStatData) LastStatData {
 	}
 }
 
+// BytesPerKilobit is the number of bytes in a kilobit.
 const BytesPerKilobit = 125
 
 func addLastStat(lastData LastStatData, newStat int64, newStatTime time.Time) (LastStatData, error) {
@@ -374,6 +382,7 @@ func addPerSecStats(statHistory map[enum.CacheName][]cache.Result, dsStats Stats
 	return dsStats, lastStats
 }
 
+// CreateStats aggregates and creates statistics from given stat history. It returns the created stats, information about these stats necessary for the next calculation, and any error.
 func CreateStats(statHistory map[enum.CacheName][]cache.Result, toData todata.TOData, crStates peer.Crstates, lastStats LastStats, now time.Time) (Stats, LastStats, error) {
 	start := time.Now()
 	dsStats := NewStats()

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go b/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
index a05b391..c9eb77f 100644
--- a/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
+++ b/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
@@ -16,7 +16,10 @@ type Filter interface {
 	WithinStatHistoryMax(int) bool
 }
 
+// StatName is the name of a stat.
 type StatName string
+
+// StatOld is the old JSON representation of a stat, from Traffic Monitor 1.0.
 type StatOld struct {
 	Time  int64  `json:"time"`
 	Value string `json:"value"`
@@ -24,16 +27,19 @@ type StatOld struct {
 	Index int    `json:"index,omitempty"` // TODO set? remove?
 }
 
+// StatsOld is the old JSON representation of stats, from Traffic Monitor 1.0. It is designed to be serialized and returns from an API, and includes stat history for each delivery service, as well as data common to most endpoints.
 type StatsOld struct {
 	DeliveryService map[enum.DeliveryServiceName]map[StatName][]StatOld `json:"deliveryService"`
 	srvhttp.CommonAPIData
 }
 
+// StatsReadonly is a read-only interface for delivery service Stats, designed to be passed to multiple goroutine readers.
 type StatsReadonly interface {
 	Get(enum.DeliveryServiceName) (StatReadonly, bool)
 	JSON(Filter, url.Values) StatsOld
 }
 
+// StatReadonly is a read-only interface for a delivery service Stat, designed to be passed to multiple goroutine readers.
 type StatReadonly interface {
 	Copy() Stat
 	Common() StatCommonReadonly
@@ -42,6 +48,7 @@ type StatReadonly interface {
 	Total() StatCacheStats
 }
 
+// StatCommonReadonly is a read-only interface for a delivery service's common Stat data, designed to be passed to multiple goroutine readers.
 type StatCommonReadonly interface {
 	Copy() StatCommon
 	CachesConfigured() StatInt
@@ -53,26 +60,36 @@ type StatCommonReadonly interface {
 	CachesAvailable() StatInt
 }
 
+// StatMeta includes metadata about a particular stat.
 type StatMeta struct {
 	Time int `json:"time"`
 }
+
+// StatFloat is a float stat, combined with its metadata
 type StatFloat struct {
 	StatMeta
 	Value float64 `json:"value"`
 }
+
+// StatBool is a boolean stat, combined with its metadata
 type StatBool struct {
 	StatMeta
 	Value bool `json:"value"`
 }
+
+// StatInt is an integer stat, combined with its metadata
 type StatInt struct {
 	StatMeta
 	Value int64 `json:"value"`
 }
+
+// StatString is a string stat, combined with its metadata
 type StatString struct {
 	StatMeta
 	Value string `json:"value"`
 }
 
+// StatCommon contains stat data common to most delivery service stats.
 type StatCommon struct {
 	CachesConfiguredNum StatInt                 `json:"caches_configured"`
 	CachesReporting     map[enum.CacheName]bool `json:"caches_reporting"`
@@ -83,6 +100,7 @@ type StatCommon struct {
 	CachesAvailableNum  StatInt                 `json:"caches_available"`
 }
 
+// Copy returns a deep copy of this StatCommon object.
 func (a StatCommon) Copy() StatCommon {
 	b := a
 	for k, v := range a.CachesReporting {
@@ -91,13 +109,18 @@ func (a StatCommon) Copy() StatCommon {
 	return b
 }
 
+// CachesConfigured returns the number of caches configured for this delivery service stat. It is part of the StatCommonReadonly interface.
 func (a StatCommon) CachesConfigured() StatInt {
 	return a.CachesConfiguredNum
 }
+
+// CacheReporting returns the number of caches reporting for this delivery service stat. It is part of the StatCommonReadonly interface.
 func (a StatCommon) CacheReporting(name enum.CacheName) (bool, bool) {
 	c, ok := a.CachesReporting[name]
 	return c, ok
 }
+
+// CachesReportingNames returns the list of caches reporting for this delivery service stat. It is part of the StatCommonReadonly interface.
 func (a StatCommon) CachesReportingNames() []enum.CacheName {
 	names := make([]enum.CacheName, 0, len(a.CachesReporting))
 	for name := range a.CachesReporting {
@@ -105,18 +128,28 @@ func (a StatCommon) CachesReportingNames() []enum.CacheName {
 	}
 	return names
 }
+
+// Error returns the error string of this delivery service stat. It is part of the StatCommonReadonly interface.
 func (a StatCommon) Error() StatString {
 	return a.ErrorStr
 }
+
+// Status returns the status string of this delivery service stat. It is part of the StatCommonReadonly interface.
 func (a StatCommon) Status() StatString {
 	return a.StatusStr
 }
+
+// Healthy returns whether this delivery service is considered healthy by this stat. It is part of the StatCommonReadonly interface.
 func (a StatCommon) Healthy() StatBool {
 	return a.IsHealthy
 }
+
+// Available returns whether this delivery service is considered available by this stat. It is part of the StatCommonReadonly interface.
 func (a StatCommon) Available() StatBool {
 	return a.IsAvailable
 }
+
+// CachesAvailable returns the number of caches available to the delivery service in this stat. It is part of the StatCommonReadonly interface.
 func (a StatCommon) CachesAvailable() StatInt {
 	return a.CachesAvailableNum
 }
@@ -141,6 +174,7 @@ type StatCacheStats struct {
 	TpsTotal    StatInt    `json:"tps_total"`
 }
 
+// Sum adds the given cache stats to this cache stats. Numeric values are summed; strings are appended.
 func (a StatCacheStats) Sum(b StatCacheStats) StatCacheStats {
 	return StatCacheStats{
 		OutBytes:    StatInt{Value: a.OutBytes.Value + b.OutBytes.Value},
@@ -160,6 +194,7 @@ func (a StatCacheStats) Sum(b StatCacheStats) StatCacheStats {
 	}
 }
 
+// Stat represents a complete delivery service stat, for a given poll, or at the time requested.
 type Stat struct {
 	CommonStats        StatCommon
 	CacheGroups        map[enum.CacheGroupName]StatCacheStats
@@ -169,8 +204,10 @@ type Stat struct {
 	TotalStats         StatCacheStats
 }
 
+// ErrNotProcessedStat indicates a stat received is not used by Traffic Monitor, nor returned by any API endpoint. Receiving this error indicates the stat has been discarded.
 var ErrNotProcessedStat = errors.New("This stat is not used.")
 
+// NewStat returns a new delivery service Stat, initializing pointer members.
 func NewStat() *Stat {
 	return &Stat{
 		CacheGroups:        map[enum.CacheGroupName]StatCacheStats{},
@@ -181,6 +218,7 @@ func NewStat() *Stat {
 	}
 }
 
+// Copy performs a deep copy of this Stat. It does not modify, and is thus safe for multiple goroutines.
 func (a Stat) Copy() Stat {
 	b := Stat{
 		CommonStats:        a.CommonStats.Copy(),
@@ -205,20 +243,24 @@ func (a Stat) Copy() Stat {
 	return b
 }
 
+// Common returns the common stat data for this stat. It is part of the StatCommonReadonly interface.
 func (a Stat) Common() StatCommonReadonly {
 	return a.CommonStats
 }
 
+// CacheGroup returns the data for the given cachegroup in this stat. It is part of the StatCommonReadonly interface.
 func (a Stat) CacheGroup(name enum.CacheGroupName) (StatCacheStats, bool) {
 	c, ok := a.CacheGroups[name]
 	return c, ok
 }
 
+// Type returns the aggregated data for the given cache type in this stat. It is part of the StatCommonReadonly interface.
 func (a Stat) Type(name enum.CacheType) (StatCacheStats, bool) {
 	t, ok := a.Types[name]
 	return t, ok
 }
 
+// Total returns the aggregated total data in this stat. It is part of the StatCommonReadonly interface.
 func (a Stat) Total() StatCacheStats {
 	return a.TotalStats
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/enum/enum.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/enum/enum.go b/traffic_monitor/experimental/traffic_monitor/enum/enum.go
index b0547da..e028a74 100644
--- a/traffic_monitor/experimental/traffic_monitor/enum/enum.go
+++ b/traffic_monitor/experimental/traffic_monitor/enum/enum.go
@@ -6,22 +6,31 @@ import (
 	"strings"
 )
 
+// TrafficMonitorName is the hostname of a Traffic Monitor peer.
 type TrafficMonitorName string
 
+// CacheName is the hostname of a CDN cache.
 type CacheName string
 
+// CacheGroupName is the name of a CDN cachegroup.
 type CacheGroupName string
 
+// DeliveryServiceName is the name of a CDN delivery service.
 type DeliveryServiceName string
 
+// CacheType is the type (or tier) of a CDN cache.
 type CacheType string
 
 const (
-	CacheTypeEdge    = CacheType("EDGE")
-	CacheTypeMid     = CacheType("MID")
+	// CacheTypeEdge represents an edge cache.
+	CacheTypeEdge = CacheType("EDGE")
+	// CacheTypeMid represents a mid cache.
+	CacheTypeMid = CacheType("MID")
+	// CacheTypeInvalid represents an cache type enumeration. Note this is the default construction for a CacheType.
 	CacheTypeInvalid = CacheType("")
 )
 
+// String returns a string representation of this cache type.
 func (t CacheType) String() string {
 	switch t {
 	case CacheTypeEdge:
@@ -33,6 +42,7 @@ func (t CacheType) String() string {
 	}
 }
 
+// CacheTypeFromString returns a cache type object from its string representation, or CacheTypeInvalid if the string is not a valid type.
 func CacheTypeFromString(s string) CacheType {
 	s = strings.ToLower(s)
 	switch s {
@@ -49,11 +59,15 @@ func CacheTypeFromString(s string) CacheType {
 type DSType string
 
 const (
-	DSTypeHTTP    = DSType("http")
-	DSTypeDNS     = DSType("dns")
+	// DSTypeHTTP represents an HTTP delivery service
+	DSTypeHTTP = DSType("http")
+	// DSTypeDNS represents a DNS delivery service
+	DSTypeDNS = DSType("dns")
+	// DSTypeInvalid represents an invalid delivery service type enumeration. Note this is the default construction for a DSType.
 	DSTypeInvalid = DSType("")
 )
 
+// String returns a string representation of this delivery service type.
 func (t DSType) String() string {
 	switch t {
 	case DSTypeHTTP:
@@ -65,6 +79,7 @@ func (t DSType) String() string {
 	}
 }
 
+// DSTypeFromString returns a delivery service type object from its string representation, or DSTypeInvalid if the string is not a valid type.
 func DSTypeFromString(s string) DSType {
 	s = strings.ToLower(s)
 	switch s {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/manager/cacheavailablestatus.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/cacheavailablestatus.go b/traffic_monitor/experimental/traffic_monitor/manager/cacheavailablestatus.go
index ab05e1a..c81232d 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/cacheavailablestatus.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/cacheavailablestatus.go
@@ -9,18 +9,22 @@ import (
 // TODO put somewhere more generic
 const CacheAvailableStatusReported = "REPORTED"
 
+// CacheAvailableStatus is the available status of the given cache. It includes a boolean available/unavailable flag, and a descriptive string.
 type CacheAvailableStatus struct {
 	Available bool
 	Status    string
 }
 
+// CacheAvailableStatuses is the available status of each cache.
 type CacheAvailableStatuses map[enum.CacheName]CacheAvailableStatus
 
+// CacheAvailableStatusThreadsafe wraps a map of cache available statuses to be safe for multiple reader goroutines and one writer.
 type CacheAvailableStatusThreadsafe struct {
 	caches *CacheAvailableStatuses
 	m      *sync.RWMutex
 }
 
+// Copy copies this CacheAvailableStatuses. It does not modify, and thus is safe for multiple reader goroutines.
 func (a CacheAvailableStatuses) Copy() CacheAvailableStatuses {
 	b := CacheAvailableStatuses(map[enum.CacheName]CacheAvailableStatus{})
 	for k, v := range a {
@@ -29,17 +33,20 @@ func (a CacheAvailableStatuses) Copy() CacheAvailableStatuses {
 	return b
 }
 
+// NewCacheAvailableStatusThreadsafe creates and returns a new CacheAvailableStatusThreadsafe, initializing internal pointer values.
 func NewCacheAvailableStatusThreadsafe() CacheAvailableStatusThreadsafe {
 	c := CacheAvailableStatuses(map[enum.CacheName]CacheAvailableStatus{})
 	return CacheAvailableStatusThreadsafe{m: &sync.RWMutex{}, caches: &c}
 }
 
+// Get returns the internal map of cache statuses. The returned map MUST NOT be modified. If modification is necessary, copy.
 func (o *CacheAvailableStatusThreadsafe) Get() CacheAvailableStatuses {
 	o.m.RLock()
 	defer o.m.RUnlock()
 	return *o.caches
 }
 
+// Set sets the internal map of cache availability. This MUST NOT be called by multiple goroutines.
 func (o *CacheAvailableStatusThreadsafe) Set(v CacheAvailableStatuses) {
 	o.m.Lock()
 	*o.caches = v

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go b/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
index 860d877..e6da58a 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
@@ -22,14 +22,17 @@ import (
 	towrap "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopswrapper"
 )
 
+// JSONEvents represents the structure we wish to serialize to JSON, for Events.
 type JSONEvents struct {
 	Events []Event `json:"events"`
 }
 
+// CacheState represents the available state of a cache.
 type CacheState struct {
 	Value bool `json:"value"`
 }
 
+// APIPeerStates contains the data to be returned for an API call to get the peer states of a Traffic Monitor. This contains common API data returned by most endpoints, and a map of peers, to caches' states.
 type APIPeerStates struct {
 	srvhttp.CommonAPIData
 	Peers map[enum.TrafficMonitorName]map[enum.CacheName][]CacheState `json:"peers"`
@@ -56,6 +59,7 @@ type CacheStatFilter struct {
 	cacheTypes   map[enum.CacheName]enum.CacheType
 }
 
+// UseCache returns whether the given cache is in the filter.
 func (f *CacheStatFilter) UseCache(name enum.CacheName) bool {
 	if _, inHosts := f.hosts[name]; len(f.hosts) != 0 && !inHosts {
 		return false
@@ -66,6 +70,7 @@ func (f *CacheStatFilter) UseCache(name enum.CacheName) bool {
 	return true
 }
 
+// UseStat returns whether the given stat is in the filter.
 func (f *CacheStatFilter) UseStat(statName string) bool {
 	if len(f.statsToUse) == 0 {
 		return true
@@ -82,6 +87,7 @@ func (f *CacheStatFilter) UseStat(statName string) bool {
 	return false
 }
 
+// WithinStatHistoryMax returns whether the given history index is less than the max history of this filter.
 func (f *CacheStatFilter) WithinStatHistoryMax(n int) bool {
 	if f.historyCount == 0 {
 		return true
@@ -172,6 +178,7 @@ type DSStatFilter struct {
 	dsTypes          map[enum.DeliveryServiceName]enum.DSType
 }
 
+// UseDeliveryService returns whether the given delivery service is in this filter.
 func (f *DSStatFilter) UseDeliveryService(name enum.DeliveryServiceName) bool {
 	if _, inDSes := f.deliveryServices[name]; len(f.deliveryServices) != 0 && !inDSes {
 		return false
@@ -182,6 +189,7 @@ func (f *DSStatFilter) UseDeliveryService(name enum.DeliveryServiceName) bool {
 	return true
 }
 
+// UseStat returns whether the given stat is in this filter.
 func (f *DSStatFilter) UseStat(statName string) bool {
 	if len(f.statsToUse) == 0 {
 		return true
@@ -198,6 +206,7 @@ func (f *DSStatFilter) UseStat(statName string) bool {
 	return false
 }
 
+// WithinStatHistoryMax returns whether the given history index is less than the max history of this filter.
 func (f *DSStatFilter) WithinStatHistoryMax(n int) bool {
 	if f.historyCount == 0 {
 		return true
@@ -289,6 +298,7 @@ type PeerStateFilter struct {
 	cacheTypes   map[enum.CacheName]enum.CacheType
 }
 
+// UsePeer returns whether the given Traffic Monitor peer is in this filter.
 func (f *PeerStateFilter) UsePeer(name enum.TrafficMonitorName) bool {
 	if _, inPeers := f.peersToUse[name]; len(f.peersToUse) != 0 && !inPeers {
 		return false
@@ -296,6 +306,7 @@ func (f *PeerStateFilter) UsePeer(name enum.TrafficMonitorName) bool {
 	return true
 }
 
+// UseCache returns whether the given cache is in this filter.
 func (f *PeerStateFilter) UseCache(name enum.CacheName) bool {
 	if f.cacheType != enum.CacheTypeInvalid && f.cacheTypes[name] != f.cacheType {
 		return false
@@ -317,6 +328,7 @@ func (f *PeerStateFilter) UseCache(name enum.CacheName) bool {
 	return false
 }
 
+// WithinStatHistoryMax returns whether the given history index is less than the max history of this filter.
 func (f *PeerStateFilter) WithinStatHistoryMax(n int) bool {
 	if f.historyCount == 0 {
 		return true
@@ -697,6 +709,7 @@ func createAPIPeerStates(peerStates map[enum.TrafficMonitorName]peer.Crstates, f
 	return apiPeerStates
 }
 
+// Stats contains statistics data about this running app. Designed to be returned via an API endpoint.
 type Stats struct {
 	MaxMemoryMB         uint64 `json:"Max Memory (MB)"`
 	GitRevision         string `json:"git-revision"`

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/manager/dsstats.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/dsstats.go b/traffic_monitor/experimental/traffic_monitor/manager/dsstats.go
index 6ca7b8b..1745c5e 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/dsstats.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/dsstats.go
@@ -6,26 +6,31 @@ import (
 	"sync"
 )
 
+// DSStatsThreadsafe wraps a deliveryservice.Stats object to be safe for multiple reader goroutines and a single writer.
 type DSStatsThreadsafe struct {
 	dsStats *ds.Stats
 	m       *sync.RWMutex
 }
 
+// DSStatsReader permits reading of a dsdata.Stats object, but not writing. This is designed so a Stats object can safely be passed to multiple goroutines, without worry one may unsafely write.
 type DSStatsReader interface {
 	Get() dsdata.StatsReadonly
 }
 
+// NewDSStatsThreadsafe returns a deliveryservice.Stats object wrapped to be safe for multiple readers and a single writer.
 func NewDSStatsThreadsafe() DSStatsThreadsafe {
 	s := ds.NewStats()
 	return DSStatsThreadsafe{m: &sync.RWMutex{}, dsStats: &s}
 }
 
+// Get returns a Stats object safe for reading by multiple goroutines
 func (o *DSStatsThreadsafe) Get() dsdata.StatsReadonly {
 	o.m.RLock()
 	defer o.m.RUnlock()
 	return *o.dsStats
 }
 
+// Set sets the internal Stats object. This MUST NOT be called by multiple goroutines.
 func (o *DSStatsThreadsafe) Set(newDsStats ds.Stats) {
 	o.m.Lock()
 	*o.dsStats = newDsStats

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/manager/events.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/events.go b/traffic_monitor/experimental/traffic_monitor/manager/events.go
index 3d6c139..674186b 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/events.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/events.go
@@ -6,6 +6,7 @@ import (
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/enum"
 )
 
+// Event represents an event change in aggregated data. For example, a cache being marked as unavailable.
 type Event struct {
 	Index       uint64         `json:"index"`
 	Time        int64          `json:"time"`
@@ -16,6 +17,7 @@ type Event struct {
 	Available   bool           `json:"isAvailable"`
 }
 
+// EventsThreadsafe provides safe access for multiple goroutines readers and a single writer to a stored Events slice.
 type EventsThreadsafe struct {
 	events    *[]Event
 	m         *sync.RWMutex
@@ -29,11 +31,13 @@ func copyEvents(a []Event) []Event {
 	return b
 }
 
+// NewEventsThreadsafe creates a new single-writer-multiple-reader Threadsafe object
 func NewEventsThreadsafe(maxEvents uint64) EventsThreadsafe {
 	i := uint64(0)
 	return EventsThreadsafe{m: &sync.RWMutex{}, events: &[]Event{}, nextIndex: &i, max: maxEvents}
 }
 
+// Get returns the internal slice of Events for reading. This MUST NOT be modified. If modification is necessary, copy the slice.
 func (o *EventsThreadsafe) Get() []Event {
 	o.m.RLock()
 	defer o.m.RUnlock()

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go b/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go
index 5074f26..5cefd06 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go
@@ -13,13 +13,16 @@ import (
 	todata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
 )
 
+// DurationMap represents a map of cache names to durations
 type DurationMap map[enum.CacheName]time.Duration
 
+// DurationMapThreadsafe wraps a DurationMap in an object safe for a single writer and multiple readers
 type DurationMapThreadsafe struct {
 	durationMap *DurationMap
 	m           *sync.RWMutex
 }
 
+// Copy copies this duration map.
 func (a DurationMap) Copy() DurationMap {
 	b := DurationMap{}
 	for k, v := range a {
@@ -28,6 +31,7 @@ func (a DurationMap) Copy() DurationMap {
 	return b
 }
 
+// NewDurationMapThreadsafe returns a new DurationMapThreadsafe safe for multiple readers and a single writer goroutine.
 func NewDurationMapThreadsafe() DurationMapThreadsafe {
 	m := DurationMap{}
 	return DurationMapThreadsafe{m: &sync.RWMutex{}, durationMap: &m}
@@ -40,6 +44,7 @@ func (o *DurationMapThreadsafe) Get() DurationMap {
 	return *o.durationMap
 }
 
+// Set sets the internal duration map. This MUST NOT be called by multiple goroutines.
 func (o *DurationMapThreadsafe) Set(d DurationMap) {
 	o.m.Lock()
 	*o.durationMap = d

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/manager/lastkbpsstats.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/lastkbpsstats.go b/traffic_monitor/experimental/traffic_monitor/manager/lastkbpsstats.go
index 89ffa6b..3751cec 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/lastkbpsstats.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/lastkbpsstats.go
@@ -5,11 +5,13 @@ import (
 	"sync"
 )
 
+// LastStatsThreadsafe wraps a deliveryservice.LastStats object to be safe for multiple readers and one writer.
 type LastStatsThreadsafe struct {
 	stats *ds.LastStats
 	m     *sync.RWMutex
 }
 
+// NewLastStatsThreadsafe returns a wrapped a deliveryservice.LastStats object safe for multiple readers and one writer.
 func NewLastStatsThreadsafe() LastStatsThreadsafe {
 	s := ds.NewLastStats()
 	return LastStatsThreadsafe{m: &sync.RWMutex{}, stats: &s}
@@ -22,6 +24,7 @@ func (o *LastStatsThreadsafe) Get() ds.LastStats {
 	return *o.stats
 }
 
+// Set sets the internal LastStats object. This MUST NOT be called by multiple goroutines.
 func (o *LastStatsThreadsafe) Set(s ds.LastStats) {
 	o.m.Lock()
 	*o.stats = s

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/manager/manager.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/manager.go b/traffic_monitor/experimental/traffic_monitor/manager/manager.go
index 8d479b5..c362b33 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/manager.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/manager.go
@@ -17,6 +17,7 @@ import (
 	"github.com/davecheney/gmx"
 )
 
+// StaticAppData encapsulates data about the app available at startup
 type StaticAppData struct {
 	StartTime      time.Time
 	GitRevision    string

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go b/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
index 2016116..ec82f2f 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
@@ -12,6 +12,7 @@ import (
 	"sync"
 )
 
+// CopyTrafficMonitorConfigMap returns a deep copy of the given TrafficMonitorConfigMap
 func CopyTrafficMonitorConfigMap(a *to.TrafficMonitorConfigMap) to.TrafficMonitorConfigMap {
 	b := to.TrafficMonitorConfigMap{}
 	b.TrafficServer = map[string]to.TrafficServer{}
@@ -41,11 +42,13 @@ func CopyTrafficMonitorConfigMap(a *to.TrafficMonitorConfigMap) to.TrafficMonito
 	return b
 }
 
+// TrafficMonitorConfigMapThreadsafe encapsulates a TrafficMonitorConfigMap safe for multiple readers and a single writer.
 type TrafficMonitorConfigMapThreadsafe struct {
 	monitorConfig *to.TrafficMonitorConfigMap
 	m             *sync.RWMutex
 }
 
+// NewTrafficMonitorConfigMapThreadsafe returns an encapsulated TrafficMonitorConfigMap safe for multiple readers and a single writer.
 func NewTrafficMonitorConfigMapThreadsafe() TrafficMonitorConfigMapThreadsafe {
 	return TrafficMonitorConfigMapThreadsafe{monitorConfig: &to.TrafficMonitorConfigMap{}, m: &sync.RWMutex{}}
 }
@@ -64,6 +67,7 @@ func (t *TrafficMonitorConfigMapThreadsafe) Set(c to.TrafficMonitorConfigMap) {
 	t.m.Unlock()
 }
 
+// StartMonitorConfigManager runs the monitor config manager goroutine, and returns the threadsafe data which it sets.
 func StartMonitorConfigManager(
 	monitorConfigPollChan <-chan to.TrafficMonitorConfigMap,
 	localStates peer.CRStatesThreadsafe,

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go b/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
index b2ba283..03448dc 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
@@ -23,16 +23,19 @@ type OpsConfigThreadsafe struct {
 	m         *sync.RWMutex
 }
 
+// NewOpsConfigThreadsafe returns a new single-writer-multiple-reader OpsConfig
 func NewOpsConfigThreadsafe() OpsConfigThreadsafe {
 	return OpsConfigThreadsafe{m: &sync.RWMutex{}, opsConfig: &handler.OpsConfig{}}
 }
 
+// Get gets the internal OpsConfig object. This MUST NOT be modified. If modification is necessary, copy the object.
 func (o *OpsConfigThreadsafe) Get() handler.OpsConfig {
 	o.m.RLock()
 	defer o.m.RUnlock()
 	return *o.opsConfig
 }
 
+// Set sets the internal OpsConfig object. This MUST NOT be called from multiple goroutines.
 func (o *OpsConfigThreadsafe) Set(newOpsConfig handler.OpsConfig) {
 	o.m.Lock()
 	*o.opsConfig = newOpsConfig

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/manager/peer.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/peer.go b/traffic_monitor/experimental/traffic_monitor/manager/peer.go
index 2bca917..7050940 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/peer.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/peer.go
@@ -76,6 +76,7 @@ func combineCrStates(peerStates map[enum.TrafficMonitorName]peer.Crstates, local
 	return combinedStates
 }
 
+// CacheNameSlice is a slice of cache names, which fulfills the `sort.Interface` interface.
 type CacheNameSlice []enum.CacheName
 
 func (p CacheNameSlice) Len() int           { return len(p) }

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go b/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
index 8dda3e2..24edcf7 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
@@ -13,6 +13,7 @@ import (
 	todata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
 )
 
+// StatHistory is a map of cache names, to an array of result history from each cache.
 type StatHistory map[enum.CacheName][]cache.Result
 
 func copyStat(a []cache.Result) []cache.Result {
@@ -21,6 +22,7 @@ func copyStat(a []cache.Result) []cache.Result {
 	return b
 }
 
+// Copy copies returns a deep copy of this StatHistory
 func (a StatHistory) Copy() StatHistory {
 	b := StatHistory{}
 	for k, v := range a {
@@ -38,10 +40,12 @@ type StatHistoryThreadsafe struct {
 	max         uint64
 }
 
+// Max returns the max history to be stored for any cache
 func (h StatHistoryThreadsafe) Max() uint64 {
 	return h.max
 }
 
+// NewStatHistoryThreadsafe returns a new StatHistory safe for multiple readers and a single writer.
 func NewStatHistoryThreadsafe(maxHistory uint64) StatHistoryThreadsafe {
 	h := StatHistory{}
 	return StatHistoryThreadsafe{m: &sync.RWMutex{}, statHistory: &h, max: maxHistory}

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/manager/uintman.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/uintman.go b/traffic_monitor/experimental/traffic_monitor/manager/uintman.go
index d85e4a7..953308f 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/uintman.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/uintman.go
@@ -4,19 +4,23 @@ import (
 	"sync/atomic"
 )
 
+// UintThreadsafe provides safe access for multiple goroutines readers and a single writer to a stored uint.
 type UintThreadsafe struct {
 	val *uint64
 }
 
+// NewUintThreadsafe returns a new single-writer-multiple-reader threadsafe uint
 func NewUintThreadsafe() UintThreadsafe {
 	v := uint64(0)
 	return UintThreadsafe{val: &v}
 }
 
+// Get gets the internal uint. This is safe for multiple readers
 func (u *UintThreadsafe) Get() uint64 {
 	return atomic.LoadUint64(u.val)
 }
 
+// Set sets the internal uint. This MUST NOT be called by multiple goroutines.
 func (u *UintThreadsafe) Set(v uint64) {
 	atomic.StoreUint64(u.val, v)
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/peer/crstates.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/peer/crstates.go b/traffic_monitor/experimental/traffic_monitor/peer/crstates.go
index 83f7073..6458a9b 100644
--- a/traffic_monitor/experimental/traffic_monitor/peer/crstates.go
+++ b/traffic_monitor/experimental/traffic_monitor/peer/crstates.go
@@ -7,11 +7,14 @@ import (
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/enum"
 )
 
+// Crstates includes availability data for caches and delivery services, as gathered and aggregated by this Traffic Monitor. It is designed to be served at an API endpoint primarily for Traffic Routers (Content Router) to consume.
+// TODO rename to `CRStates`
 type Crstates struct {
 	Caches          map[enum.CacheName]IsAvailable               `json:"caches"`
 	Deliveryservice map[enum.DeliveryServiceName]Deliveryservice `json:"deliveryServices"`
 }
 
+// NewCrstates creates a new CR states object, initializing pointer members.
 func NewCrstates() Crstates {
 	return Crstates{
 		Caches:          map[enum.CacheName]IsAvailable{},
@@ -19,6 +22,7 @@ func NewCrstates() Crstates {
 	}
 }
 
+// Copy creates a deep copy of this object. It does not mutate, and is thus safe for multiple goroutines.
 func (a Crstates) Copy() Crstates {
 	b := NewCrstates()
 	for k, v := range a.Caches {
@@ -30,6 +34,7 @@ func (a Crstates) Copy() Crstates {
 	return b
 }
 
+// CopyDeliveryservices creates a deep copy of the delivery service availability data.. It does not mutate, and is thus safe for multiple goroutines.
 func (a Crstates) CopyDeliveryservices() map[enum.DeliveryServiceName]Deliveryservice {
 	b := map[enum.DeliveryServiceName]Deliveryservice{}
 	for k, v := range a.Deliveryservice {
@@ -38,6 +43,7 @@ func (a Crstates) CopyDeliveryservices() map[enum.DeliveryServiceName]Deliveryse
 	return b
 }
 
+// CopyCaches creates a deep copy of the cache availability data.. It does not mutate, and is thus safe for multiple goroutines.
 func (a Crstates) CopyCaches() map[enum.CacheName]IsAvailable {
 	b := map[enum.CacheName]IsAvailable{}
 	for k, v := range a.Caches {
@@ -46,22 +52,25 @@ func (a Crstates) CopyCaches() map[enum.CacheName]IsAvailable {
 	return b
 }
 
+// IsAvailable contains whether the given cache or delivery service is available. It is designed for JSON serialization, namely in the Traffic Monitor 1.0 API.
 type IsAvailable struct {
 	IsAvailable bool `json:"isAvailable"`
 }
 
+// Deliveryservice contains data about the availability of a particular delivery service, and which caches in that delivery service have been marked as unavailable.
 type Deliveryservice struct {
 	DisabledLocations []enum.CacheName `json:"disabledLocations"`
 	IsAvailable       bool             `json:"isAvailable"`
 }
 
+// CrstatesUnMarshall takes bytes of a JSON string, and unmarshals them into a Crstates object.
 func CrstatesUnMarshall(body []byte) (Crstates, error) {
 	var crStates Crstates
-
 	err := json.Unmarshal(body, &crStates)
 	return crStates, err
 }
 
+// CrstatesMarshall serializes the given Crstates into bytes.
 func CrstatesMarshall(states Crstates) ([]byte, error) {
 	return json.Marshal(states)
 }
@@ -74,6 +83,7 @@ type CRStatesThreadsafe struct {
 	m        *sync.RWMutex
 }
 
+// NewCRStatesThreadsafe creates a new CRStatesThreadsafe object safe for multiple goroutine readers and a single writer.
 func NewCRStatesThreadsafe() CRStatesThreadsafe {
 	crs := NewCrstates()
 	return CRStatesThreadsafe{m: &sync.RWMutex{}, crStates: &crs}
@@ -95,54 +105,63 @@ func (t *CRStatesThreadsafe) GetDeliveryServices() map[enum.DeliveryServiceName]
 	return t.crStates.CopyDeliveryservices()
 }
 
+// GetCache returns the availability data of the given cache. This does not mutate, and is thus safe for multiple goroutines to call.
 func (t *CRStatesThreadsafe) GetCache(name enum.CacheName) IsAvailable {
 	t.m.RLock()
 	defer t.m.RUnlock()
 	return t.crStates.Caches[name]
 }
 
+// GetCaches returns the availability data of all caches. This does not mutate, and is thus safe for multiple goroutines to call.
 func (t *CRStatesThreadsafe) GetCaches() map[enum.CacheName]IsAvailable {
 	t.m.RLock()
 	defer t.m.RUnlock()
 	return t.crStates.CopyCaches()
 }
 
+// GetDeliveryService returns the availability data of the given delivery service. This does not mutate, and is thus safe for multiple goroutines to call.
 func (t *CRStatesThreadsafe) GetDeliveryService(name enum.DeliveryServiceName) Deliveryservice {
 	t.m.RLock()
 	defer t.m.RUnlock()
 	return t.crStates.Deliveryservice[name]
 }
 
+// Set sets the internal Crstates data. This MUST NOT be called by multiple goroutines.
 func (t *CRStatesThreadsafe) Set(newCRStates Crstates) {
 	t.m.Lock()
 	*t.crStates = newCRStates
 	t.m.Unlock()
 }
 
+// SetCache sets the internal availability data for a particular cache. This MUST NOT be called by multiple goroutines.
 func (t *CRStatesThreadsafe) SetCache(cacheName enum.CacheName, available IsAvailable) {
 	t.m.Lock()
 	t.crStates.Caches[cacheName] = available
 	t.m.Unlock()
 }
 
+// DeleteCache deletes the given cache from the internal data. This MUST NOT be called by multiple goroutines.
 func (t *CRStatesThreadsafe) DeleteCache(name enum.CacheName) {
 	t.m.Lock()
 	delete(t.crStates.Caches, name)
 	t.m.Unlock()
 }
 
+// SetDeliveryService sets the availability data for the given delivery service. This MUST NOT be called by multiple goroutines.
 func (t *CRStatesThreadsafe) SetDeliveryService(name enum.DeliveryServiceName, ds Deliveryservice) {
 	t.m.Lock()
 	t.crStates.Deliveryservice[name] = ds
 	t.m.Unlock()
 }
 
+// SetDeliveryServices sets the availability data for all delivery service. This MUST NOT be called by multiple goroutines.
 func (t *CRStatesThreadsafe) SetDeliveryServices(deliveryServices map[enum.DeliveryServiceName]Deliveryservice) {
 	t.m.Lock()
 	t.crStates.Deliveryservice = deliveryServices
 	t.m.Unlock()
 }
 
+// DeleteDeliveryService deletes the given delivery service from the internal data. This MUST NOT be called by multiple goroutines.
 func (t *CRStatesThreadsafe) DeleteDeliveryService(name enum.DeliveryServiceName) {
 	t.m.Lock()
 	delete(t.crStates.Deliveryservice, name)
@@ -156,10 +175,12 @@ type CRStatesPeersThreadsafe struct {
 	m        *sync.RWMutex
 }
 
+// NewCRStatesPeersThreadsafe creates a new CRStatesPeers object safe for multiple goroutine readers and a single writer.
 func NewCRStatesPeersThreadsafe() CRStatesPeersThreadsafe {
 	return CRStatesPeersThreadsafe{m: &sync.RWMutex{}, crStates: map[enum.TrafficMonitorName]Crstates{}}
 }
 
+// Get returns the internal Traffic Monitor peer Crstates data. This MUST NOT be modified.
 func (t *CRStatesPeersThreadsafe) Get() map[enum.TrafficMonitorName]Crstates {
 	t.m.RLock()
 	m := map[enum.TrafficMonitorName]Crstates{}
@@ -170,6 +191,7 @@ func (t *CRStatesPeersThreadsafe) Get() map[enum.TrafficMonitorName]Crstates {
 	return m
 }
 
+// Set sets the internal Traffic Monitor peer Crstates data. This MUST NOT be called by multiple goroutines.
 func (t *CRStatesPeersThreadsafe) Set(peerName enum.TrafficMonitorName, peerState Crstates) {
 	t.m.Lock()
 	t.crStates[peerName] = peerState

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/peer/peer.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/peer/peer.go b/traffic_monitor/experimental/traffic_monitor/peer/peer.go
index ae898eb..b6e9873 100644
--- a/traffic_monitor/experimental/traffic_monitor/peer/peer.go
+++ b/traffic_monitor/experimental/traffic_monitor/peer/peer.go
@@ -7,15 +7,18 @@ import (
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/enum"
 )
 
+// Handler handles peer Traffic Monitor data, taking a raw reader, parsing the data, and passing a result object to the ResultChannel. This fulfills the common `Handler` interface.
 type Handler struct {
 	ResultChannel chan Result
 	Notify        int
 }
 
+// NewHandler returns a new peer Handler.
 func NewHandler() Handler {
 	return Handler{ResultChannel: make(chan Result)}
 }
 
+// Result contains the data parsed from polling a peer Traffic Monitor.
 type Result struct {
 	ID           enum.TrafficMonitorName
 	Available    bool
@@ -25,6 +28,7 @@ type Result struct {
 	PollFinished chan<- uint64
 }
 
+// Handle handles a response from a polled Traffic Monitor peer, parsing the data and forwarding it to the ResultChannel.
 func (handler Handler) Handle(id string, r io.Reader, err error, pollID uint64, pollFinished chan<- uint64) {
 	result := Result{
 		ID:           enum.TrafficMonitorName(id),

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/srvhttp/srvhttp.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/srvhttp/srvhttp.go b/traffic_monitor/experimental/traffic_monitor/srvhttp/srvhttp.go
index 403b5a9..ebbad03 100644
--- a/traffic_monitor/experimental/traffic_monitor/srvhttp/srvhttp.go
+++ b/traffic_monitor/experimental/traffic_monitor/srvhttp/srvhttp.go
@@ -12,6 +12,7 @@ import (
 	"time"
 )
 
+// GetCommonAPIData calculates and returns API data common to most endpoints
 func GetCommonAPIData(params url.Values, t time.Time) CommonAPIData {
 	return CommonAPIData{
 		QueryParams: ParametersStr(params),
@@ -19,6 +20,7 @@ func GetCommonAPIData(params url.Values, t time.Time) CommonAPIData {
 	}
 }
 
+// CommonAPIData contains generic data common to most endpoints.
 type CommonAPIData struct {
 	QueryParams string `json:"pp"`
 	DateStr     string `json:"date"`
@@ -33,7 +35,7 @@ type Server struct {
 	stoppableListenerWaitGroup sync.WaitGroup
 }
 
-// Endpoints returns a map of HTTP paths to functions.
+// endpoints returns a map of HTTP paths to functions.
 // This is a function because Go doesn't have constant map literals.
 func (s Server) endpoints() (map[string]http.HandlerFunc, error) {
 	handleRoot, err := s.handleRootFunc()
@@ -143,29 +145,49 @@ func (s Server) Run(f GetDataFunc, addr string, readTimeout time.Duration, write
 	return nil
 }
 
+// Type is the API request type which was received.
 type Type int
 
 const (
+	// TRConfig represents a data request for the Traffic Router config
 	TRConfig Type = (1 << iota)
+	// TRStateDerived represents a data request for the derived data, aggregated from all Traffic Monitor peers.
 	TRStateDerived
+	// TRStateSelf represents a data request for the cache health data only from this Traffic Monitor, not from its peers.
 	TRStateSelf
+	// CacheStats represents a data request for general cache stats
 	CacheStats
+	// DSStats represents a data request for delivery service stats
 	DSStats
+	// EventLog represents a data request for the event log
 	EventLog
+	// PeerStates represents a data request for the cache health data gathered from Traffic Monitor peers.
 	PeerStates
+	// StatSummary represents a data request for a summary of the gathered stats
 	StatSummary
+	// Stats represents a data request for stats
 	Stats
+	// ConfigDoc represents a data request for this app's configuration data.
 	ConfigDoc
+	// APICacheCount represents a data request for the total number of caches this Traffic Monitor polls, as received Traffic Ops.
 	APICacheCount
+	// APICacheAvailableCount represents a data request for the number of caches flagged as available by this Traffic Monitor
 	APICacheAvailableCount
+	// APICacheDownCount represents a data request for the number of caches flagged as unavailable by this Traffic Monitor
 	APICacheDownCount
+	// APIVersion represents a data request for this app's version
 	APIVersion
+	// APITrafficOpsURI represents a data request for the Traffic Ops URI this app is configured to query
 	APITrafficOpsURI
+	// APICacheStates represents a data request for a summary of the cache states
 	APICacheStates
+	// APIBandwidthKbps represents a data request for the total bandwidth of all caches polled
 	APIBandwidthKbps
+	// APIBandwidthCapacityKbps represents a data request for the total bandwidth capacity of all caches polled
 	APIBandwidthCapacityKbps
 )
 
+// String returns a string representation of the API request type.
 func (t Type) String() string {
 	switch t {
 	case TRConfig:
@@ -209,13 +231,17 @@ func (t Type) String() string {
 	}
 }
 
+// Format is the format protocol the API response will be.
 type Format int
 
 const (
+	// XML represents that data should be serialized to XML
 	XML Format = (1 << iota)
+	// JSON represents that data should be serialized to JSON
 	JSON
 )
 
+// DataRequest contains all the data about an API request necessary to form a response.
 type DataRequest struct {
 	Type
 	Format
@@ -223,6 +249,7 @@ type DataRequest struct {
 	Parameters map[string][]string
 }
 
+// GetDataFunc is a function which takes a DataRequest from a request made by a client, and returns the proper response to send to the client.
 type GetDataFunc func(DataRequest) ([]byte, int)
 
 // ParametersStr takes the URL query parameters, and returns a string as used by the Traffic Monitor 1.0 endpoints "pp" key.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/traffic_monitor.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/traffic_monitor.go b/traffic_monitor/experimental/traffic_monitor/traffic_monitor.go
index 76cfdfc..3b810fa 100644
--- a/traffic_monitor/experimental/traffic_monitor/traffic_monitor.go
+++ b/traffic_monitor/experimental/traffic_monitor/traffic_monitor.go
@@ -19,7 +19,10 @@ import (
 	_ "github.com/davecheney/gmx"
 )
 
+// GitRevision is the git revision of the app. The app SHOULD always be built with this set via the `-X` flag.
 var GitRevision = "No Git Revision Specified. Please build with '-X main.GitRevision=${git rev-parse HEAD}'"
+
+// BuildTimestamp is the time the app was built. The app SHOULD always be built with this set via the `-X` flag.
 var BuildTimestamp = "No Build Timestamp Specified. Please build with '-X main.BuildTimestamp=`date +'%Y-%M-%dT%H:%M:%S'`"
 
 // getHostNameWithoutDomain returns the machine hostname, without domain information.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/trafficopsdata/trafficopsdata.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/trafficopsdata/trafficopsdata.go b/traffic_monitor/experimental/traffic_monitor/trafficopsdata/trafficopsdata.go
index 0ca1238..1659ae1 100644
--- a/traffic_monitor/experimental/traffic_monitor/trafficopsdata/trafficopsdata.go
+++ b/traffic_monitor/experimental/traffic_monitor/trafficopsdata/trafficopsdata.go
@@ -41,10 +41,12 @@ func (d Regexes) DeliveryService(fqdn string) (enum.DeliveryServiceName, bool) {
 	return "", false
 }
 
+// NewRegexes constructs a new Regexes object, initializing internal pointer members.
 func NewRegexes() Regexes {
 	return Regexes{DirectMatches: map[string]enum.DeliveryServiceName{}, DotStartSlashDotFooSlashDotDotStar: map[string]enum.DeliveryServiceName{}, RegexMatch: map[*regexp.Regexp]enum.DeliveryServiceName{}}
 }
 
+// TOData holds CDN data fetched from Traffic Ops.
 type TOData struct {
 	DeliveryServiceServers map[enum.DeliveryServiceName][]enum.CacheName
 	ServerDeliveryServices map[enum.CacheName][]enum.DeliveryServiceName
@@ -54,6 +56,7 @@ type TOData struct {
 	ServerCachegroups      map[enum.CacheName]enum.CacheGroupName
 }
 
+// New returns a new empty TOData object, initializing pointer members.
 func New() *TOData {
 	return &TOData{
 		DeliveryServiceServers: map[enum.DeliveryServiceName][]enum.CacheName{},
@@ -72,6 +75,7 @@ type TODataThreadsafe struct {
 	m      *sync.RWMutex
 }
 
+// NewThreadsafe returns a new TOData object, wrapped to be safe for multiple goroutine readers and a single writer.
 func NewThreadsafe() TODataThreadsafe {
 	return TODataThreadsafe{m: &sync.RWMutex{}, toData: New()}
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/trafficopswrapper/trafficopswrapper.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/trafficopswrapper/trafficopswrapper.go b/traffic_monitor/experimental/traffic_monitor/trafficopswrapper/trafficopswrapper.go
index 110dd8f..246ef2f 100644
--- a/traffic_monitor/experimental/traffic_monitor/trafficopswrapper/trafficopswrapper.go
+++ b/traffic_monitor/experimental/traffic_monitor/trafficopswrapper/trafficopswrapper.go
@@ -7,21 +7,25 @@ import (
 	to "github.com/apache/incubator-trafficcontrol/traffic_ops/client"
 )
 
+// ITrafficOpsSession provides an interface to the Traffic Ops client, so it may be wrapped or mocked.
 type ITrafficOpsSession interface {
 	CRConfigRaw(cdn string) ([]byte, error)
 	TrafficMonitorConfigMap(cdn string) (*to.TrafficMonitorConfigMap, error)
 	Set(session *to.Session)
 }
 
+// TrafficOpsSessionThreadsafe provides access to the Traffic Ops client safe for multiple goroutines. This fulfills the ITrafficOpsSession interface.
 type TrafficOpsSessionThreadsafe struct {
 	session **to.Session // pointer-to-pointer, because we're given a pointer from the Traffic Ops package, and we don't want to copy it.
 	m       *sync.Mutex
 }
 
+// NewTrafficOpsSessionThreadsafe returns a new threadsafe TrafficOpsSessionThreadsafe wrapping the given `Session`.
 func NewTrafficOpsSessionThreadsafe(s *to.Session) TrafficOpsSessionThreadsafe {
 	return TrafficOpsSessionThreadsafe{&s, &sync.Mutex{}}
 }
 
+// CRConfigRaw returns the CRConfig from the Traffic Ops. This is safe for multiple goroutines.
 func (s TrafficOpsSessionThreadsafe) CRConfigRaw(cdn string) ([]byte, error) {
 	s.m.Lock()
 	if s.session == nil || *s.session == nil {
@@ -32,6 +36,7 @@ func (s TrafficOpsSessionThreadsafe) CRConfigRaw(cdn string) ([]byte, error) {
 	return b, e
 }
 
+// TrafficMonitorConfigMap returns the Traffic Monitor config map from the Traffic Ops. This is safe for multiple goroutines.
 func (s TrafficOpsSessionThreadsafe) TrafficMonitorConfigMap(cdn string) (*to.TrafficMonitorConfigMap, error) {
 	s.m.Lock()
 	if s.session == nil || *s.session == nil {
@@ -42,6 +47,7 @@ func (s TrafficOpsSessionThreadsafe) TrafficMonitorConfigMap(cdn string) (*to.Tr
 	return d, e
 }
 
+// Set sets the internal Traffic Ops session. This is safe for multiple goroutines, being aware they will race.
 func (s TrafficOpsSessionThreadsafe) Set(session *to.Session) {
 	s.m.Lock()
 	*s.session = session

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b182dd83/traffic_monitor/experimental/traffic_monitor/version.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/version.go b/traffic_monitor/experimental/traffic_monitor/version.go
index bc6309a..caafcbc 100644
--- a/traffic_monitor/experimental/traffic_monitor/version.go
+++ b/traffic_monitor/experimental/traffic_monitor/version.go
@@ -1,3 +1,4 @@
 package main
 
+// Version is the current version of the app, in string form.
 var Version = "2.2"


[25/50] incubator-trafficcontrol git commit: Remove TM2 unused symbols

Posted by mi...@apache.org.
Remove TM2 unused symbols


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/ef0f50cf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/ef0f50cf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/ef0f50cf

Branch: refs/heads/master
Commit: ef0f50cf34c6021bed0ed6c880bae3a411b6d7cb
Parents: 43197ff
Author: Robert Butts <ro...@gmail.com>
Authored: Thu Oct 20 09:50:38 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 traffic_monitor/experimental/traffic_monitor/cache/cache.go | 6 ------
 traffic_monitor/experimental/traffic_monitor/peer/peer.go   | 6 ------
 2 files changed, 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/ef0f50cf/traffic_monitor/experimental/traffic_monitor/cache/cache.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/cache/cache.go b/traffic_monitor/experimental/traffic_monitor/cache/cache.go
index 3846964..8f0b3f9 100644
--- a/traffic_monitor/experimental/traffic_monitor/cache/cache.go
+++ b/traffic_monitor/experimental/traffic_monitor/cache/cache.go
@@ -83,12 +83,6 @@ type Filter interface {
 	WithinStatHistoryMax(int) bool
 }
 
-const (
-	NOTIFY_NEVER = iota
-	NOTIFY_CHANGE
-	NOTIFY_ALWAYS
-)
-
 // StatsMarshall encodes the stats in JSON, encoding up to historyCount of each stat. If statsToUse is empty, all stats are encoded; otherwise, only the given stats are encoded. If wildcard is true, stats which contain the text in each statsToUse are returned, instead of exact stat names. If cacheType is not CacheTypeInvalid, only stats for the given type are returned. If hosts is not empty, only the given hosts are returned.
 func StatsMarshall(statHistory map[enum.CacheName][]Result, filter Filter, params url.Values) ([]byte, error) {
 	stats := Stats{

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/ef0f50cf/traffic_monitor/experimental/traffic_monitor/peer/peer.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/peer/peer.go b/traffic_monitor/experimental/traffic_monitor/peer/peer.go
index 5c9ca90..b86c96e 100644
--- a/traffic_monitor/experimental/traffic_monitor/peer/peer.go
+++ b/traffic_monitor/experimental/traffic_monitor/peer/peer.go
@@ -25,12 +25,6 @@ type Result struct {
 	PollFinished chan<- uint64
 }
 
-const (
-	NOTIFY_NEVER = iota
-	NOTIFY_CHANGE
-	NOTIFY_ALWAYS
-)
-
 func (handler Handler) Handle(id string, r io.Reader, err error, pollId uint64, pollFinished chan<- uint64) {
 	result := Result{
 		Id:           enum.TrafficMonitorName(id),


[39/50] incubator-trafficcontrol git commit: Fix TM2 test to match renamed symbol

Posted by mi...@apache.org.
Fix TM2 test to match renamed symbol


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/8070bfeb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/8070bfeb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/8070bfeb

Branch: refs/heads/master
Commit: 8070bfeb4ec352f45c6337ca342b26ed1f349d0d
Parents: 4454360
Author: Robert Butts <ro...@gmail.com>
Authored: Fri Oct 21 15:21:46 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 traffic_monitor/experimental/traffic_monitor/peer/peer_test.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/8070bfeb/traffic_monitor/experimental/traffic_monitor/peer/peer_test.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/peer/peer_test.go b/traffic_monitor/experimental/traffic_monitor/peer/peer_test.go
index 416487f..72cd5dc 100644
--- a/traffic_monitor/experimental/traffic_monitor/peer/peer_test.go
+++ b/traffic_monitor/experimental/traffic_monitor/peer/peer_test.go
@@ -13,7 +13,7 @@ func TestCrStates(t *testing.T) {
 	if err != nil {
 		t.Log(err)
 	}
-	crStates, err := CrStatesUnMarshall(text)
+	crStates, err := CrstatesUnMarshall(text)
 	if err != nil {
 		t.Log(err)
 	}


[35/50] incubator-trafficcontrol git commit: Fix TM2 to simplify single var ranges

Posted by mi...@apache.org.
Fix TM2 to simplify single var ranges


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/b1bd9520
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/b1bd9520
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/b1bd9520

Branch: refs/heads/master
Commit: b1bd95205e40b26435af352e0c5f55108fa46c67
Parents: 32358a6
Author: Robert Butts <ro...@gmail.com>
Authored: Thu Oct 20 16:18:31 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../traffic_monitor/deliveryservice/stat.go             |  4 ++--
 .../traffic_monitor/deliveryservicedata/stat.go         |  2 +-
 .../experimental/traffic_monitor/manager/datarequest.go | 12 ++++++------
 .../traffic_monitor/manager/monitorconfig.go            |  2 +-
 .../traffic_monitor/manager/polledcaches.go             | 10 +++++-----
 .../traffic_monitor/trafficopsdata/trafficopsdata.go    |  2 +-
 6 files changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b1bd9520/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
index f80fcdf..16330b6 100644
--- a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
+++ b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
@@ -6,8 +6,8 @@ import (
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/cache"
 	dsdata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/deliveryservicedata"
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/enum"
-	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/srvhttp"
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/peer"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/srvhttp"
 	todata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
 	"net/url"
 	"strconv"
@@ -374,7 +374,7 @@ func addPerSecStats(statHistory map[enum.CacheName][]cache.Result, dsStats Stats
 func CreateStats(statHistory map[enum.CacheName][]cache.Result, toData todata.TOData, crStates peer.Crstates, lastStats LastStats, now time.Time) (Stats, LastStats, error) {
 	start := time.Now()
 	dsStats := NewStats()
-	for deliveryService, _ := range toData.DeliveryServiceServers {
+	for deliveryService := range toData.DeliveryServiceServers {
 		if deliveryService == "" {
 			log.Errorf("EMPTY CreateStats deliveryService")
 			continue

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b1bd9520/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go b/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
index 3ddc2c8..8eb4230 100644
--- a/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
+++ b/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
@@ -101,7 +101,7 @@ func (a StatCommon) CacheReporting(name enum.CacheName) (bool, bool) {
 }
 func (a StatCommon) CachesReportingNames() []enum.CacheName {
 	names := make([]enum.CacheName, 0, len(a.CachesReporting))
-	for name, _ := range a.CachesReporting {
+	for name := range a.CachesReporting {
 		names = append(names, name)
 	}
 	return names

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b1bd9520/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go b/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
index e754f89..1dcf198 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
@@ -73,7 +73,7 @@ func (f *CacheStatFilter) UseStat(statName string) bool {
 		_, ok := f.statsToUse[statName]
 		return ok
 	}
-	for statToUse, _ := range f.statsToUse {
+	for statToUse := range f.statsToUse {
 		if strings.Contains(statName, statToUse) {
 			return true
 		}
@@ -102,7 +102,7 @@ func NewCacheStatFilter(params url.Values, cacheTypes map[enum.CacheName]enum.Ca
 	if len(params) > len(validParams) {
 		return nil, fmt.Errorf("invalid query parameters")
 	}
-	for param, _ := range params {
+	for param := range params {
 		if _, ok := validParams[param]; !ok {
 			return nil, fmt.Errorf("invalid query parameter '%v'", param)
 		}
@@ -189,7 +189,7 @@ func (f *DSStatFilter) UseStat(statName string) bool {
 		_, ok := f.statsToUse[statName]
 		return ok
 	}
-	for statToUse, _ := range f.statsToUse {
+	for statToUse := range f.statsToUse {
 		if strings.Contains(statName, statToUse) {
 			return true
 		}
@@ -218,7 +218,7 @@ func NewDSStatFilter(params url.Values, dsTypes map[enum.DeliveryServiceName]enu
 	if len(params) > len(validParams) {
 		return nil, fmt.Errorf("invalid query parameters")
 	}
-	for param, _ := range params {
+	for param := range params {
 		if _, ok := validParams[param]; !ok {
 			return nil, fmt.Errorf("invalid query parameter '%v'", param)
 		}
@@ -308,7 +308,7 @@ func (f *PeerStateFilter) UseCache(name enum.CacheName) bool {
 		_, ok := f.cachesToUse[name]
 		return ok
 	}
-	for cacheToUse, _ := range f.cachesToUse {
+	for cacheToUse := range f.cachesToUse {
 		if strings.Contains(string(name), string(cacheToUse)) {
 			return true
 		}
@@ -338,7 +338,7 @@ func NewPeerStateFilter(params url.Values, cacheTypes map[enum.CacheName]enum.Ca
 	if len(params) > len(validParams) {
 		return nil, fmt.Errorf("invalid query parameters")
 	}
-	for param, _ := range params {
+	for param := range params {
 		if _, ok := validParams[param]; !ok {
 			return nil, fmt.Errorf("invalid query parameter '%v'", param)
 		}

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b1bd9520/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go b/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
index fa24f04..2016116 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/monitorconfig.go
@@ -172,7 +172,7 @@ func monitorConfigListen(
 				localStates.SetDeliveryService(enum.DeliveryServiceName(ds.XMLID), peer.Deliveryservice{IsAvailable: false, DisabledLocations: []enum.CacheName{}}) // important to initialize DisabledLocations, so JSON is `[]` not `null`
 			}
 		}
-		for ds, _ := range localStates.Get().Deliveryservice {
+		for ds := range localStates.Get().Deliveryservice {
 			if _, exists := monitorConfig.DeliveryService[string(ds)]; !exists {
 				localStates.DeleteDeliveryService(ds)
 			}

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b1bd9520/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go b/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go
index 9b66a8d..f22279d 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go
@@ -47,17 +47,17 @@ func (t *UnpolledCachesThreadsafe) setUnpolledCaches(v map[enum.CacheName]struct
 func (t *UnpolledCachesThreadsafe) SetNewCaches(newCaches map[enum.CacheName]struct{}) {
 	unpolledCaches := copyCaches(t.UnpolledCaches())
 	allCaches := copyCaches(*t.allCaches) // not necessary to lock `allCaches`, as the single-writer is the only thing that accesses it.
-	for cache, _ := range unpolledCaches {
+	for cache := range unpolledCaches {
 		if _, ok := newCaches[cache]; !ok {
 			delete(unpolledCaches, cache)
 		}
 	}
-	for cache, _ := range allCaches {
+	for cache := range allCaches {
 		if _, ok := newCaches[cache]; !ok {
 			delete(allCaches, cache)
 		}
 	}
-	for cache, _ := range newCaches {
+	for cache := range newCaches {
 		if _, ok := allCaches[cache]; !ok {
 			unpolledCaches[cache] = struct{}{}
 			allCaches[cache] = struct{}{}
@@ -77,7 +77,7 @@ func (t *UnpolledCachesThreadsafe) Any() bool {
 // copyCaches performs a deep copy of the given map.
 func copyCaches(a map[enum.CacheName]struct{}) map[enum.CacheName]struct{} {
 	b := map[enum.CacheName]struct{}{}
-	for k, _ := range a {
+	for k := range a {
 		b[k] = struct{}{}
 	}
 	return b
@@ -93,7 +93,7 @@ func (t *UnpolledCachesThreadsafe) SetPolled(results []cache.Result, lastStatsTh
 		return
 	}
 	lastStats := lastStatsThreadsafe.Get()
-	for cache, _ := range unpolledCaches {
+	for cache := range unpolledCaches {
 	innerLoop:
 		for _, result := range results {
 			if result.ID != cache {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b1bd9520/traffic_monitor/experimental/traffic_monitor/trafficopsdata/trafficopsdata.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/trafficopsdata/trafficopsdata.go b/traffic_monitor/experimental/traffic_monitor/trafficopsdata/trafficopsdata.go
index 33601bd..4793c77 100644
--- a/traffic_monitor/experimental/traffic_monitor/trafficopsdata/trafficopsdata.go
+++ b/traffic_monitor/experimental/traffic_monitor/trafficopsdata/trafficopsdata.go
@@ -157,7 +157,7 @@ func getDeliveryServiceServers(crc CRConfig) (map[enum.DeliveryServiceName][]enu
 	serverDses := map[enum.CacheName][]enum.DeliveryServiceName{}
 
 	for serverName, serverData := range crc.ContentServers {
-		for deliveryServiceName, _ := range serverData.DeliveryServices {
+		for deliveryServiceName := range serverData.DeliveryServices {
 			dsServers[deliveryServiceName] = append(dsServers[deliveryServiceName], serverName)
 			serverDses[serverName] = append(serverDses[serverName], deliveryServiceName)
 		}


[42/50] incubator-trafficcontrol git commit: Remove TM2 unused variable

Posted by mi...@apache.org.
Remove TM2 unused variable


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/044b759f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/044b759f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/044b759f

Branch: refs/heads/master
Commit: 044b759f0c6b0f37c1e3e4a07acf0372ee0cb832
Parents: 8070bfe
Author: Robert Butts <ro...@gmail.com>
Authored: Fri Oct 21 15:22:07 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../experimental/traffic_monitor/manager/polledcaches.go            | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/044b759f/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go b/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go
index 2194ce7..824b194 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go
@@ -14,7 +14,6 @@ type UnpolledCachesThreadsafe struct {
 	allCaches      *map[enum.CacheName]struct{}
 	initialized    *bool
 	m              *sync.RWMutex
-	max            uint64
 }
 
 // NewUnpolledCachesThreadsafe returns a new UnpolledCachesThreadsafe object.


[45/50] incubator-trafficcontrol git commit: Fix TM2 function comments to be godoc compliant

Posted by mi...@apache.org.
Fix TM2 function comments to be godoc compliant


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/4fd8fbeb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/4fd8fbeb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/4fd8fbeb

Branch: refs/heads/master
Commit: 4fd8fbebfdc37612fa863e7bf6a7cb9392f8c96d
Parents: 5d87c73
Author: Robert Butts <ro...@gmail.com>
Authored: Fri Oct 21 08:48:43 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../experimental/traffic_monitor/deliveryservice/stat.go       | 5 ++++-
 .../experimental/traffic_monitor/deliveryservicedata/stat.go   | 1 -
 traffic_monitor/experimental/traffic_monitor/enum/enum.go      | 2 --
 .../experimental/traffic_monitor/health/cache_health.go        | 2 +-
 .../traffic_monitor/manager/cacheavailablestatus.go            | 1 +
 .../experimental/traffic_monitor/manager/datarequest.go        | 1 +
 .../experimental/traffic_monitor/manager/manager.go            | 2 +-
 .../experimental/traffic_monitor/manager/opsconfig.go          | 4 +++-
 .../experimental/traffic_monitor/manager/polledcaches.go       | 6 +++---
 .../experimental/traffic_monitor/manager/stathistory.go        | 1 +
 .../experimental/traffic_monitor/manager/uintman.go            | 1 +
 traffic_monitor/experimental/traffic_monitor/peer/crstates.go  | 4 ++++
 .../traffic_monitor/trafficopsdata/trafficopsdata.go           | 3 ++-
 13 files changed, 22 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/4fd8fbeb/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
index a7d9312..2fe8586 100644
--- a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
+++ b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
@@ -16,6 +16,7 @@ import (
 
 // TODO remove 'ds' and 'stat' from names
 
+// Stats is the JSON-serialisable representation of delivery service Stats. It maps delivery service names to individual stat objects.
 // TODO remove DeliveryService and set type to the map directly, or add other members
 type Stats struct {
 	DeliveryService map[enum.DeliveryServiceName]dsdata.Stat `json:"deliveryService"`
@@ -34,6 +35,7 @@ func (s Stats) Get(name enum.DeliveryServiceName) (dsdata.StatReadonly, bool) {
 	return ds, ok
 }
 
+// NewStats creates a new Stats object, initializing any pointer members.
 // TODO rename to just 'New'?
 func NewStats() Stats {
 	return Stats{DeliveryService: map[enum.DeliveryServiceName]dsdata.Stat{}}
@@ -133,6 +135,7 @@ func (a LastStats) Copy() LastStats {
 	return b
 }
 
+// LastDSStat maps and aggregates the last stats received for the given delivery service to caches, cache groups, types, and total.
 // TODO figure a way to associate this type with StatHTTP, with which its members correspond.
 type LastDSStat struct {
 	Caches      map[enum.CacheName]LastStatsData
@@ -470,7 +473,7 @@ func addCommonData(s *dsdata.StatsOld, c *dsdata.StatCommon, deliveryService enu
 	return s
 }
 
-// StatsJSON returns an object formatted as expected to be serialized to JSON and served.
+// JSON returns an object formatted as expected to be serialized to JSON and served.
 func (s Stats) JSON(filter dsdata.Filter, params url.Values) dsdata.StatsOld {
 	now := time.Now().Unix()
 	jsonObj := &dsdata.StatsOld{

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/4fd8fbeb/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go b/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
index 8eb4230..a05b391 100644
--- a/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
+++ b/traffic_monitor/experimental/traffic_monitor/deliveryservicedata/stat.go
@@ -53,7 +53,6 @@ type StatCommonReadonly interface {
 	CachesAvailable() StatInt
 }
 
-// New, more structured format:
 type StatMeta struct {
 	Time int `json:"time"`
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/4fd8fbeb/traffic_monitor/experimental/traffic_monitor/enum/enum.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/enum/enum.go b/traffic_monitor/experimental/traffic_monitor/enum/enum.go
index c807a55..b0547da 100644
--- a/traffic_monitor/experimental/traffic_monitor/enum/enum.go
+++ b/traffic_monitor/experimental/traffic_monitor/enum/enum.go
@@ -12,10 +12,8 @@ type CacheName string
 
 type CacheGroupName string
 
-// Current JSON endpoint:
 type DeliveryServiceName string
 
-// TODO move and rename more generically
 type CacheType string
 
 const (

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/4fd8fbeb/traffic_monitor/experimental/traffic_monitor/health/cache_health.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/health/cache_health.go b/traffic_monitor/experimental/traffic_monitor/health/cache_health.go
index 11e746e..4147418 100644
--- a/traffic_monitor/experimental/traffic_monitor/health/cache_health.go
+++ b/traffic_monitor/experimental/traffic_monitor/health/cache_health.go
@@ -15,7 +15,7 @@ func setError(newResult *cache.Result, err error) {
 	newResult.Available = false
 }
 
-// Get the vitals to decide health on in the right format
+// GetVitals Gets the vitals to decide health on in the right format
 func GetVitals(newResult *cache.Result, prevResult *cache.Result, mc *traffic_ops.TrafficMonitorConfigMap) {
 	if newResult.Error != nil {
 		log.Errorf("cache_health.GetVitals() called with an errored Result!")

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/4fd8fbeb/traffic_monitor/experimental/traffic_monitor/manager/cacheavailablestatus.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/cacheavailablestatus.go b/traffic_monitor/experimental/traffic_monitor/manager/cacheavailablestatus.go
index 31dcbee..ab05e1a 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/cacheavailablestatus.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/cacheavailablestatus.go
@@ -5,6 +5,7 @@ import (
 	"sync"
 )
 
+// CacheAvailableStatusReported is the status string returned by caches set to "reported" in Traffic Ops.
 // TODO put somewhere more generic
 const CacheAvailableStatusReported = "REPORTED"
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/4fd8fbeb/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go b/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
index 1dcf198..860d877 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
@@ -35,6 +35,7 @@ type APIPeerStates struct {
 	Peers map[enum.TrafficMonitorName]map[enum.CacheName][]CacheState `json:"peers"`
 }
 
+// CacheStatus contains summary stat data about the given cache.
 // TODO make fields nullable, so error fields can be omitted, letting API callers still get updates for unerrored fields
 type CacheStatus struct {
 	Type                  *string  `json:"type,omitempty"`

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/4fd8fbeb/traffic_monitor/experimental/traffic_monitor/manager/manager.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/manager.go b/traffic_monitor/experimental/traffic_monitor/manager/manager.go
index ea4b106..8d479b5 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/manager.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/manager.go
@@ -29,7 +29,7 @@ type StaticAppData struct {
 }
 
 //
-// Kicks off the pollers and handlers
+// Start starts the poller and handler goroutines
 //
 func Start(opsConfigFile string, cfg config.Config, staticAppData StaticAppData) {
 	toSession := towrap.ITrafficOpsSession(towrap.NewTrafficOpsSessionThreadsafe(nil))

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/4fd8fbeb/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go b/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
index d069578..b2ba283 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
@@ -9,13 +9,14 @@ import (
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/log"
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/common/poller"
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/config"
-	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/srvhttp"
 	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/peer"
+	"github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/srvhttp"
 	todata "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopsdata"
 	towrap "github.com/apache/incubator-trafficcontrol/traffic_monitor/experimental/traffic_monitor/trafficopswrapper"
 	to "github.com/apache/incubator-trafficcontrol/traffic_ops/client"
 )
 
+// OpsConfigThreadsafe provides safe access for multiple reader goroutines and a single writer to a stored OpsConfig object.
 // This could be made lock-free, if the performance was necessary
 type OpsConfigThreadsafe struct {
 	opsConfig *handler.OpsConfig
@@ -38,6 +39,7 @@ func (o *OpsConfigThreadsafe) Set(newOpsConfig handler.OpsConfig) {
 	o.m.Unlock()
 }
 
+// StartOpsConfigManager starts the ops config manager goroutine, returning the (threadsafe) variables which it sets.
 // Note the OpsConfigManager is in charge of the httpServer, because ops config changes trigger server changes. If other things needed to trigger server restarts, the server could be put in its own goroutine with signal channels
 func StartOpsConfigManager(
 	opsConfigFile string,

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/4fd8fbeb/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go b/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go
index f22279d..2194ce7 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/polledcaches.go
@@ -28,14 +28,14 @@ func NewUnpolledCachesThreadsafe() UnpolledCachesThreadsafe {
 	}
 }
 
-// Get returns the caches. Callers MUST NOT modify. If mutation is necessary, copy the map
+// UnpolledCaches returns a map of caches not yet polled. Callers MUST NOT modify. If mutation is necessary, copy the map
 func (t *UnpolledCachesThreadsafe) UnpolledCaches() map[enum.CacheName]struct{} {
 	t.m.RLock()
 	defer t.m.RUnlock()
 	return *t.unpolledCaches
 }
 
-// Set sets the internal unpolled caches map. This is only safe for one thread of execution. This MUST NOT be called from multiple threads.
+// setUnpolledCaches sets the internal unpolled caches map. This is only safe for one thread of execution. This MUST NOT be called from multiple threads.
 func (t *UnpolledCachesThreadsafe) setUnpolledCaches(v map[enum.CacheName]struct{}) {
 	t.m.Lock()
 	*t.initialized = true
@@ -67,7 +67,7 @@ func (t *UnpolledCachesThreadsafe) SetNewCaches(newCaches map[enum.CacheName]str
 	t.setUnpolledCaches(unpolledCaches)
 }
 
-// AnyCachesUnpolled returns whether there are any caches marked as not polled. Also returns true if SetNewCaches() has never been called (assuming there exist caches, if this hasn't been initialized, we couldn't have polled any of them).
+// Any returns whether there are any caches marked as not polled. Also returns true if SetNewCaches() has never been called (assuming there exist caches, if this hasn't been initialized, we couldn't have polled any of them).
 func (t *UnpolledCachesThreadsafe) Any() bool {
 	t.m.Lock()
 	defer t.m.Unlock()

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/4fd8fbeb/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go b/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
index ac1c7a6..8dda3e2 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
@@ -29,6 +29,7 @@ func (a StatHistory) Copy() StatHistory {
 	return b
 }
 
+// StatHistoryThreadsafe provides safe access for multiple goroutines readers and a single writer to a stored StatHistory object.
 // This could be made lock-free, if the performance was necessary
 // TODO add separate locks for Caches and Deliveryservice maps?
 type StatHistoryThreadsafe struct {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/4fd8fbeb/traffic_monitor/experimental/traffic_monitor/manager/uintman.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/uintman.go b/traffic_monitor/experimental/traffic_monitor/manager/uintman.go
index 81558d0..d85e4a7 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/uintman.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/uintman.go
@@ -21,6 +21,7 @@ func (u *UintThreadsafe) Set(v uint64) {
 	atomic.StoreUint64(u.val, v)
 }
 
+// Inc increments the internal uint64.
 // TODO make sure everything using this uses the value it returns, not a separate Get
 func (u *UintThreadsafe) Inc() uint64 {
 	return atomic.AddUint64(u.val, 1)

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/4fd8fbeb/traffic_monitor/experimental/traffic_monitor/peer/crstates.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/peer/crstates.go b/traffic_monitor/experimental/traffic_monitor/peer/crstates.go
index 1aaf314..83f7073 100644
--- a/traffic_monitor/experimental/traffic_monitor/peer/crstates.go
+++ b/traffic_monitor/experimental/traffic_monitor/peer/crstates.go
@@ -66,6 +66,7 @@ func CrstatesMarshall(states Crstates) ([]byte, error) {
 	return json.Marshal(states)
 }
 
+// CRStatesThreadsafe provides safe access for multiple goroutines to read a single Crstates object, with a single goroutine writer.
 // This could be made lock-free, if the performance was necessary
 // TODO add separate locks for Caches and Deliveryservice maps?
 type CRStatesThreadsafe struct {
@@ -78,6 +79,7 @@ func NewCRStatesThreadsafe() CRStatesThreadsafe {
 	return CRStatesThreadsafe{m: &sync.RWMutex{}, crStates: &crs}
 }
 
+// Get returns the internal Crstates object for reading.
 // TODO add GetCaches, GetDeliveryservices?
 func (t *CRStatesThreadsafe) Get() Crstates {
 	t.m.RLock()
@@ -85,6 +87,7 @@ func (t *CRStatesThreadsafe) Get() Crstates {
 	return t.crStates.Copy()
 }
 
+// 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()
@@ -146,6 +149,7 @@ func (t *CRStatesThreadsafe) DeleteDeliveryService(name enum.DeliveryServiceName
 	t.m.Unlock()
 }
 
+// CRStatesPeersThreadsafe provides safe access for multiple goroutines to read a map of Traffic Monitor peers to their returned Crstates, with a single goroutine writer.
 // This could be made lock-free, if the performance was necessary
 type CRStatesPeersThreadsafe struct {
 	crStates map[enum.TrafficMonitorName]Crstates

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/4fd8fbeb/traffic_monitor/experimental/traffic_monitor/trafficopsdata/trafficopsdata.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/trafficopsdata/trafficopsdata.go b/traffic_monitor/experimental/traffic_monitor/trafficopsdata/trafficopsdata.go
index 4793c77..0ca1238 100644
--- a/traffic_monitor/experimental/traffic_monitor/trafficopsdata/trafficopsdata.go
+++ b/traffic_monitor/experimental/traffic_monitor/trafficopsdata/trafficopsdata.go
@@ -10,7 +10,7 @@ import (
 	"sync"
 )
 
-// DsRegexes maps Delivery Service Regular Expressions to delivery services.
+// Regexes maps Delivery Service Regular Expressions to delivery services.
 // For performance, we categorize Regular Expressions into 3 categories:
 // 1. Direct string matches, with no regular expression matching characters
 // 2. .*\.foo\..* expressions, where foo is a direct string match with no regular expression matching characters
@@ -65,6 +65,7 @@ func New() *TOData {
 	}
 }
 
+// TODataThreadsafe provides safe access for multiple goroutine writers and one goroutine reader, to the encapsulated TOData object.
 // This could be made lock-free, if the performance was necessary
 type TODataThreadsafe struct {
 	toData *TOData


[09/50] incubator-trafficcontrol git commit: changes docker image name

Posted by mi...@apache.org.
changes docker image name


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/46ed93ed
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/46ed93ed
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/46ed93ed

Branch: refs/heads/master
Commit: 46ed93ed3243e72bc25ca39fa3cfbd1d9c753595
Parents: e25fcda
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Thu Oct 20 11:09:01 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 traffic_ops/experimental/ui/build/README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/46ed93ed/traffic_ops/experimental/ui/build/README.md
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/build/README.md b/traffic_ops/experimental/ui/build/README.md
index 90879f9..5cdc42e 100644
--- a/traffic_ops/experimental/ui/build/README.md
+++ b/traffic_ops/experimental/ui/build/README.md
@@ -12,8 +12,8 @@
 
     ```
     $ cd traffic_ops/experimental/ui/build
-    $ docker build -t tov2-build .
-    $ docker run -v $(pwd)/artifacts:/artifacts -e GITREPO=https://github.com/apache/incubator-trafficcontrol.git -e BRANCH=master tov2-build
+    $ docker build -t tov2-image .
+    $ docker run -v $(pwd)/artifacts:/artifacts -e GITREPO=https://github.com/apache/incubator-trafficcontrol.git -e BRANCH=master tov2-image
     ```
 
     The rpm will be created the `artifacts` directory.


[24/50] incubator-trafficcontrol git commit: Fix TM2 unnecessary conversions

Posted by mi...@apache.org.
Fix TM2 unnecessary conversions


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/fa4d2e59
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/fa4d2e59
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/fa4d2e59

Branch: refs/heads/master
Commit: fa4d2e5968d06a8a42024d3ecfdb0e55e32ec797
Parents: b182dd8
Author: Robert Butts <ro...@gmail.com>
Authored: Fri Oct 21 15:11:40 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../traffic_monitor/deliveryservice/stat.go       | 18 +++++++++---------
 .../traffic_monitor/manager/datarequest.go        | 10 +++++-----
 .../traffic_monitor/manager/healthresult.go       | 10 +++++-----
 .../traffic_monitor/manager/stathistory.go        |  8 ++++----
 4 files changed, 23 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/fa4d2e59/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
index d8dd30c..ff94e42 100644
--- a/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
+++ b/traffic_monitor/experimental/traffic_monitor/deliveryservice/stat.go
@@ -63,7 +63,7 @@ func addAvailableData(dsStats Stats, crStates peer.Crstates, serverCachegroups m
 			log.Warnf("CreateStats not adding availability data for '%s': not found in DeliveryServices\n", cache)
 			continue
 		}
-		cacheType, ok := serverTypes[enum.CacheName(cache)]
+		cacheType, ok := serverTypes[cache]
 		if !ok {
 			log.Warnf("CreateStats not adding availability data for '%s': not found in Server Types\n", cache)
 			continue
@@ -75,7 +75,7 @@ func addAvailableData(dsStats Stats, crStates peer.Crstates, serverCachegroups m
 				continue
 			}
 
-			stat, ok := dsStats.DeliveryService[enum.DeliveryServiceName(deliveryService)]
+			stat, ok := dsStats.DeliveryService[deliveryService]
 			if !ok {
 				log.Warnf("CreateStats not adding availability data for '%s': not found in Stats\n", cache)
 				continue // TODO log warning? Error?
@@ -85,9 +85,9 @@ func addAvailableData(dsStats Stats, crStates peer.Crstates, serverCachegroups m
 				// c.IsAvailable.Value
 				stat.CommonStats.IsAvailable.Value = true
 				stat.CommonStats.CachesAvailableNum.Value++
-				cacheGroupStats := stat.CacheGroups[enum.CacheGroupName(cacheGroup)]
+				cacheGroupStats := stat.CacheGroups[cacheGroup]
 				cacheGroupStats.IsAvailable.Value = true
-				stat.CacheGroups[enum.CacheGroupName(cacheGroup)] = cacheGroupStats
+				stat.CacheGroups[cacheGroup] = cacheGroupStats
 				stat.TotalStats.IsAvailable.Value = true
 				typeStats := stat.Types[cacheType]
 				typeStats.IsAvailable.Value = true
@@ -95,13 +95,13 @@ func addAvailableData(dsStats Stats, crStates peer.Crstates, serverCachegroups m
 			}
 
 			// TODO fix nested ifs
-			if results, ok := statHistory[enum.CacheName(cache)]; ok {
+			if results, ok := statHistory[cache]; ok {
 				if len(results) < 1 {
 					log.Warnf("no results %v %v\n", cache, deliveryService)
 				} else {
 					result := results[0]
 					if result.PrecomputedData.Reporting {
-						stat.CommonStats.CachesReporting[enum.CacheName(cache)] = true
+						stat.CommonStats.CachesReporting[cache] = true
 					} else {
 						log.Debugf("no reporting %v %v\n", cache, deliveryService)
 					}
@@ -110,7 +110,7 @@ func addAvailableData(dsStats Stats, crStates peer.Crstates, serverCachegroups m
 				log.Debugf("no result for %v %v\n", cache, deliveryService)
 			}
 
-			dsStats.DeliveryService[enum.DeliveryServiceName(deliveryService)] = stat // TODO Necessary? Remove?
+			dsStats.DeliveryService[deliveryService] = stat // TODO Necessary? Remove?
 		}
 	}
 	return dsStats, nil
@@ -391,7 +391,7 @@ func CreateStats(statHistory map[enum.CacheName][]cache.Result, toData todata.TO
 			log.Errorf("EMPTY CreateStats deliveryService")
 			continue
 		}
-		dsStats.DeliveryService[enum.DeliveryServiceName(deliveryService)] = *dsdata.NewStat()
+		dsStats.DeliveryService[deliveryService] = *dsdata.NewStat()
 	}
 	dsStats = setStaticData(dsStats, toData.DeliveryServiceServers)
 	var err error
@@ -409,7 +409,7 @@ func CreateStats(statHistory map[enum.CacheName][]cache.Result, toData todata.TO
 			log.Warnf("server %s has no cachegroup, skipping\n", server)
 			continue
 		}
-		serverType, ok := toData.ServerTypes[enum.CacheName(server)]
+		serverType, ok := toData.ServerTypes[server]
 		if !ok {
 			log.Warnf("server %s not in CRConfig, skipping\n", server)
 			continue

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/fa4d2e59/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go b/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
index e6da58a..6a7fd9c 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
@@ -613,7 +613,7 @@ func createCacheStatuses(
 		}
 
 		var kbps *float64
-		lastStat, ok := lastStats.Caches[enum.CacheName(cacheName)]
+		lastStat, ok := lastStats.Caches[cacheName]
 		if !ok {
 			log.Warnf("cache not in last kbps cache %s\n", cacheName)
 		} else {
@@ -622,7 +622,7 @@ func createCacheStatuses(
 		}
 
 		var connections *int64
-		connectionsVal, ok := conns[enum.CacheName(cacheName)]
+		connectionsVal, ok := conns[cacheName]
 		if !ok {
 			log.Warnf("cache not in connections %s\n", cacheName)
 		} else {
@@ -630,12 +630,12 @@ func createCacheStatuses(
 		}
 
 		var status *string
-		statusVal, ok := localCacheStatus[enum.CacheName(cacheName)]
+		statusVal, ok := localCacheStatus[cacheName]
 		if !ok {
 			log.Warnf("cache not in statuses %s\n", cacheName)
 		} else {
 			statusString := statusVal.Status + " - "
-			if localCacheStatus[enum.CacheName(cacheName)].Available {
+			if localCacheStatus[cacheName].Available {
 				statusString += "available"
 			} else {
 				statusString += "unavailable"
@@ -644,7 +644,7 @@ func createCacheStatuses(
 		}
 
 		cacheTypeStr := string(cacheType)
-		statii[enum.CacheName(cacheName)] = CacheStatus{Type: &cacheTypeStr, LoadAverage: loadAverage, QueryTimeMilliseconds: queryTime, BandwidthKbps: kbps, ConnectionCount: connections, Status: status}
+		statii[cacheName] = CacheStatus{Type: &cacheTypeStr, LoadAverage: loadAverage, QueryTimeMilliseconds: queryTime, BandwidthKbps: kbps, ConnectionCount: connections, Status: status}
 	}
 	return statii
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/fa4d2e59/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go b/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go
index 5cefd06..de069b3 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/healthresult.go
@@ -194,7 +194,7 @@ func processHealthResult(
 		log.Debugf("poll %v %v healthresultman start\n", healthResult.PollID, time.Now())
 		fetchCount.Inc()
 		var prevResult cache.Result
-		healthResultHistory := healthHistory[enum.CacheName(healthResult.ID)]
+		healthResultHistory := healthHistory[healthResult.ID]
 		if len(healthResultHistory) != 0 {
 			prevResult = healthResultHistory[len(healthResultHistory)-1]
 		}
@@ -203,7 +203,7 @@ func processHealthResult(
 			health.GetVitals(&healthResult, &prevResult, &monitorConfigCopy)
 		}
 
-		healthHistory[enum.CacheName(healthResult.ID)] = pruneHistory(append(healthHistory[enum.CacheName(healthResult.ID)], healthResult), cfg.MaxHealthHistory)
+		healthHistory[healthResult.ID] = pruneHistory(append(healthHistory[healthResult.ID], healthResult), cfg.MaxHealthHistory)
 
 		isAvailable, whyAvailable := health.EvalCache(healthResult, &monitorConfigCopy)
 		if localStates.Get().Caches[healthResult.ID].IsAvailable != isAvailable {
@@ -222,11 +222,11 @@ func processHealthResult(
 
 	lastHealthDurations := lastHealthDurationsThreadsafe.Get().Copy()
 	for _, healthResult := range results {
-		if lastHealthStart, ok := lastHealthEndTimes[enum.CacheName(healthResult.ID)]; ok {
+		if lastHealthStart, ok := lastHealthEndTimes[healthResult.ID]; ok {
 			d := time.Since(lastHealthStart)
-			lastHealthDurations[enum.CacheName(healthResult.ID)] = d
+			lastHealthDurations[healthResult.ID] = d
 		}
-		lastHealthEndTimes[enum.CacheName(healthResult.ID)] = time.Now()
+		lastHealthEndTimes[healthResult.ID] = time.Now()
 
 		log.Debugf("poll %v %v finish\n", healthResult.PollID, time.Now())
 		healthResult.PollFinished <- healthResult.PollID

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/fa4d2e59/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go b/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
index 24edcf7..20a9e2c 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
@@ -156,7 +156,7 @@ func processStatResults(
 	maxStats := statHistoryThreadsafe.Max()
 	for _, result := range results {
 		// TODO determine if we want to add results with errors, or just print the errors now and don't add them.
-		statHistory[enum.CacheName(result.ID)] = pruneHistory(append(statHistory[enum.CacheName(result.ID)], result), maxStats)
+		statHistory[result.ID] = pruneHistory(append(statHistory[result.ID], result), maxStats)
 	}
 	statHistoryThreadsafe.Set(statHistory)
 
@@ -181,11 +181,11 @@ func processStatResults(
 	endTime := time.Now()
 	lastStatDurations := lastStatDurationsThreadsafe.Get().Copy()
 	for _, result := range results {
-		if lastStatStart, ok := lastStatEndTimes[enum.CacheName(result.ID)]; ok {
+		if lastStatStart, ok := lastStatEndTimes[result.ID]; ok {
 			d := time.Since(lastStatStart)
-			lastStatDurations[enum.CacheName(result.ID)] = d
+			lastStatDurations[result.ID] = d
 		}
-		lastStatEndTimes[enum.CacheName(result.ID)] = endTime
+		lastStatEndTimes[result.ID] = endTime
 
 		// log.Debugf("poll %v %v statfinish\n", result.PollID, endTime)
 		result.PollFinished <- result.PollID


[40/50] incubator-trafficcontrol git commit: Fix TM2 DSStatsThreadsafe to be passed as a Reader

Posted by mi...@apache.org.
Fix TM2 DSStatsThreadsafe to be passed as a Reader


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/44543606
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/44543606
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/44543606

Branch: refs/heads/master
Commit: 445436069c16adbbdff15bf06a87179be7feb5f2
Parents: fa4d2e5
Author: Robert Butts <ro...@gmail.com>
Authored: Fri Oct 21 15:17:28 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../experimental/traffic_monitor/manager/datarequest.go          | 2 +-
 .../experimental/traffic_monitor/manager/opsconfig.go            | 2 +-
 .../experimental/traffic_monitor/manager/stathistory.go          | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/44543606/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go b/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
index 6a7fd9c..ccb7447 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/datarequest.go
@@ -420,7 +420,7 @@ func DataRequest(
 	peerStates peer.CRStatesPeersThreadsafe,
 	combinedStates peer.CRStatesThreadsafe,
 	statHistory StatHistoryThreadsafe,
-	dsStats DSStatsThreadsafe,
+	dsStats DSStatsReader,
 	events EventsThreadsafe,
 	staticAppData StaticAppData,
 	healthPollInterval time.Duration,

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/44543606/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go b/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
index 03448dc..cdb78eb 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/opsconfig.go
@@ -55,7 +55,7 @@ func StartOpsConfigManager(
 	combinedStates peer.CRStatesThreadsafe,
 	statHistory StatHistoryThreadsafe,
 	lastStats LastStatsThreadsafe,
-	dsStats DSStatsThreadsafe,
+	dsStats DSStatsReader,
 	events EventsThreadsafe,
 	staticAppData StaticAppData,
 	healthPollInterval time.Duration,

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/44543606/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go b/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
index 20a9e2c..7af7e2c 100644
--- a/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
+++ b/traffic_monitor/experimental/traffic_monitor/manager/stathistory.go
@@ -98,7 +98,7 @@ func StartStatHistoryManager(
 	errorCount UintThreadsafe,
 	cfg config.Config,
 	monitorConfig TrafficMonitorConfigMapThreadsafe,
-) (StatHistoryThreadsafe, DurationMapThreadsafe, LastStatsThreadsafe, DSStatsThreadsafe, UnpolledCachesThreadsafe) {
+) (StatHistoryThreadsafe, DurationMapThreadsafe, LastStatsThreadsafe, DSStatsReader, UnpolledCachesThreadsafe) {
 	statHistory := NewStatHistoryThreadsafe(cfg.MaxStatHistory)
 	lastStatDurations := NewDurationMapThreadsafe()
 	lastStatEndTimes := map[enum.CacheName]time.Time{}
@@ -136,7 +136,7 @@ func StartStatHistoryManager(
 			}
 		}
 	}()
-	return statHistory, lastStatDurations, lastStats, dsStats, unpolledCaches
+	return statHistory, lastStatDurations, lastStats, &dsStats, unpolledCaches
 }
 
 // processStatResults processes the given results, creating and setting DSStats, LastStats, and other stats. Note this is NOT threadsafe, and MUST NOT be called from multiple threads.


[12/50] incubator-trafficcontrol git commit: test push

Posted by mi...@apache.org.
test push


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/13d85389
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/13d85389
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/13d85389

Branch: refs/heads/master
Commit: 13d853897e0fea946f8c54fb785475343fd2bfb0
Parents: ada70b4
Author: Mark Torluemke <ma...@cable.comcast.com>
Authored: Sat Oct 22 20:57:44 2016 +0000
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 docs/source/admin/traffic_monitor.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/13d85389/docs/source/admin/traffic_monitor.rst
----------------------------------------------------------------------
diff --git a/docs/source/admin/traffic_monitor.rst b/docs/source/admin/traffic_monitor.rst
index b7615fb..a55a0ce 100644
--- a/docs/source/admin/traffic_monitor.rst
+++ b/docs/source/admin/traffic_monitor.rst
@@ -33,7 +33,7 @@ The following are requirements to ensure an accurate set up:
 
 1. Enter the Traffic Monitor server into Traffic Ops
 2. Make sure the FQDN of the Traffic Monitor is resolvable in DNS.
-3. Install Traffic Monitor and perl mods: ``sudo yum -y install traffic_monitor perl-JSON perl-WWW-Curl``
+3. Install Traffic Monitor and Perl mods: ``sudo yum -y install traffic_monitor perl-JSON perl-WWW-Curl``
 4. Take the config from Traffic Ops - run : ``sudo /opt/traffic_monitor/bin/traffic_monitor_config.pl``
  
 	Sample output: ::


[28/50] incubator-trafficcontrol git commit: Fix TM2 duplicate file handling

Posted by mi...@apache.org.
Fix TM2 duplicate file handling


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/95095102
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/95095102
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/95095102

Branch: refs/heads/master
Commit: 9509510277d8209763d73aa6355d9c363e3ecdf0
Parents: e7a5fb6
Author: Robert Butts <ro...@gmail.com>
Authored: Thu Oct 20 10:39:33 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 .../traffic_monitor/http_server/http_server.go        | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/95095102/traffic_monitor/experimental/traffic_monitor/http_server/http_server.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/http_server/http_server.go b/traffic_monitor/experimental/traffic_monitor/http_server/http_server.go
index 6206cfd..a0a18dd 100644
--- a/traffic_monitor/experimental/traffic_monitor/http_server/http_server.go
+++ b/traffic_monitor/experimental/traffic_monitor/http_server/http_server.go
@@ -265,17 +265,15 @@ func (s Server) dataRequest(w http.ResponseWriter, req *http.Request, t Type, f
 }
 
 func (s Server) handleRootFunc() (http.HandlerFunc, error) {
-	index, err := ioutil.ReadFile("index.html")
-	if err != nil {
-		return nil, err
-	}
-	return func(w http.ResponseWriter, req *http.Request) {
-		fmt.Fprintf(w, "%s", index)
-	}, nil
+	return handleFile("index.html")
 }
 
 func (s Server) handleSortableFunc() (http.HandlerFunc, error) {
-	index, err := ioutil.ReadFile("sorttable.js")
+	return handleFile("sorttable.js")
+}
+
+func (s Server) handleFile(name string) (http.HandlerFunc, error) {
+	index, err := ioutil.ReadFile(file)
 	if err != nil {
 		return nil, err
 	}


[15/50] incubator-trafficcontrol git commit: small docs clarification on postinstall

Posted by mi...@apache.org.
small docs clarification on postinstall


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/b08c0901
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/b08c0901
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/b08c0901

Branch: refs/heads/master
Commit: b08c09012f757a227d65b2294a4a48749d390016
Parents: 3493a0a
Author: Mark Torluemke <mt...@apache.org>
Authored: Sun Oct 23 19:46:56 2016 +0000
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 docs/source/admin/traffic_ops_install.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b08c0901/docs/source/admin/traffic_ops_install.rst
----------------------------------------------------------------------
diff --git a/docs/source/admin/traffic_ops_install.rst b/docs/source/admin/traffic_ops_install.rst
index 784b696..bdb96ce 100644
--- a/docs/source/admin/traffic_ops_install.rst
+++ b/docs/source/admin/traffic_ops_install.rst
@@ -98,7 +98,7 @@ To begin the install:
       Hit ENTER to continue:
 
 
-  The first thing the post install will do is install additional packages needed from the yum repo.
+  The first thing postinstall will do is install additional packages needed from the yum repo.
 
   Ater that, it will automatically proceed to installing the required Perl packages from CPAN.
 
@@ -378,5 +378,5 @@ To upgrade:
 
 1. Enter the following command:``service traffic_ops stop``
 2. Enter the following command:``yum upgrade traffic_ops``
-3. See :ref:`rl-ps` to run the post install.
+3. See :ref:`rl-ps` to run postinstall.
 4. Enter the following command:``service traffic_ops start``


[10/50] incubator-trafficcontrol git commit: clarifies config template

Posted by mi...@apache.org.
clarifies config template


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/6e8a6181
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/6e8a6181
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/6e8a6181

Branch: refs/heads/master
Commit: 6e8a61810b075bf9b2fa46822ec153ffcfa900e9
Parents: 46ed93e
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Thu Oct 20 11:46:27 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri Oct 28 15:04:12 2016 -0600

----------------------------------------------------------------------
 traffic_ops/experimental/ui/conf/config-template.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6e8a6181/traffic_ops/experimental/ui/conf/config-template.js
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/conf/config-template.js b/traffic_ops/experimental/ui/conf/config-template.js
index 8effe10..642cb10 100644
--- a/traffic_ops/experimental/ui/conf/config-template.js
+++ b/traffic_ops/experimental/ui/conf/config-template.js
@@ -16,7 +16,7 @@
 
  */
 
-// this is the config for /opt/traffic_ops/server/server.js and is consumed when 'sudo service traffic_ops start'
+// this is the config for /opt/traffic_ops/server/server.js and is consumed when 'sudo service traffic_ops_v2 start'
 module.exports = {
 	timeout: '120s',
 	useSSL: false, // set to true if you plan to use https (self-signed or trusted certs).
@@ -31,10 +31,10 @@ module.exports = {
 			'/path/to/ssl-bundle.crt'
 		]
 	},
-	// set api 'base_url' to the traffic ops api (all api calls made from the traffic ops ui will be proxied to the api base_url)
+	// set api 'base_url' to the traffic ops url (all api calls made from the traffic ops ui will be proxied to the api base_url)
 	// enter value for api 'key' if you want to append ?API_KEY=value to all api calls. It is suggested to leave blank.
 	api: {
-		base_url: 'http(s)://where-traffic-ops-api-is.com',
+		base_url: 'http(s)://where-traffic-ops-is.com',
 		key: ''
 	},
 	// default files location (this is where the traffic ops html, css and javascript was installed)