CCF
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
client::PerfBase< TOptions > Class Template Referenceabstract

#include <perf_client.h>

Inherited by TpccClient, ccf::indexing::LazyStrategy< Base >, ccf::js::WithCommonExtensions< Base >, and ccf::js::WithKVExtension< Base >.

Classes

struct  PreparedTx
 

Public Member Functions

 PerfBase (const TOptions &o)
 
void init_connection ()
 
std::shared_ptr< RpcTlsClientget_connection ()
 
void send_all_creation_transactions ()
 
void prepare_all_transactions ()
 
timing::Results send_all_prepared_transactions ()
 
void wait_for_global_commit (const ccf::TxID &target)
 
void wait_for_global_commit (const RpcTlsClient::Response &response)
 
void begin_timing ()
 
timing::Results end_timing (size_t end_highest_local_commit)
 
void summarize_results (const timing::Results &timing_results)
 
virtual void run ()
 
template<typename T >
rand_range ()
 
template<typename T >
rand_range (T exclusive_upper_bound)
 
template<typename T >
rand_range (T inclusive_lower_bound, T exclusive_upper_bound)
 

Protected Types

using PreparedTxs = std::vector< PreparedTx >
 

Protected Member Functions

std::shared_ptr< RpcTlsClientcreate_connection (bool force_unsigned=false)
 
void add_prepared_ser_tx (const std::string &method, const std::span< const uint8_t > params, bool expects_commit, const std::optional< size_t > &index)
 
virtual void prepare_transactions ()=0
 
virtual std::optional< RpcTlsClient::Responsesend_creation_transactions ()
 
virtual bool check_response (const RpcTlsClient::Response &r)
 
virtual void pre_creation_hook ()
 
virtual void post_creation_hook ()
 
virtual void pre_timing_body_hook ()
 
virtual void post_timing_body_hook ()
 
virtual timing::Results call_raw_batch (std::shared_ptr< RpcTlsClient > &connection, const PreparedTxs &txs)
 
void kick_off_timing ()
 
void write (const PreparedTx &tx, size_t &read, size_t &written, const std::shared_ptr< RpcTlsClient > &connection)
 
void blocking_read (size_t &read, size_t written, const std::shared_ptr< RpcTlsClient > &connection)
 
void reconnect (std::shared_ptr< RpcTlsClient > &connection)
 
RpcTlsClient::Response get_tx_status (const std::shared_ptr< RpcTlsClient > &connection, size_t view, size_t seqno)
 
virtual void verify_params (const nlohmann::json &expected)
 
virtual void verify_initial_state (const nlohmann::json &expected)
 
virtual void verify_final_state (const nlohmann::json &expected)
 

Static Protected Member Functions

static size_t total_byte_size (const PreparedTxs &txs)
 

Protected Attributes

TOptions options
 
std::mt19937 rand_generator
 
nlohmann::json verification_target
 
std::shared_ptr< RpcTlsClientrpc_connection
 
PreparedTxs prepared_txs
 
timing::ResponseTimes response_times
 
ccf::TxID last_response_tx_id = {0, 0}
 
std::chrono::high_resolution_clock::time_point last_write_time
 
std::chrono::nanoseconds write_delay_ns = std::chrono::nanoseconds::zero()
 

Detailed Description

template<typename TOptions>
class client::PerfBase< TOptions >

Base class for perf-testing clients. Provides hooks to set initial state, prepare a batch of transactions, and then measure the latency and throughput of processing those batched transactions

Member Typedef Documentation

◆ PreparedTxs

template<typename TOptions >
using client::PerfBase< TOptions >::PreparedTxs = std::vector<PreparedTx>
protected

Constructor & Destructor Documentation

◆ PerfBase()

template<typename TOptions >
client::PerfBase< TOptions >::PerfBase ( const TOptions &  o)
inline

Member Function Documentation

◆ add_prepared_ser_tx()

template<typename TOptions >
void client::PerfBase< TOptions >::add_prepared_ser_tx ( const std::string &  method,
const std::span< const uint8_t >  params,
bool  expects_commit,
const std::optional< size_t > &  index 
)
inlineprotected

◆ begin_timing()

template<typename TOptions >
void client::PerfBase< TOptions >::begin_timing ( )
inline

◆ blocking_read()

template<typename TOptions >
void client::PerfBase< TOptions >::blocking_read ( size_t &  read,
size_t  written,
const std::shared_ptr< RpcTlsClient > &  connection 
)
inlineprotected

◆ call_raw_batch()

template<typename TOptions >
virtual timing::Results client::PerfBase< TOptions >::call_raw_batch ( std::shared_ptr< RpcTlsClient > &  connection,
const PreparedTxs txs 
)
inlineprotectedvirtual

◆ check_response()

template<typename TOptions >
virtual bool client::PerfBase< TOptions >::check_response ( const RpcTlsClient::Response r)
inlineprotectedvirtual

◆ create_connection()

template<typename TOptions >
std::shared_ptr< RpcTlsClient > client::PerfBase< TOptions >::create_connection ( bool  force_unsigned = false)
inlineprotected

◆ end_timing()

template<typename TOptions >
timing::Results client::PerfBase< TOptions >::end_timing ( size_t  end_highest_local_commit)
inline

◆ get_connection()

template<typename TOptions >
std::shared_ptr< RpcTlsClient > client::PerfBase< TOptions >::get_connection ( )
inline

◆ get_tx_status()

template<typename TOptions >
RpcTlsClient::Response client::PerfBase< TOptions >::get_tx_status ( const std::shared_ptr< RpcTlsClient > &  connection,
size_t  view,
size_t  seqno 
)
inlineprotected

◆ init_connection()

template<typename TOptions >
void client::PerfBase< TOptions >::init_connection ( )
inline

◆ kick_off_timing()

template<typename TOptions >
void client::PerfBase< TOptions >::kick_off_timing ( )
inlineprotected

◆ post_creation_hook()

template<typename TOptions >
virtual void client::PerfBase< TOptions >::post_creation_hook ( )
inlineprotectedvirtual

◆ post_timing_body_hook()

template<typename TOptions >
virtual void client::PerfBase< TOptions >::post_timing_body_hook ( )
inlineprotectedvirtual

◆ pre_creation_hook()

template<typename TOptions >
virtual void client::PerfBase< TOptions >::pre_creation_hook ( )
inlineprotectedvirtual

◆ pre_timing_body_hook()

template<typename TOptions >
virtual void client::PerfBase< TOptions >::pre_timing_body_hook ( )
inlineprotectedvirtual

◆ prepare_all_transactions()

template<typename TOptions >
void client::PerfBase< TOptions >::prepare_all_transactions ( )
inline

◆ prepare_transactions()

template<typename TOptions >
virtual void client::PerfBase< TOptions >::prepare_transactions ( )
protectedpure virtual

◆ rand_range() [1/3]

template<typename TOptions >
template<typename T >
T client::PerfBase< TOptions >::rand_range ( )
inline

◆ rand_range() [2/3]

template<typename TOptions >
template<typename T >
T client::PerfBase< TOptions >::rand_range ( exclusive_upper_bound)
inline

◆ rand_range() [3/3]

template<typename TOptions >
template<typename T >
T client::PerfBase< TOptions >::rand_range ( inclusive_lower_bound,
exclusive_upper_bound 
)
inline

◆ reconnect()

template<typename TOptions >
void client::PerfBase< TOptions >::reconnect ( std::shared_ptr< RpcTlsClient > &  connection)
inlineprotected

◆ run()

template<typename TOptions >
virtual void client::PerfBase< TOptions >::run ( )
inlinevirtual

◆ send_all_creation_transactions()

template<typename TOptions >
void client::PerfBase< TOptions >::send_all_creation_transactions ( )
inline

◆ send_all_prepared_transactions()

template<typename TOptions >
timing::Results client::PerfBase< TOptions >::send_all_prepared_transactions ( )
inline

◆ send_creation_transactions()

template<typename TOptions >
virtual std::optional< RpcTlsClient::Response > client::PerfBase< TOptions >::send_creation_transactions ( )
inlineprotectedvirtual

◆ summarize_results()

template<typename TOptions >
void client::PerfBase< TOptions >::summarize_results ( const timing::Results timing_results)
inline

◆ total_byte_size()

template<typename TOptions >
static size_t client::PerfBase< TOptions >::total_byte_size ( const PreparedTxs txs)
inlinestaticprotected

◆ verify_final_state()

template<typename TOptions >
virtual void client::PerfBase< TOptions >::verify_final_state ( const nlohmann::json &  expected)
inlineprotectedvirtual

◆ verify_initial_state()

template<typename TOptions >
virtual void client::PerfBase< TOptions >::verify_initial_state ( const nlohmann::json &  expected)
inlineprotectedvirtual

◆ verify_params()

template<typename TOptions >
virtual void client::PerfBase< TOptions >::verify_params ( const nlohmann::json &  expected)
inlineprotectedvirtual

◆ wait_for_global_commit() [1/2]

template<typename TOptions >
void client::PerfBase< TOptions >::wait_for_global_commit ( const ccf::TxID target)
inline

◆ wait_for_global_commit() [2/2]

template<typename TOptions >
void client::PerfBase< TOptions >::wait_for_global_commit ( const RpcTlsClient::Response response)
inline

◆ write()

template<typename TOptions >
void client::PerfBase< TOptions >::write ( const PreparedTx tx,
size_t &  read,
size_t &  written,
const std::shared_ptr< RpcTlsClient > &  connection 
)
inlineprotected

Member Data Documentation

◆ last_response_tx_id

template<typename TOptions >
ccf::TxID client::PerfBase< TOptions >::last_response_tx_id = {0, 0}
protected

◆ last_write_time

template<typename TOptions >
std::chrono::high_resolution_clock::time_point client::PerfBase< TOptions >::last_write_time
protected

◆ options

template<typename TOptions >
TOptions client::PerfBase< TOptions >::options
protected

◆ prepared_txs

template<typename TOptions >
PreparedTxs client::PerfBase< TOptions >::prepared_txs
protected

◆ rand_generator

template<typename TOptions >
std::mt19937 client::PerfBase< TOptions >::rand_generator
protected

◆ response_times

template<typename TOptions >
timing::ResponseTimes client::PerfBase< TOptions >::response_times
protected

◆ rpc_connection

template<typename TOptions >
std::shared_ptr<RpcTlsClient> client::PerfBase< TOptions >::rpc_connection
protected

◆ verification_target

template<typename TOptions >
nlohmann::json client::PerfBase< TOptions >::verification_target
protected

◆ write_delay_ns

template<typename TOptions >
std::chrono::nanoseconds client::PerfBase< TOptions >::write_delay_ns = std::chrono::nanoseconds::zero()
protected

The documentation for this class was generated from the following file: