aboutsummaryrefslogtreecommitdiffstats
path: root/vbench/src/vbench/vbench/vbench.h
blob: 0b304da96a0873b002d7c506d23275d322fb376d (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "analyzer.h"
#include "generator.h"
#include "latency_analyzer.h"
#include "native_factory.h"
#include "qps_analyzer.h"
#include "qps_tagger.h"
#include "request_generator.h"
#include "request_scheduler.h"
#include "request_sink.h"
#include "server_tagger.h"
#include "tagger.h"
#include <vbench/core/taintable.h>
#include <vespa/vespalib/data/slime/slime.h>

namespace vbench {

class VBench : public vespalib::Runnable,
               public Taintable
{
private:
    struct InputChain {
        using UP = std::unique_ptr<InputChain>;
        std::vector<Tagger::UP>           taggers;
        Generator::UP                     generator;
        std::thread                       thread;
    };
    NativeFactory                _factory;
    std::vector<Analyzer::UP>    _analyzers;
    RequestScheduler::UP         _scheduler;
    std::vector<InputChain::UP>  _inputs;
    Taint                        _taint;

public:
    VBench(const vespalib::Slime &cfg);
    ~VBench();
    void abort();
    void run() override;
    const Taint &tainted() const override { return _taint; }
};

} // namespace vbench