17 #ifndef FOXXLL_IO_IOSTATS_HEADER
18 #define FOXXLL_IO_IOSTATS_HEADER
242 void read_started(
const size_t size_,
double now = 0.0);
372 #ifndef FOXXLL_DO_NOT_COUNT_WAIT_TIME
379 #ifndef FOXXLL_DO_NOT_COUNT_WAIT_TIME
394 #ifndef FOXXLL_DO_NOT_COUNT_WAIT_TIME
404 #ifndef FOXXLL_DO_NOT_COUNT_WAIT_TIME
481 #ifdef FOXXLL_DO_NOT_COUNT_WAIT_TIME
501 template <
typename T,
typename Functor>
505 template <
typename T>
512 template <
typename Functor>
513 summary(
const std::vector<file_stats_data>& fs,
514 const Functor& get_value);
730 #endif // !FOXXLL_IO_IOSTATS_HEADER
unsigned get_read_count() const
double get_write_time() const
double get_pread_time() const
static uint_pair max()
return an uint_pair instance containing the largest value possible
scoped_read_timer(file_stats *file_stats, size_type size)
double get_wait_read_time() const
external_size_type write_bytes_
file_stats_data operator+(const file_stats_data &a) const
int acc_reads_
number of requests, participating in parallel operation
void start(size_type size)
external_size_type write_bytes_
double p_begin_wait_write_
uint64_t bytes_
bytes processed
void p_read_finished(double now)
unsigned read_count_
number of operations
double p_begin_read_
start time of parallel operation
void write_started(const size_t size_, double now=0.0)
double get_pwrite_time() const
std::vector< file_stats_data > deepcopy_file_stats_data_list() const
return list of file's stats data (deeply copied from each file_stats)
summary(const std::vector< file_stats_data > &fs, const Functor &get_value)
T fetch_sum(const Functor &get_value) const
aggregator
void report() const
print out relative stats via LOG
void read_op_finished(const size_t size_, double duration)
unsigned get_read_count() const
void start(size_type size)
void p_write_finished(double now)
~scoped_read_write_timer()
const unsigned device_id_
associated device id
void write_canceled(const size_t size_)
external_size_type get_write_bytes() const
external_size_type get_write_bytes() const
foxxll::stats_data begin_
initial io-stats
std::string format_si_units(uint64_t number, int precision)
Format number as something like 1 TB.
double p_reads_
seconds spent in parallel io
static double timestamp()
Returns number of seconds since the epoch, high resolution.
void p_read_started(double now)
unsigned get_write_count() const
double get_read_time() const
void wait_started(wait_op_type wait_op_)
external_size_type get_read_bytes() const
friend std::ostream & operator<<(std::ostream &o, const stats &s)
const foxxll::stats_data & initial_stats() const
stats at initialization
double read_time_
seconds spent in operations
~scoped_print_iostats()
on destruction: report stats
void to_ostream(std::ostream &o, const std::string line_prefix="") const
static std::string add_SI_multiplier(external_size_type number, const std::string &unit="")
external_size_type get_read_bytes() const
file_stats(unsigned int device_id)
construct zero initialized
double t_wait
seconds spent waiting for completion of I/O operations
static std::string add_IEC_binary_multiplier(const external_size_type number, const std::string &unit="")
double p_begin_read_
start time of parallel operation
scoped_wait_timer(wait_op_type wait_op, bool measure_time=true)
void read_started(const size_t size_, double now=0.0)
double get_wait_write_time() const
unsigned device_id_
device id
std::vector< file_stats_data > file_stats_data_list_
list of individual file statistics.
std::list< file_stats > file_stats_list_
stats_data operator+(const stats_data &a) const
scoped_print_iostats(const std::string &message, const std::string key, uint64_t bytes)
Start time and configure report-style.
std::basic_string< char, std::char_traits< char >, Allocator< char > > string
string with Manager tracking
stats_data operator-(const stats_data &a) const
void p_write_started(double now)
void final_report()
Same as report() but disables reporting on destruction.
void start(size_type size)
double get_io_wait_time() const
static instance_pointer get_instance()
return instance or create base instance if empty
file_stats_data(const file_stats &fs)
construct file_stats_data by taking current values from file_stats
std::vector< std::pair< T, unsigned > > values_per_device
unsigned get_device_id() const
scoped_print_iostats(const std::string &message, uint64_t bytes=0)
stats_data::summary< double > get_pread_speed_summary() const
external_size_type get_read_bytes() const
static const size_t bytes
number of bytes in uint_pair
double get_elapsed_time() const
scoped_read_write_timer(file_stats *file_stats, size_type size, bool is_write=false)
external_size_type read_bytes_
number of bytes read/written
const double creation_time_
scoped_write_timer(file_stats *file_stats, size_type size)
double get_pwrite_time() const
unsigned read_count_
number of operations: read/write
double p_reads_
seconds spent in parallel operations
stats_data::summary< double > get_write_time_summary() const
double get_io_wait_time() const
stats_data::summary< double > get_read_speed_summary() const
unsigned get_read_count() const
double p_begin_wait_read_
stats_data::summary< double > get_write_speed_summary() const
unsigned get_write_count() const
size_t num_files() const
Returns the number of file_stats_data objects.
void read_canceled(const size_t size_)
scoped_print_iostats(uint64_t bytes=0)
void wait_finished(wait_op_type wait_op_)
stats()
private construction from singleton
bool report_on_destruction_
report on destruction
stats_data::summary< double > get_pio_speed_summary() const
double get_pio_time() const
stats_data::summary< external_size_type > get_write_bytes_summary() const
double get_pread_time() const
double get_wait_write_time() const
double get_write_time() const
file_stats_data operator-(const file_stats_data &a) const
void write_op_finished(const size_t size_, double duration)
stats_data::summary< double > get_read_time_summary() const
double get_write_time() const
double get_read_time() const
unsigned get_write_count() const
external_size_type read_bytes_
number of bytes read/written
stats_data::summary< external_size_type > get_read_bytes_summary() const
unsigned get_device_id() const
double read_time_
seconds spent in operations
Simple scoped iostats reporter which takes a message and reports the relative IO performance on destr...
double get_pio_time() const
std::string format_iec_units(uint64_t number, int precision=3)
Format number as something like 1 TiB.
stats_data::summary< double > get_pwrite_speed_summary() const
double get_read_time() const
double get_creation_time() const
stats_data(const stats &s)
stats_data::summary< unsigned > get_write_count_summary() const
uint64_t external_size_type
std::string message_
message
double get_wait_read_time() const
stats_data::summary< unsigned > get_read_count_summary() const
external_size_type get_write_bytes() const
file_stats * create_file_stats(unsigned device_id)
friend std::ostream & operator<<(std::ostream &o, const stats_data &s)