STXXL  1.4-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stxxl::stats Class Reference

Detailed Description

Collects various I/O statistics.

Remarks
is a singleton
Examples:
examples/applications/skew3.cpp.

Definition at line 42 of file iostats.h.

+ Inheritance diagram for stxxl::stats:
+ Collaboration diagram for stxxl::stats:

Classes

class  scoped_read_timer
 
class  scoped_read_write_timer
 
class  scoped_wait_timer
 
class  scoped_write_timer
 

Public Types

enum  wait_op_type { WAIT_OP_ANY, WAIT_OP_READ, WAIT_OP_WRITE }
 

Public Member Functions

void _reset_io_wait_time ()
 Resets I/O wait time counter. More...
 
int64 get_cached_read_volume () const
 Returns number of bytes read from cache. More...
 
unsigned get_cached_reads () const
 Returns total number of reads served from cache. More...
 
unsigned get_cached_writes () const
 Returns total number of cached writes. More...
 
int64 get_cached_written_volume () const
 Returns number of bytes written to the cache. More...
 
double get_io_wait_time () const
 I/O wait time counter. More...
 
double get_last_reset_time () const
 Return time of the last reset. More...
 
double get_pio_time () const
 Period of time when at least one I/O thread was executing a read or a write. More...
 
double get_pread_time () const
 Period of time when at least one I/O thread was executing a read. More...
 
double get_pwrite_time () const
 Period of time when at least one I/O thread was executing a write. More...
 
double get_read_time () const
 Time that would be spent in read syscalls if all parallel reads were serialized. More...
 
int64 get_read_volume () const
 Returns number of bytes read from disks. More...
 
unsigned get_reads () const
 Returns total number of reads. More...
 
double get_wait_read_time () const
 
double get_wait_write_time () const
 
double get_write_time () const
 Time that would be spent in write syscalls if all parallel writes were serialized. More...
 
unsigned get_writes () const
 Returns total number of writes. More...
 
int64 get_written_volume () const
 Returns number of bytes written to the disks. More...
 
void read_cached (unsigned_type size_)
 
void read_canceled (unsigned_type size_)
 
void read_finished ()
 
void read_started (unsigned_type size_, double now=0.0)
 
void reset ()
 Resets I/O time counters (including I/O wait counter). More...
 
void wait_finished (wait_op_type wait_op)
 
void wait_started (wait_op_type wait_op)
 
void write_cached (unsigned_type size_)
 
void write_canceled (unsigned_type size_)
 
void write_finished ()
 
void write_started (unsigned_type size_, double now=0.0)
 

Private Member Functions

 stats ()
 

Private Attributes

int acc_ios
 
int acc_reads
 
int acc_wait_read
 
int acc_wait_write
 
int acc_waits
 
int acc_writes
 
unsigned c_reads
 
int64 c_volume_read
 
int64 c_volume_written
 
unsigned c_writes
 
mutex io_mutex
 
double last_reset
 
double p_begin_io
 
double p_begin_read
 
double p_begin_wait
 
double p_begin_wait_read
 
double p_begin_wait_write
 
double p_begin_write
 
double p_ios
 
double p_reads
 
double p_wait_read
 
double p_wait_write
 
double p_waits
 
double p_writes
 
mutex read_mutex
 
unsigned reads
 
double t_reads
 
double t_wait_read
 
double t_wait_write
 
double t_waits
 
double t_writes
 
int64 volume_read
 
int64 volume_written
 
mutex wait_mutex
 
mutex write_mutex
 
unsigned writes
 

Additional Inherited Members

- Static Public Member Functions inherited from stxxl::singleton< stats >
static instance_pointer get_instance ()
 

Member Enumeration Documentation

Enumerator
WAIT_OP_ANY 
WAIT_OP_READ 
WAIT_OP_WRITE 

Definition at line 71 of file iostats.h.

Constructor & Destructor Documentation

stxxl::stats::stats ( )
private

Definition at line 29 of file iostats.cpp.

Member Function Documentation

void stxxl::stats::_reset_io_wait_time ( )

Resets I/O wait time counter.

Definition at line 314 of file iostats.cpp.

References acc_waits, p_waits, STXXL_ERRMSG, t_waits, and wait_mutex.

int64 stxxl::stats::get_cached_read_volume ( ) const
inline

Returns number of bytes read from cache.

Returns
number of bytes read from cache

Definition at line 308 of file iostats.h.

unsigned stxxl::stats::get_cached_reads ( ) const
inline

Returns total number of reads served from cache.

Returns
total number of cached reads

Definition at line 294 of file iostats.h.

unsigned stxxl::stats::get_cached_writes ( ) const
inline

Returns total number of cached writes.

Returns
total number of cached writes

Definition at line 301 of file iostats.h.

int64 stxxl::stats::get_cached_written_volume ( ) const
inline

Returns number of bytes written to the cache.

Returns
number of bytes written to cache

Definition at line 315 of file iostats.h.

double stxxl::stats::get_io_wait_time ( ) const
inline

I/O wait time counter.

Returns
number of seconds spent in I/O waiting functions request::wait , wait_any and wait_all

Definition at line 358 of file iostats.h.

double stxxl::stats::get_last_reset_time ( ) const
inline

Return time of the last reset.

Returns
seconds passed from the last reset()

Definition at line 375 of file iostats.h.

double stxxl::stats::get_pio_time ( ) const
inline

Period of time when at least one I/O thread was executing a read or a write.

Returns
seconds spent in I/O

Definition at line 350 of file iostats.h.

double stxxl::stats::get_pread_time ( ) const
inline

Period of time when at least one I/O thread was executing a read.

Returns
seconds spent in reading

Definition at line 336 of file iostats.h.

double stxxl::stats::get_pwrite_time ( ) const
inline

Period of time when at least one I/O thread was executing a write.

Returns
seconds spent in writing

Definition at line 343 of file iostats.h.

double stxxl::stats::get_read_time ( ) const
inline

Time that would be spent in read syscalls if all parallel reads were serialized.

Returns
seconds spent in reading

Definition at line 322 of file iostats.h.

int64 stxxl::stats::get_read_volume ( ) const
inline

Returns number of bytes read from disks.

Returns
number of bytes read

Definition at line 280 of file iostats.h.

unsigned stxxl::stats::get_reads ( ) const
inline

Returns total number of reads.

Returns
total number of reads

Definition at line 266 of file iostats.h.

double stxxl::stats::get_wait_read_time ( ) const
inline

Definition at line 363 of file iostats.h.

double stxxl::stats::get_wait_write_time ( ) const
inline

Definition at line 368 of file iostats.h.

double stxxl::stats::get_write_time ( ) const
inline

Time that would be spent in write syscalls if all parallel writes were serialized.

Returns
seconds spent in writing

Definition at line 329 of file iostats.h.

unsigned stxxl::stats::get_writes ( ) const
inline

Returns total number of writes.

Returns
total number of writes

Definition at line 273 of file iostats.h.

int64 stxxl::stats::get_written_volume ( ) const
inline

Returns number of bytes written to the disks.

Returns
number of bytes written

Definition at line 287 of file iostats.h.

void stxxl::stats::read_cached ( unsigned_type  size_)
void stxxl::stats::read_canceled ( unsigned_type  size_)
void stxxl::stats::read_finished ( )
void stxxl::stats::read_started ( unsigned_type  size_,
double  now = 0.0 
)
void stxxl::stats::write_cached ( unsigned_type  size_)
void stxxl::stats::write_canceled ( unsigned_type  size_)
void stxxl::stats::write_finished ( )
void stxxl::stats::write_started ( unsigned_type  size_,
double  now = 0.0 
)

Member Data Documentation

int stxxl::stats::acc_ios
private

Definition at line 62 of file iostats.h.

Referenced by reset().

int stxxl::stats::acc_reads
private

Definition at line 61 of file iostats.h.

Referenced by reset().

int stxxl::stats::acc_wait_read
private

Definition at line 64 of file iostats.h.

Referenced by wait_finished(), and wait_started().

int stxxl::stats::acc_wait_write
private

Definition at line 64 of file iostats.h.

Referenced by wait_finished(), and wait_started().

int stxxl::stats::acc_waits
private

Definition at line 63 of file iostats.h.

Referenced by _reset_io_wait_time(), reset(), wait_finished(), and wait_started().

int stxxl::stats::acc_writes
private

Definition at line 61 of file iostats.h.

Referenced by reset().

unsigned stxxl::stats::c_reads
private

Definition at line 48 of file iostats.h.

Referenced by reset().

int64 stxxl::stats::c_volume_read
private

Definition at line 49 of file iostats.h.

Referenced by reset().

int64 stxxl::stats::c_volume_written
private

Definition at line 49 of file iostats.h.

Referenced by reset().

unsigned stxxl::stats::c_writes
private

Definition at line 48 of file iostats.h.

Referenced by reset().

mutex stxxl::stats::io_mutex
private

Definition at line 66 of file iostats.h.

Referenced by reset().

double stxxl::stats::last_reset
private

Definition at line 65 of file iostats.h.

Referenced by reset(), and wait_finished().

double stxxl::stats::p_begin_io
private

Definition at line 54 of file iostats.h.

double stxxl::stats::p_begin_read
private

Definition at line 52 of file iostats.h.

double stxxl::stats::p_begin_wait
private

Definition at line 56 of file iostats.h.

Referenced by wait_finished(), and wait_started().

double stxxl::stats::p_begin_wait_read
private

Definition at line 58 of file iostats.h.

Referenced by wait_finished(), and wait_started().

double stxxl::stats::p_begin_wait_write
private

Definition at line 60 of file iostats.h.

Referenced by wait_finished(), and wait_started().

double stxxl::stats::p_begin_write
private

Definition at line 52 of file iostats.h.

double stxxl::stats::p_ios
private

Definition at line 53 of file iostats.h.

Referenced by reset().

double stxxl::stats::p_reads
private

Definition at line 51 of file iostats.h.

Referenced by reset().

double stxxl::stats::p_wait_read
private

Definition at line 57 of file iostats.h.

Referenced by reset(), wait_finished(), and wait_started().

double stxxl::stats::p_wait_write
private

Definition at line 59 of file iostats.h.

Referenced by reset(), wait_finished(), and wait_started().

double stxxl::stats::p_waits
private

Definition at line 55 of file iostats.h.

Referenced by _reset_io_wait_time(), reset(), wait_finished(), and wait_started().

double stxxl::stats::p_writes
private

Definition at line 51 of file iostats.h.

Referenced by reset().

mutex stxxl::stats::read_mutex
private

Definition at line 66 of file iostats.h.

Referenced by reset().

unsigned stxxl::stats::reads
private

Definition at line 46 of file iostats.h.

Referenced by reset().

double stxxl::stats::t_reads
private

Definition at line 50 of file iostats.h.

Referenced by reset().

double stxxl::stats::t_wait_read
private

Definition at line 57 of file iostats.h.

Referenced by reset(), wait_finished(), and wait_started().

double stxxl::stats::t_wait_write
private

Definition at line 59 of file iostats.h.

Referenced by reset(), wait_finished(), and wait_started().

double stxxl::stats::t_waits
private

Definition at line 55 of file iostats.h.

Referenced by _reset_io_wait_time(), reset(), wait_finished(), and wait_started().

double stxxl::stats::t_writes
private

Definition at line 50 of file iostats.h.

Referenced by reset().

int64 stxxl::stats::volume_read
private

Definition at line 47 of file iostats.h.

Referenced by reset().

int64 stxxl::stats::volume_written
private

Definition at line 47 of file iostats.h.

Referenced by reset().

mutex stxxl::stats::wait_mutex
private

Definition at line 66 of file iostats.h.

Referenced by _reset_io_wait_time(), reset(), wait_finished(), and wait_started().

mutex stxxl::stats::write_mutex
private

Definition at line 66 of file iostats.h.

Referenced by reset().

unsigned stxxl::stats::writes
private

Definition at line 46 of file iostats.h.

Referenced by reset().


The documentation for this class was generated from the following files: