diff options
author | Zach Koopmans <zkoopmans@google.com> | 2020-11-10 21:18:57 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-11-10 21:20:52 -0800 |
commit | 792cbc06de41f226f76f55a828dfcfad9b8fb16e (patch) | |
tree | 64b37ecff27afb83ad0b0533085308ea0c3239bb /test/benchmarks/base/startup_test.go | |
parent | 7f2183df9c529790cd99d31a185ae4ddd5f355c6 (diff) |
Add debug logs to startup benchmark.
PiperOrigin-RevId: 341757694
Diffstat (limited to 'test/benchmarks/base/startup_test.go')
-rw-r--r-- | test/benchmarks/base/startup_test.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/benchmarks/base/startup_test.go b/test/benchmarks/base/startup_test.go index 28731f97a..8ef9f99c4 100644 --- a/test/benchmarks/base/startup_test.go +++ b/test/benchmarks/base/startup_test.go @@ -37,6 +37,7 @@ func BenchmarkStartupEmpty(b *testing.B) { ctx := context.Background() for i := 0; i < b.N; i++ { + harness.DebugLog(b, "Running container: %d", i) container := machine.GetContainer(ctx, b) defer container.CleanUp(ctx) if _, err := container.Run(ctx, dockerutil.RunOpts{ @@ -44,6 +45,7 @@ func BenchmarkStartupEmpty(b *testing.B) { }, "true"); err != nil { b.Fatalf("failed to run container: %v", err) } + harness.DebugLog(b, "Ran container: %d", i) } } @@ -104,6 +106,7 @@ func BenchmarkStartupNode(b *testing.B) { func runServerWorkload(ctx context.Context, b *testing.B, args base.ServerArgs) { b.ResetTimer() for i := 0; i < b.N; i++ { + harness.DebugLog(b, "Running iteration: %d", i) if err := func() error { server := args.Machine.GetContainer(ctx, b) defer func() { @@ -112,15 +115,18 @@ func runServerWorkload(ctx context.Context, b *testing.B, args base.ServerArgs) server.CleanUp(ctx) b.StartTimer() }() + harness.DebugLog(b, "Spawning container: %s", args.RunOpts.Image) if err := server.Spawn(ctx, args.RunOpts, args.Cmd...); err != nil { return fmt.Errorf("failed to spawn node instance: %v", err) } + harness.DebugLog(b, "Finding Container IP") servingIP, err := server.FindIP(ctx, false) if err != nil { return fmt.Errorf("failed to get ip from server: %v", err) } + harness.DebugLog(b, "Waiting for container to start.") // Wait until the Client sees the server as up. if err := harness.WaitUntilServing(ctx, args.Machine, servingIP, args.Port); err != nil { return fmt.Errorf("failed to wait for serving: %v", err) @@ -129,6 +135,7 @@ func runServerWorkload(ctx context.Context, b *testing.B, args base.ServerArgs) }(); err != nil { b.Fatal(err) } + harness.DebugLog(b, "Ran iteration: %d", i) } } |