aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/tests/benchmark/benchmark.cpp
blob: f1e69758c8cae358e4681bfb796fb0c68c12d36b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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();
}