From caee69321550fd6996446d2c99f2443162108e8e Mon Sep 17 00:00:00 2001 From: Ryan Uber Date: Sat, 26 Sep 2015 10:50:21 -0700 Subject: [PATCH] demo/digitalocean: tighten bench output --- demo/digitalocean/app/bench.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/demo/digitalocean/app/bench.go b/demo/digitalocean/app/bench.go index 7d5279e25..e17222af3 100644 --- a/demo/digitalocean/app/bench.go +++ b/demo/digitalocean/app/bench.go @@ -45,7 +45,6 @@ func main() { fh.Close() isRunning := false - start := time.Now() allocClient := client.Allocations() cmd := exec.Command("nomad", "run", fh.Name()) @@ -53,7 +52,9 @@ func main() { fmt.Println("nomad run failed: " + err.Error()) return } + start := time.Now() + last := 0 fmt.Printf("benchmarking %d allocations\n", total) for i := 0; ; i++ { time.Sleep(100 * time.Millisecond) @@ -78,9 +79,10 @@ func main() { } } - if i%10 == 0 || running == total { + if last != running { fmt.Printf("%d running after %s\n", running, now.Sub(start)) } + last = running if running == total { return @@ -103,8 +105,8 @@ job "bench" { } resources { - cpu = 100 - memory = 100 + cpu = 10 + memory = 10 } } }