Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stats Class Reference

Detailed Description

Collects various I/O statistics.

Remarks
is a singleton

Definition at line 319 of file iostats.hpp.

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

#include <iostats.hpp>

Classes

class  scoped_wait_timer
 

Public Types

enum  wait_op_type { WAIT_OP_ANY, WAIT_OP_READ, WAIT_OP_WRITE }
 

Public Member Functions

file_statscreate_file_stats (unsigned device_id)
 
std::vector< file_stats_datadeepcopy_file_stats_data_list () const
 return list of file's stats data (deeply copied from each file_stats) More...
 
double get_creation_time () const
 
double get_io_wait_time () const
 
double get_pio_time () const
 
double get_pread_time () const
 
double get_pwrite_time () const
 
double get_wait_read_time () const
 
double get_wait_write_time () const
 
void wait_finished (wait_op_type wait_op_)
 
void wait_started (wait_op_type wait_op_)
 
- Public Member Functions inherited from singleton< stats >
 singleton ()=default
 
 singleton (const singleton &)=delete
 non-copyable: delete copy-constructor More...
 
singletonoperator= (const singleton &)=delete
 non-copyable: delete assignment operator More...
 

Private Member Functions

 stats ()
 private construction from singleton More...
 
void p_read_finished (double now)
 
void p_read_started (double now)
 
void p_write_finished (double now)
 
void p_write_started (double now)
 

Private Attributes

int acc_ios_
 
int acc_reads_
 
int acc_wait_read_
 
int acc_wait_write_
 
int acc_waits_
 
int acc_writes_
 
const double creation_time_
 
std::list< file_statsfile_stats_list_
 
std::mutex io_mutex_
 
std::mutex list_mutex_
 
double p_begin_io_
 
double p_begin_read_
 start time of parallel operation More...
 
double p_begin_wait_
 
double p_begin_wait_read_
 
double p_begin_wait_write_
 
double p_begin_write_
 
double p_ios_
 
double p_reads_
 seconds spent in parallel operations More...
 
double p_wait_read_
 
double p_wait_write_
 
double p_waits_
 
double p_writes_
 
std::mutex read_mutex_
 
double t_wait_read_
 
double t_wait_write_
 
double t_waits_
 
std::mutex wait_mutex_
 
std::mutex write_mutex_
 

Friends

std::ostream & operator<< (std::ostream &o, const stats &s)
 

Additional Inherited Members

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

Member Enumeration Documentation

Enumerator
WAIT_OP_ANY 
WAIT_OP_READ 
WAIT_OP_WRITE 

Definition at line 364 of file iostats.hpp.

Constructor & Destructor Documentation

stats ( )
private

private construction from singleton

Definition at line 196 of file iostats.cpp.

Member Function Documentation

file_stats * create_file_stats ( unsigned  device_id)

create new instance of a file_stats for an io::file to collect statistics. (for internal library use.)

Definition at line 350 of file iostats.cpp.

References stats::file_stats_list_, and stats::list_mutex_.

std::vector< file_stats_data > deepcopy_file_stats_data_list ( ) const

return list of file's stats data (deeply copied from each file_stats)

Definition at line 366 of file iostats.cpp.

References stats::file_stats_list_, and stats::list_mutex_.

double get_creation_time ( ) const
inline

Definition at line 417 of file iostats.hpp.

References stats::creation_time_.

double 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 429 of file iostats.hpp.

References stats::t_waits_.

double 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 460 of file iostats.hpp.

References stats::p_ios_.

double 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 446 of file iostats.hpp.

References stats::p_reads_.

double 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 453 of file iostats.hpp.

References stats::p_writes_.

double get_wait_read_time ( ) const
inline

Definition at line 434 of file iostats.hpp.

References stats::t_wait_read_.

double get_wait_write_time ( ) const
inline

Definition at line 439 of file iostats.hpp.

References stats::t_wait_write_.

void p_read_finished ( double  now)
private
void p_read_started ( double  now)
private
void p_write_finished ( double  now)
private
void p_write_started ( double  now)
private

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
const stats s 
)
friend

Definition at line 374 of file iostats.cpp.

Member Data Documentation

int acc_ios_
private
int acc_reads_
private

Definition at line 343 of file iostats.hpp.

Referenced by stats::p_read_finished(), and stats::p_read_started().

int acc_wait_read_
private

Definition at line 356 of file iostats.hpp.

Referenced by stats::wait_finished(), and stats::wait_started().

int acc_wait_write_
private

Definition at line 356 of file iostats.hpp.

Referenced by stats::wait_finished(), and stats::wait_started().

int acc_waits_
private

Definition at line 355 of file iostats.hpp.

Referenced by stats::wait_finished(), and stats::wait_started().

int acc_writes_
private

Definition at line 343 of file iostats.hpp.

Referenced by stats::p_write_finished(), and stats::p_write_started().

const double creation_time_
private

Definition at line 324 of file iostats.hpp.

Referenced by stats::get_creation_time().

std::list<file_stats> file_stats_list_
private

need std::list here, because the io::file objects keep a pointer to the enclosed file_stats objects and this list may grow.

Definition at line 328 of file iostats.hpp.

Referenced by stats::create_file_stats(), and stats::deepcopy_file_stats_data_list().

std::mutex io_mutex_
private
std::mutex list_mutex_
mutableprivate

Definition at line 330 of file iostats.hpp.

Referenced by stats::create_file_stats(), and stats::deepcopy_file_stats_data_list().

double p_begin_io_
private
double p_begin_read_
private

start time of parallel operation

Definition at line 337 of file iostats.hpp.

Referenced by stats::p_read_finished(), and stats::p_read_started().

double p_begin_wait_
private

Definition at line 350 of file iostats.hpp.

Referenced by stats::wait_finished(), and stats::wait_started().

double p_begin_wait_read_
private

Definition at line 352 of file iostats.hpp.

Referenced by stats::wait_finished(), and stats::wait_started().

double p_begin_wait_write_
private

Definition at line 354 of file iostats.hpp.

Referenced by stats::wait_finished(), and stats::wait_started().

double p_begin_write_
private

Definition at line 337 of file iostats.hpp.

Referenced by stats::p_write_finished(), and stats::p_write_started().

double p_reads_
private

seconds spent in parallel operations

Definition at line 335 of file iostats.hpp.

Referenced by stats::get_pread_time(), stats::p_read_finished(), and stats::p_read_started().

double p_wait_read_
private

Definition at line 351 of file iostats.hpp.

Referenced by stats::wait_finished(), and stats::wait_started().

double p_wait_write_
private

Definition at line 353 of file iostats.hpp.

Referenced by stats::wait_finished(), and stats::wait_started().

double p_waits_
private

Definition at line 349 of file iostats.hpp.

Referenced by stats::wait_finished(), and stats::wait_started().

double p_writes_
private
std::mutex read_mutex_
private

Definition at line 358 of file iostats.hpp.

Referenced by stats::p_read_finished(), and stats::p_read_started().

double t_wait_read_
private
double t_wait_write_
private
double t_waits_
private

Definition at line 349 of file iostats.hpp.

Referenced by stats::get_io_wait_time(), stats::wait_finished(), and stats::wait_started().

std::mutex wait_mutex_
private

Definition at line 358 of file iostats.hpp.

Referenced by stats::wait_finished(), and stats::wait_started().

std::mutex write_mutex_
private

Definition at line 358 of file iostats.hpp.

Referenced by stats::p_write_finished(), and stats::p_write_started().


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