CCF
Loading...
Searching...
No Matches
perf_client.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the Apache 2.0 License.
3#pragma once
4
5#include "ds/cli_helper.h"
6
7#include <CLI11/CLI11.hpp>
8#include <chrono>
9#include <fstream>
10
11namespace client
12{
13 constexpr auto perf_summary = "perf_summary.csv";
14
16 {
17 std::string label;
18 std::string pid_file;
19
21
22 size_t max_writes_ahead = 0;
23
25 const std::string& default_label,
26 const std::string& default_pid_file,
27 CLI::App& app) :
28 label(default_label),
29 pid_file(fmt::format("{}.pid", default_pid_file))
30 {
31 // Enable config from file
32 app.set_config("--config");
33
34 app
35 .add_option(
36 "--label",
37 label,
38 fmt::format(
39 "Identifier for this client, written to {}", perf_summary))
40 ->capture_default_str();
41
42 app
43 .add_option(
44 "--pid-file",
46 "Path to which the client PID will be written")
47 ->capture_default_str();
48
49 cli::add_address_option(
50 app,
52 "--rpc-address",
53 "Remote node address to which requests should be sent")
54 ->required(true);
55
56 app
57 .add_option(
58 "--max-writes-ahead",
60 "How many transactions the client should send without waiting for "
61 "responses. 0 will send all transactions before blocking for any "
62 "responses, 1 will minimise latency by serially waiting for each "
63 "transaction's response, other values may provide a balance between "
64 "throughput and latency")
65 ->capture_default_str();
66 }
67 };
68}
ccf::NodeInfoNetwork::NetAddress ParsedAddress
Definition cli_helper.h:18
Definition perf_client.h:12
constexpr auto perf_summary
Definition perf_client.h:13
Definition perf_client.h:16
std::string label
Definition perf_client.h:17
cli::ParsedAddress server_address
Definition perf_client.h:20
std::string pid_file
Definition perf_client.h:18
PerfOptions(const std::string &default_label, const std::string &default_pid_file, CLI::App &app)
Definition perf_client.h:24
size_t max_writes_ahead
Definition perf_client.h:22