17 #ifndef FOXXLL_IO_IOSTATS_HEADER 18 #define FOXXLL_IO_IOSTATS_HEADER 79 : file_stats_(*file_stats), is_write_(is_write)
121 : file_stats_(*file_stats)
157 : file_stats_(*file_stats)
242 void read_started(
const size_t size_,
double now = 0.0);
261 : device_id_(
std::numeric_limits<unsigned>::
max()),
262 read_count_(0), write_count_(0),
263 read_bytes_(0), write_bytes_(0),
264 read_time_(0.0), write_time_(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 415 std::vector<file_stats_data> deepcopy_file_stats_data_list()
const;
419 return creation_time_;
424 file_stats * create_file_stats(
unsigned device_id);
441 return t_wait_write_;
471 void p_write_started(
double now);
472 void p_write_finished(
double now);
473 void p_read_started(
double now);
474 void p_read_finished(
double now);
481 #ifdef FOXXLL_DO_NOT_COUNT_WAIT_TIME 501 template <
typename T,
typename Functor>
502 T fetch_sum(
const Functor& get_value)
const;
505 template <
typename T>
512 template <
typename Functor>
513 summary(
const std::vector<file_stats_data>& fs,
514 const Functor& get_value);
519 : p_reads_(0.0), p_writes_(0.0),
522 t_wait_read_(0.0), t_wait_write_(0.0),
527 : p_reads_(s.get_pread_time()),
528 p_writes_(s.get_pwrite_time()),
529 p_ios_(s.get_pio_time()),
530 t_wait(s.get_io_wait_time()),
531 t_wait_read_(s.get_wait_read_time()),
532 t_wait_write_(s.get_wait_write_time()),
533 elapsed_(
timestamp() - s.get_creation_time()),
534 file_stats_data_list_(s.deepcopy_file_stats_data_list())
541 size_t num_files()
const;
595 double get_pread_time()
const;
599 double get_pwrite_time()
const;
603 double get_pio_time()
const;
627 double get_io_wait_time()
const;
629 double get_wait_read_time()
const;
631 double get_wait_write_time()
const;
633 void to_ostream(std::ostream& o,
const std::string line_prefix =
"")
const;
689 report_on_destruction_(true)
714 report_on_destruction_ =
false;
721 if (report_on_destruction_)
730 #endif // !FOXXLL_IO_IOSTATS_HEADER
unsigned get_device_id() const
double get_elapsed_time() const
double get_pwrite_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_pread_time() const
external_size_type write_bytes_
int acc_reads_
number of requests, participating in parallel operation
std::ostream & operator<<(std::ostream &o, const stats &s)
void start(size_type size)
void to_ostream(std::ostream &o, const std::string line_prefix="") const
external_size_type write_bytes_
double p_begin_wait_write_
uint64_t bytes_
bytes processed
double get_write_time() const
double p_begin_read_
start time of parallel operation
void write_started(const size_t size_, double now=0.0)
unsigned get_write_count() const
unsigned get_read_count() const
void read_op_finished(const size_t size_, double duration)
void start(size_type size)
~scoped_read_write_timer()
const unsigned device_id_
associated device id
void write_canceled(const size_t size_)
const foxxll::stats_data & initial_stats() const
stats at initialization
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 get_wait_read_time() const
static double timestamp()
Returns number of seconds since the epoch, high resolution.
void wait_started(wait_op_type wait_op_)
~scoped_print_iostats()
on destruction: report stats
static std::string add_SI_multiplier(external_size_type number, const std::string &unit="")
double get_read_time() const
external_size_type get_read_bytes() const
unsigned get_device_id() 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="")
unsigned get_write_count() const
scoped_wait_timer(wait_op_type wait_op, bool measure_time=true)
void read_started(const size_t size_, double now=0.0)
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_
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
void final_report()
Same as report() but disables reporting on destruction.
void start(size_type size)
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
scoped_print_iostats(const std::string &message, uint64_t bytes=0)
static const size_t bytes
number of bytes in uint_pair
double get_wait_write_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_
external_size_type get_write_bytes() const
scoped_write_timer(file_stats *file_stats, size_type size)
static uint_pair min()
return an uint_pair instance containing the smallest value possible
double get_read_time() const
unsigned read_count_
number of operations: read/write
double get_write_time() const
double p_begin_wait_read_
external_size_type get_read_bytes() const
void read_canceled(const size_t size_)
scoped_print_iostats(uint64_t bytes=0)
void wait_finished(wait_op_type wait_op_)
bool report_on_destruction_
report on destruction
double get_io_wait_time() const
unsigned get_read_count() const
void write_op_finished(const size_t size_, double duration)
double get_creation_time() const
external_size_type get_write_bytes() const
double read_time_
seconds spent in operations
Simple scoped iostats reporter which takes a message and reports the relative IO performance on destr...
std::string format_iec_units(uint64_t number, int precision=3)
Format number as something like 1 TiB.
stats_data(const stats &s)
uint64_t external_size_type
std::string message_
message
double get_pio_time() const