You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by ne...@apache.org on 2016/12/08 18:46:19 UTC

[17/20] incubator-trafficcontrol git commit: Remove TM2 debug prints

Remove TM2 debug prints


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

Branch: refs/heads/master
Commit: 0511308333898a6f254aab885ae26a7551d4a994
Parents: e279d16
Author: Robert Butts <ro...@gmail.com>
Authored: Thu Dec 8 09:59:22 2016 -0700
Committer: Dave Neuman <ne...@apache.org>
Committed: Thu Dec 8 11:44:33 2016 -0700

----------------------------------------------------------------------
 .../experimental/common/poller/heap.go           |  6 ------
 .../experimental/common/poller/poller.go         | 19 -------------------
 2 files changed, 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/05113083/traffic_monitor/experimental/common/poller/heap.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/common/poller/heap.go b/traffic_monitor/experimental/common/poller/heap.go
index b0152b3..c78a64e 100644
--- a/traffic_monitor/experimental/common/poller/heap.go
+++ b/traffic_monitor/experimental/common/poller/heap.go
@@ -95,9 +95,6 @@ func (h *Heap) Pop() (HeapPollInfo, bool) {
 	h.info[0] = h.info[len(h.info)-1]
 	h.info = h.info[:len(h.info)-1]
 	h.heapify(0)
-	if max.Info.ID == "odol-atsec-jac-04" {
-		fmt.Printf("httpPoll %v Heap.Pop id %v next %v\n", h.PollerID, max.Info.ID, max.Next)
-	}
 	return max, true
 }
 
@@ -105,9 +102,6 @@ func (h *Heap) Pop() (HeapPollInfo, bool) {
 func (h *Heap) Push(key HeapPollInfo) {
 	h.m.Lock()
 	defer h.m.Unlock()
-	if key.Info.ID == "odol-atsec-jac-04" {
-		fmt.Printf("httpPoll %v Heap.Push id %v next %v\n", h.PollerID, key.Info.ID, key.Next)
-	}
 	h.info = append(h.info, HeapPollInfo{Next: time.Unix(1<<63-1, 0)})
 	h.increaseKey(len(h.info)-1, key)
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/05113083/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 68d15ce..ea70eb0 100644
--- a/traffic_monitor/experimental/common/poller/poller.go
+++ b/traffic_monitor/experimental/common/poller/poller.go
@@ -244,14 +244,12 @@ func (p HttpPoller) InsomniacPoll() {
 			continue
 		}
 
-		fmt.Printf("HttpPoller.InsomniacPoll got newCfg\n")
 		if pollRunning {
 			killChan <- struct{}{}
 		}
 		pollRunning = true
 
 		polls := []HTTPPollInfo{}
-		fmt.Printf("HttpPoller.InsomniacPoll creating polls\n")
 		for id, pollCfg := range newCfg.Urls {
 			polls = append(polls, HTTPPollInfo{
 				Interval: newCfg.Interval,
@@ -260,7 +258,6 @@ func (p HttpPoller) InsomniacPoll() {
 				Timeout:  pollCfg.Timeout,
 			})
 		}
-		fmt.Printf("HttpPoller.InsomniacPoll created polls, going httpPoll\n")
 		go insomniacPoller(pollerId, polls, p.FetcherTemplate, killChan)
 		p.Config = newCfg
 	}
@@ -268,11 +265,9 @@ func (p HttpPoller) InsomniacPoll() {
 
 func insomniacPoller(pollerId int64, polls []HTTPPollInfo, fetcherTemplate fetcher.HttpFetcher, die <-chan struct{}) {
 	runtime.LockOSThread()
-	fmt.Printf("httpPoll %v called\n", pollerId)
 	heap := Heap{PollerID: pollerId}
 	start := time.Now()
 	fetchers := map[string]fetcher.Fetcher{}
-	fmt.Printf("httpPoll %v adding to heap\n", pollerId)
 	for _, p := range polls {
 		spread := time.Duration(rand.Float64()*float64(p.Interval/time.Nanosecond)) * time.Nanosecond
 		heap.Push(HeapPollInfo{Info: p, Next: start.Add(spread)})
@@ -285,7 +280,6 @@ func insomniacPoller(pollerId int64, polls []HTTPPollInfo, fetcherTemplate fetch
 		}
 		fetchers[p.ID] = fetcher
 	}
-	fmt.Printf("httpPoll %v added to heap\n", pollerId)
 
 	timeMax := func(a time.Time, b time.Time) time.Time {
 		if a.After(b) {
@@ -304,16 +298,11 @@ func insomniacPoller(pollerId int64, polls []HTTPPollInfo, fetcherTemplate fetch
 		<-pollFinishedChan
 		now := time.Now()
 		p.Next = timeMax(start.Add(p.Info.Interval), now)
-		if p.Info.ID == "odol-atsec-jac-04" {
-			fmt.Printf("httpPoll %v heaping id %v next %v start %v interval %v now %v add %v\n", pollerId, p.Info.ID, p.Next, start, p.Info.Interval, now, start.Add(p.Info.Interval))
-		}
 		heap.Push(p)
 	}
 
-	fmt.Printf("httpPoll %v starting main loop\n", pollerId)
 	for {
 		if mustDie(die) {
-			fmt.Printf("httpPoll %v dying\n", pollerId)
 			return
 		}
 		p, ok := heap.Pop()
@@ -321,15 +310,7 @@ func insomniacPoller(pollerId int64, polls []HTTPPollInfo, fetcherTemplate fetch
 			ThreadSleep(0)
 			continue
 		}
-		if p.Info.ID == "odol-atsec-jac-04" {
-			fmt.Printf("httpPoll %v popped id %v p.Next %v now %v\n", pollerId, p.Info.ID, p.Next, time.Now())
-		}
-
 		ThreadSleep(p.Next.Sub(time.Now()))
-
-		if p.Info.ID == "odol-atsec-jac-04" {
-			fmt.Printf("httpPoll %v polling %v next %v now %v\n", pollerId, p.Info.ID, p.Next, time.Now())
-		}
 		go poll(p)
 	}
 }