-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathphase_impl.h
37 lines (29 loc) · 1.24 KB
/
phase_impl.h
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
#pragma once
#include "envoy/common/time.h"
#include "nighthawk/common/phase.h"
#include "external/envoy/source/common/common/logger.h"
#include "absl/types/optional.h"
namespace Nighthawk {
class PhaseImpl : public Phase, public Envoy::Logger::Loggable<Envoy::Logger::Id::main> {
public:
/**
* @param id Unique identifier of the pase (uniqueness not enforced).
* @param sequencer Sequencer that will be used to execute this phase.
* @param should_measure_latencies Indicates if latencies should be tracked for requests issued
* during execution of this phase.
* @param time_source Time source that will be used to query the clock.
* @param start_time Optional starting time of the phase. Can be used to schedule phases ahead.
*/
PhaseImpl(absl::string_view id, SequencerPtr&& sequencer, bool should_measure_latencies)
: id_(std::string(id)), sequencer_(std::move(sequencer)),
should_measure_latencies_(should_measure_latencies) {}
absl::string_view id() const override;
Sequencer& sequencer() const override;
void run() const override;
bool shouldMeasureLatencies() const override;
private:
const std::string id_;
const SequencerPtr sequencer_;
const bool should_measure_latencies_;
};
} // namespace Nighthawk