9 #ifndef CPPBENCHMARK_SETTINGS_H
10 #define CPPBENCHMARK_SETTINGS_H
53 int attempts() const noexcept {
return _attempts; }
55 bool infinite() const noexcept {
return _infinite; }
57 int64_t
duration() const noexcept {
return _duration; }
59 int64_t
operations() const noexcept {
return _operations; }
61 const std::vector<int>&
threads() const noexcept {
return _threads; }
63 const std::vector<std::tuple<int, int>>&
pc() const noexcept {
return _pc; }
65 const std::vector<std::tuple<int, int, int>>&
params() const noexcept {
return _params; }
67 const std::tuple<int64_t, int64_t, int>&
latency() const noexcept {
return _latency_params; }
144 Settings&
PCRange(
int producers_from,
int producers_to,
int consumers_from,
int consumers_to);
160 Settings&
PCRange(
int producers_from,
int producers_to,
const std::function<
int (
int,
int,
int&)>& producers_selector,
161 int consumers_from,
int consumers_to,
const std::function<
int (
int,
int,
int&)>& consumers_selector);
189 Settings&
ParamRange(
int from,
int to,
const std::function<
int (
int,
int,
int&)>& selector);
224 Settings&
PairRange(
int from1,
int to1,
const std::function<
int (
int,
int,
int&)>& selector1,
225 int from2,
int to2,
const std::function<
int (
int,
int,
int&)>& selector2);
267 Settings&
TripleRange(
int from1,
int to1,
const std::function<
int (
int,
int,
int&)>& selector1,
268 int from2,
int to2,
const std::function<
int (
int,
int,
int&)>& selector2,
269 int from3,
int to3,
const std::function<
int (
int,
int,
int&)>& selector3);
279 Settings&
Latency(int64_t lowest, int64_t highest,
int significant,
bool automatic =
true);
286 std::vector<int> _threads;
287 std::vector<std::tuple<int, int>> _pc;
288 std::vector<std::tuple<int, int, int>> _params;
289 std::tuple<int64_t, int64_t, int> _latency_params;
Producers/Consumers benchmark base class.
Threads benchmark base class.
const std::vector< std::tuple< int, int, int > > & params() const noexcept
Get collection of independent parameters in a benchmark plan.
Settings & ParamRange(int from, int to)
Add new single parameter range to the benchmark running plan.
Settings & Attempts(int attempts)
Set independent benchmark attempts.
Settings & ThreadsRange(int from, int to)
Add new threads range to the benchmark running plan.
Settings & Threads(int threads)
Add new threads count to the benchmark running plan.
Settings & Triple(int value1, int value2, int value3)
Add new parameters triple to the benchmark running plan.
Settings & PC(int producers, int consumers)
Add new producers/consumers count to the benchmark running plan.
int attempts() const noexcept
Get count of independent benchmark attempts.
Settings & Infinite()
Set infinite benchmark operations flag.
int64_t duration() const noexcept
Get benchmark duration in milliseconds.
bool infinite() const noexcept
Is benchmark running with infinite count of operations (until cancel)?
Settings & Operations(int64_t operations)
Set count of operations.
Settings & PairRange(int from1, int to1, int from2, int to2)
Add new parameters pairs range to the benchmark running plan.
Settings(const Settings &)=default
const std::tuple< int64_t, int64_t, int > & latency() const noexcept
Get latency parameters.
Settings & Latency(int64_t lowest, int64_t highest, int significant, bool automatic=true)
Set latency histogram parameters.
Settings & TripleRange(int from1, int to1, int from2, int to2, int from3, int to3)
Add new parameters triple range to the benchmark running plan.
int64_t operations() const noexcept
Get count of operations.
Settings & PCRange(int producers_from, int producers_to, int consumers_from, int consumers_to)
Add new producers/consumers range to the benchmark running plan.
Settings(Settings &&) noexcept=default
const std::vector< std::tuple< int, int > > & pc() const noexcept
Get collection of independent producers/consumers counts in a benchmark plan.
Settings & Duration(int64_t duration)
Set benchmark duration in seconds.
Settings & Pair(int value1, int value2)
Add new parameters pair to the benchmark running plan.
Settings()
Initialize settings with the default benchmark duration (5 seconds)
Settings & Param(int value)
Add new single parameter to the benchmark running plan.
bool latency_auto() const noexcept
Get automatic latency update flag.
const std::vector< int > & threads() const noexcept
Get collection of independent threads counts in a benchmark plan.
C++ Benchmark project definitions.