summaryrefslogtreecommitdiffstats
path: root/staging_vespalib/src/tests/benchmark/benchmark.cpp
blob: 7a25fa390639e39295778ab749f1ba912118a684 (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
// Copyright 2016 Yahoo Inc. 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"

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();
}