From 486473ece3db0e5c13cf888c45df0fcde7563200 Mon Sep 17 00:00:00 2001 From: Vicente Zepeda Mas Date: Mon, 10 Jul 2023 16:55:40 +0200 Subject: [PATCH] Fixes missing metrics, adds bucketed count Signed-off-by: Vicente Zepeda Mas --- pkg/tests/run.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/tests/run.go b/pkg/tests/run.go index ab50b48..dc76722 100644 --- a/pkg/tests/run.go +++ b/pkg/tests/run.go @@ -74,7 +74,13 @@ func (r *Runner) Run(ctx context.Context) error { var metrics vegeta.Metrics metrics.Histogram = &vegeta.Histogram{ - Buckets: vegeta.Buckets{time.Millisecond}, + Buckets: vegeta.Buckets{0 * time.Millisecond, + 50 * time.Millisecond, + 100 * time.Millisecond, + 300 * time.Millisecond, + 500 * time.Millisecond, + 1000 * time.Millisecond, + 5000 * time.Millisecond}, } // Bind "Test Harness" @@ -141,17 +147,15 @@ func (r *Runner) Run(ctx context.Context) error { } } } + testOptions.Metrics.Close() // Index result file - serverVersion := helpers.GetServerVersion(ctx, conn) r.logger.Info(ctx, "server version %s", serverVersion) err = elastic.IndexFile(ctx, r.testID, serverVersion, testOptions.TestName, fileName, *testOptions.Metrics, r.logger) if err != nil { r.logger.Error(ctx, "%s", err) } - - testOptions.Metrics.Close() wg.Done() return nil }(ctx, concurrentConnections, i, conn, t)