diff options
Diffstat (limited to 'vespalib/src/tests/benchmark/benchmark.cpp')
-rw-r--r-- | vespalib/src/tests/benchmark/benchmark.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/vespalib/src/tests/benchmark/benchmark.cpp b/vespalib/src/tests/benchmark/benchmark.cpp new file mode 100644 index 00000000000..f1e69758c8c --- /dev/null +++ b/vespalib/src/tests/benchmark/benchmark.cpp @@ -0,0 +1,30 @@ +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include <vespa/vespalib/testkit/testapp.h> +#include "testbase.h" + +#include <vespa/log/log.h> +LOG_SETUP("benchmark_test"); + +using namespace vespalib; + +TEST_SETUP(Test) + +int +Test::Main() +{ + TEST_INIT("benchmark_test"); + + if (_argc > 1) { + size_t concurrency(1); + size_t numRuns(1000); + if (_argc > 2) { + numRuns = strtoul(_argv[2], NULL, 0); + if (_argc > 3) { + concurrency = strtoul(_argv[3], NULL, 0); + } + } + Benchmark::run(_argv[1], numRuns, concurrency); + } + + TEST_DONE(); +} |