LogCabin
Classes | Functions
anonymous_namespace{Benchmark.cc} Namespace Reference

Classes

class  OptionParser
 Parses argv for the main function. More...

Functions

void writeThreadMain (uint64_t id, const OptionParser &options, Tree tree, const std::string &key, const std::string &value, std::atomic< bool > &exit, uint64_t &writesDone)
 The main function for a single client thread.
uint64_t timeNanos ()
 Return the time since the Unix epoch in nanoseconds.
void timerThreadMain (uint64_t timeout, std::atomic< bool > &exit)
 Main function for the timer thread, whose job is to wait until a particular timeout elapses and then set 'exit' to true.

Function Documentation

void anonymous_namespace{Benchmark.cc}::writeThreadMain ( uint64_t  id,
const OptionParser &  options,
Tree  tree,
const std::string &  key,
const std::string &  value,
std::atomic< bool > &  exit,
uint64_t &  writesDone 
)

The main function for a single client thread.

Parameters:
idUnique ID for this thread, counting from 0.
optionsArguments describing benchmark.
treeInterface to LogCabin.
keyKey to write repeatedly.
valueValue to write at key repeatedly.
exitWhen this becomes true, this thread should exit.
[out]writesDoneThe number of writes this thread has completed.

Definition at line 213 of file Benchmark.cc.

uint64_t anonymous_namespace{Benchmark.cc}::timeNanos ( )

Return the time since the Unix epoch in nanoseconds.

Definition at line 236 of file Benchmark.cc.

void anonymous_namespace{Benchmark.cc}::timerThreadMain ( uint64_t  timeout,
std::atomic< bool > &  exit 
)

Main function for the timer thread, whose job is to wait until a particular timeout elapses and then set 'exit' to true.

Parameters:
timeoutSeconds to wait before setting exit to true.
[in,out]exitIf this is set to true from another thread, the timer thread will exit soonish. Also, if the timeout elapses, the timer thread will set this to true and exit.

Definition at line 255 of file Benchmark.cc.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines