Skip to content

Commit

Permalink
even better timing
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaley committed Sep 28, 2016
1 parent ab0ea85 commit f8cef86
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rackhd/proxy/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (p *Server) HandleNodes(w http.ResponseWriter, r *http.Request) {
ar := p.GetResp(r, addrMap)
p.RespCheck(r, w, ar)
elapsed := time.Since(start)
fmt.Println(elapsed)
fmt.Printf("Total Time => %v\n\n", elapsed)
}

// GetResp makes channels for the response and errors from http.Get.
Expand All @@ -97,7 +97,10 @@ func (p *Server) GetResp(r *http.Request, addrs map[string]struct{}) Responses {
return
}
client := cleanhttp.DefaultClient()
start := time.Now()
respGet, err := client.Do(req)
elapsed := time.Since(start)
fmt.Printf("%v => %s\n\n", elapsed, entry)
// fmt.Printf("Request Sent => %s\n", time.Now())
if err != nil {
cr <- NewResponseFromError(err)
Expand Down

0 comments on commit f8cef86

Please sign in to comment.