summaryrefslogtreecommitdiffstats
path: root/vbench/src/vbench/vbench/qps_tagger.h
blob: 492ae324dc098f27bf4731533cd2a046d2cacb71 (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 2016 Yahoo Inc. 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