51 p_begin_wait_read(0.0),
54 p_begin_wait_write(0.0),
55 acc_reads(0), acc_writes(0),
58 acc_wait_read(0), acc_wait_write(0),
62 #ifndef STXXL_IO_STATS_RESET_FORBIDDEN
71 " read(s) not yet finished");
86 " write(s) not yet finished");
101 " io(s) not yet finished");
111 " wait(s) not yet finished");
251 #ifndef STXXL_DO_NOT_COUNT_WAIT_TIME
266 p_begin_wait_read = now;
273 p_begin_wait_write = now;
293 p_begin_wait_read = now;
299 p_begin_wait_write = now;
302 #ifdef STXXL_WAIT_LOG_ENABLED
316 #ifndef STXXL_DO_NOT_COUNT_WAIT_TIME
323 " wait(s) not yet finished");
334 static const char* endings[] = {
"",
"k",
"M",
"G",
"T",
"P",
"E" };
335 static const char* binary_endings[] = {
"",
"Ki",
"Mi",
"Gi",
"Ti",
"Pi",
"Ei" };
336 std::ostringstream out;
337 out << number <<
' ';
339 double number_d = (double)number;
340 double multiplier_d = multiplier;
341 while (number_d >= multiplier_d)
343 number_d /= multiplier_d;
347 out <<
'(' << std::fixed << std::setprecision(3) << number_d <<
' '
348 << (multiplier == 1024 ? binary_endings[scale] : endings[scale])
349 << (unit ? unit :
"") <<
") ";
350 else if (unit && *unit)
357 #define hr add_IEC_binary_multiplier
358 o <<
"STXXL I/O statistics" << std::endl;
360 o <<
" total number of reads : " <<
hr(s.
get_reads()) << std::endl;
361 o <<
" average block size (read) : "
363 o <<
" number of bytes read from disks : " <<
hr(s.
get_read_volume(),
"B") << std::endl;
364 o <<
" time spent in serving all read requests : " << s.
get_read_time() <<
" s"
367 o <<
" time spent in reading (parallel read time) : " << s.
get_pread_time() <<
" s"
380 o <<
" total number of writes : " <<
hr(s.
get_writes()) << std::endl;
381 o <<
" average block size (write) : "
384 o <<
" time spent in serving all write requests : " << s.
get_write_time() <<
" s"
387 o <<
" time spent in writing (parallel write time): " << s.
get_pwrite_time() <<
" s"
390 o <<
" time spent in I/O (parallel I/O time) : " << s.
get_pio_time() <<
" s"
394 o <<
" n/a" << std::endl;
396 #ifndef STXXL_DO_NOT_COUNT_WAIT_TIME
403 o <<
" Time since the last reset : " << s.
get_elapsed_time() <<
" s" << std::endl;
int64 get_written_volume() const
void wait_finished(wait_op_type wait_op)
double get_pio_time() const
int64 get_cached_read_volume() const
unsigned get_reads() const
unsigned long long int uint64
std::string format_with_SI_IEC_unit_multiplier(uint64 number, const char *unit="", int multiplier=1000)
double get_wait_read_time() const
void _reset_io_wait_time()
Resets I/O wait time counter.
unsigned get_cached_writes() const
void reset()
Resets I/O time counters (including I/O wait counter).
double get_wait_write_time() const
double get_io_wait_time() const
double get_write_time() const
static instance_pointer get_instance()
Aquire a lock that's valid until the end of scope.
#define STXXL_BEGIN_NAMESPACE
void read_canceled(unsigned_type size_)
double p_begin_wait_write
unsigned get_writes() const
unsigned get_cached_reads() const
double get_read_time() const
double get_pwrite_time() const
choose_int_types< my_pointer_size >::unsigned_type unsigned_type
double timestamp()
Returns number of seconds since the epoch, high resolution.
void read_started(unsigned_type size_, double now=0.0)
int64 get_cached_written_volume() const
void write_cached(unsigned_type size_)
int64 get_read_volume() const
void read_cached(unsigned_type size_)
double get_elapsed_time() const
void write_canceled(unsigned_type size_)
std::ostream & operator<<(std::ostream &o, const matrix_operation_statistic_data &statsd)
double get_pread_time() const
#define STXXL_END_NAMESPACE
void wait_started(wait_op_type wait_op)
void write_started(unsigned_type size_, double now=0.0)