aboutsummaryrefslogtreecommitdiffstats
path: root/vbench/src/vbench/vbench/qps_tagger.h
blob: a32229542a4336e673a8fe7954cbcf50eab78490 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "tagger.h"
#include "request.h"

namespace vbench {

/**
 * Sets the start time of requests based on a given qps.
 **/
class QpsTagger : public Tagger
{
private:
    double            _invQps;
    size_t            _count;
    Handler<Request> &_next;

public:
    QpsTagger(double qps, Handler<Request> &next);
    void handle(Request::UP request) override;
};

} // namespace vbench