Skip to content

Commit

Permalink
Adjust defaults and reporting for serve_hostnames
Browse files Browse the repository at this point in the history
  • Loading branch information
satnam6502 committed Apr 2, 2015
1 parent b21db4b commit 1c2a903
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions test/soak/serve_hostnames/serve_hostnames.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (
)

var (
queriesAverage = flag.Int("queries", 20, "Number of hostname queries to make in each iteration per pod on average")
queriesAverage = flag.Int("queries", 100, "Number of hostname queries to make in each iteration per pod on average")
podsPerNode = flag.Int("pods_per_node", 1, "Number of serve_hostname pods per node")
upTo = flag.Int("up_to", 1, "Number of iterations or -1 for no limit")
maxPar = flag.Int("max_par", 500, "Maximum number of queries in flight")
Expand Down Expand Up @@ -264,7 +264,7 @@ func main() {
inFlight := make(chan struct{}, *maxPar)
start := time.Now()
for q := 0; q < queries; q++ {
go func() {
go func(i int, query int) {
inFlight <- struct{}{}
t := time.Now()
hostname, err := c.Get().
Expand All @@ -274,8 +274,6 @@ func main() {
Name("serve-hostnames").
DoRaw()
glog.V(4).Infof("Proxy call in namespace %s took %v", ns, time.Since(t))
i := iteration
query := q
if err != nil {
glog.Warningf("Call failed during iteration %d query %d : %v", i, query, err)
// If the query failed return a string which starts with a character
Expand All @@ -285,7 +283,7 @@ func main() {
responseChan <- string(hostname)
}
<-inFlight
}()
}(iteration, q)
}
responses := make(map[string]int, *podsPerNode*len(nodes.Items))
missing := 0
Expand All @@ -312,6 +310,7 @@ func main() {
}
}
}
glog.Infof("Iteration %d took %v for %d queries (%.2f QPS)", iteration, time.Since(start), queries, float64(queries)/time.Since(start).Seconds())
glog.Infof("Iteration %d took %v for %d queries (%.2f QPS) with %d missing",
iteration, time.Since(start), queries-missing, float64(queries-missing)/time.Since(start).Seconds(), missing)
}
}

0 comments on commit 1c2a903

Please sign in to comment.