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;
272 p_begin_wait_write = now;
292 p_begin_wait_read = now;
297 p_begin_wait_write = now;
300 #ifdef STXXL_WAIT_LOG_ENABLED
314 #ifndef STXXL_DO_NOT_COUNT_WAIT_TIME
321 " wait(s) not yet finished");
332 static const char* endings[] = {
"",
"k",
"M",
"G",
"T",
"P",
"E" };
333 static const char* binary_endings[] = {
"",
"Ki",
"Mi",
"Gi",
"Ti",
"Pi",
"Ei" };
334 std::ostringstream out;
335 out << number <<
' ';
337 double number_d = (double)number;
338 double multiplier_d = multiplier;
339 while (number_d >= multiplier_d)
341 number_d /= multiplier_d;
345 out <<
'(' << std::fixed << std::setprecision(3) << number_d <<
' '
346 << (multiplier == 1024 ? binary_endings[scale] : endings[scale])
347 << (unit ? unit :
"") <<
") ";
348 else if (unit && *unit)
355 #define hr add_IEC_binary_multiplier
356 o <<
"STXXL I/O statistics" << std::endl;
358 o <<
" total number of reads : " <<
hr(s.
get_reads()) << std::endl;
359 o <<
" average block size (read) : "
361 o <<
" number of bytes read from disks : " <<
hr(s.
get_read_volume(),
"B") << std::endl;
362 o <<
" time spent in serving all read requests : " << s.
get_read_time() <<
" s"
365 o <<
" time spent in reading (parallel read time) : " << s.
get_pread_time() <<
" s"
378 o <<
" total number of writes : " <<
hr(s.
get_writes()) << std::endl;
379 o <<
" average block size (write) : "
382 o <<
" time spent in serving all write requests : " << s.
get_write_time() <<
" s"
385 o <<
" time spent in writing (parallel write time): " << s.
get_pwrite_time() <<
" s"
388 o <<
" time spent in I/O (parallel I/O time) : " << s.
get_pio_time() <<
" s"
392 o <<
" n/a" << std::endl;
394 #ifndef STXXL_DO_NOT_COUNT_WAIT_TIME
401 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 timestamp()
Returns number of seconds since the epoch, high resolution.
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
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)