Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
iostats.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * foxxll/io/iostats.hpp
3  *
4  * Part of FOXXLL. See http://foxxll.org
5  *
6  * Copyright (C) 2002-2004 Roman Dementiev <[email protected]>
7  * Copyright (C) 2008-2010 Andreas Beckmann <[email protected]>
8  * Copyright (C) 2009, 2010 Johannes Singler <[email protected]>
9  * Copyright (C) 2016 Alex Schickedanz <[email protected]>
10  * Copyright (C) 2017 Manuel Penschuck <[email protected]>
11  *
12  * Distributed under the Boost Software License, Version 1.0.
13  * (See accompanying file LICENSE_1_0.txt or copy at
14  * http://www.boost.org/LICENSE_1_0.txt)
15  **************************************************************************/
16 
17 #ifndef FOXXLL_IO_IOSTATS_HEADER
18 #define FOXXLL_IO_IOSTATS_HEADER
19 
20 #include <algorithm>
21 #include <iostream>
22 #include <limits>
23 #include <list>
24 #include <mutex>
25 #include <string>
26 #include <utility>
27 #include <vector>
28 
29 #include <tlx/logger/core.hpp>
30 #include <tlx/string.hpp>
31 #include <tlx/unused.hpp>
32 
34 #include <foxxll/common/timer.hpp>
35 #include <foxxll/common/types.hpp>
36 #include <foxxll/common/utils.hpp>
37 #include <foxxll/singleton.hpp>
38 
39 namespace foxxll {
40 
41 //! \addtogroup foxxll_iolayer
42 //!
43 //! \{
44 
46 {
47  //! associated device id
48  const unsigned device_id_;
49 
50  //! number of operations: read/write
52  //! number of bytes read/written
54  //! seconds spent in operations
56  //! start time of parallel operation
58 
59  //! number of requests, participating in parallel operation
61 
63 
64 public:
65  //! construct zero initialized
66  explicit file_stats(unsigned int device_id);
67 
69  {
70  using size_type = size_t;
72 
73  bool is_write_;
74  bool running_ = false;
75 
76  public:
78  file_stats* file_stats, size_type size, bool is_write = false)
79  : file_stats_(*file_stats), is_write_(is_write)
80  {
81  start(size);
82  }
83 
85  {
86  stop();
87  }
88 
89  void start(size_type size)
90  {
91  if (!running_) {
92  running_ = true;
93  if (is_write_)
95  else
97  }
98  }
99 
100  void stop()
101  {
102  if (running_) {
103  if (is_write_)
105  else
107  running_ = false;
108  }
109  }
110  };
111 
113  {
114  using size_type = size_t;
116 
117  bool running_ = false;
118 
119  public:
121  : file_stats_(*file_stats)
122  {
123  start(size);
124  }
125 
127  {
128  stop();
129  }
130 
131  void start(size_type size)
132  {
133  if (!running_) {
134  running_ = true;
136  }
137  }
138 
139  void stop()
140  {
141  if (running_) {
143  running_ = false;
144  }
145  }
146  };
147 
149  {
150  using size_type = size_t;
152 
153  bool running_ = false;
154 
155  public:
157  : file_stats_(*file_stats)
158  {
159  start(size);
160  }
161 
163  {
164  stop();
165  }
166 
167  void start(size_type size)
168  {
169  if (!running_) {
170  running_ = true;
172  }
173  }
174 
175  void stop()
176  {
177  if (running_) {
179  running_ = false;
180  }
181  }
182  };
183 
184 public:
185  //! Returns the device id.
186  //! \return device id
187  unsigned get_device_id() const
188  {
189  return device_id_;
190  }
191 
192  //! Returns total number of read_count_.
193  //! \return total number of read_count_
194  unsigned get_read_count() const
195  {
196  return read_count_;
197  }
198 
199  //! Returns total number of write_count_.
200  //! \return total number of write_count_
201  unsigned get_write_count() const
202  {
203  return write_count_;
204  }
205 
206  //! Returns number of bytes read from disks.
207  //! \return number of bytes read
209  {
210  return read_bytes_;
211  }
212 
213  //! Returns number of bytes written to the disks.
214  //! \return number of bytes written
216  {
217  return write_bytes_;
218  }
219 
220  //! Time that would be spent in read syscalls if all parallel read_count_
221  //! were serialized.
222  //! \return seconds spent in reading
223  double get_read_time() const
224  {
225  return read_time_;
226  }
227 
228  //! Time that would be spent in write syscalls if all parallel write_count_
229  //! were serialized.
230  //! \return seconds spent in writing
231  double get_write_time() const
232  {
233  return write_time_;
234  }
235 
236  // for library use
237  void write_started(const size_t size_, double now = 0.0);
238  void write_canceled(const size_t size_);
239  void write_finished();
240  void write_op_finished(const size_t size_, double duration);
241 
242  void read_started(const size_t size_, double now = 0.0);
243  void read_canceled(const size_t size_);
244  void read_finished();
245  void read_op_finished(const size_t size_, double duration);
246 };
247 
249 {
250  //! device id
251  unsigned device_id_;
252  //! number of operations
254  //! number of bytes read/written
256  //! seconds spent in operations
258 
259 public:
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)
265  { }
266 
267  //! construct file_stats_data by taking current values from file_stats
268  explicit file_stats_data(const file_stats& fs)
269  : device_id_(fs.get_device_id()),
276  { }
277 
280 
281  unsigned get_device_id() const
282  {
283  return device_id_;
284  }
285 
286  unsigned get_read_count() const
287  {
288  return read_count_;
289  }
290 
291  unsigned get_write_count() const
292  {
293  return write_count_;
294  }
295 
297  {
298  return read_bytes_;
299  }
300 
302  {
303  return write_bytes_;
304  }
305 
306  double get_read_time() const
307  {
308  return read_time_;
309  }
310 
311  double get_write_time() const
312  {
313  return write_time_;
314  }
315 };
316 
317 //! Collects various I/O statistics.
318 //! \remarks is a singleton
319 class stats : public singleton<stats>
320 {
321  friend class singleton<stats>;
322  friend class file_stats;
323 
324  const double creation_time_;
325 
326  //! need std::list here, because the io::file objects keep a pointer to the
327  //! enclosed file_stats objects and this list may grow.
328  std::list<file_stats> file_stats_list_;
329 
330  mutable std::mutex list_mutex_;
331 
332  // *** parallel times have to be counted globally ***
333 
334  //! seconds spent in parallel operations
336  //! start time of parallel operation
338  // seconds spent in all parallel I/O operations (read and write)
339  double p_ios_;
340  double p_begin_io_;
341 
342  // number of requests, participating in parallel operation
344  int acc_ios_;
345 
346  // *** waits are measured globally ***
347 
348  // seconds spent waiting for completion of I/O operations
357 
359 
360  //! private construction from singleton
361  stats();
362 
363 public:
368  };
369 
371  {
372 #ifndef FOXXLL_DO_NOT_COUNT_WAIT_TIME
373  bool running_ = false;
375 #endif
376 
377  public:
378  explicit scoped_wait_timer(wait_op_type wait_op, bool measure_time = true)
379 #ifndef FOXXLL_DO_NOT_COUNT_WAIT_TIME
380  : wait_op_(wait_op)
381 #endif
382  {
383  if (measure_time)
384  start();
385  }
386 
388  {
389  stop();
390  }
391 
392  void start()
393  {
394 #ifndef FOXXLL_DO_NOT_COUNT_WAIT_TIME
395  if (!running_) {
396  running_ = true;
398  }
399 #endif
400  }
401 
402  void stop()
403  {
404 #ifndef FOXXLL_DO_NOT_COUNT_WAIT_TIME
405  if (running_) {
407  running_ = false;
408  }
409 #endif
410  }
411  };
412 
413 public:
414  //! return list of file's stats data (deeply copied from each file_stats)
415  std::vector<file_stats_data> deepcopy_file_stats_data_list() const;
416 
417  double get_creation_time() const
418  {
419  return creation_time_;
420  }
421 
422  //! create new instance of a file_stats for an io::file to collect
423  //! statistics. (for internal library use.)
424  file_stats * create_file_stats(unsigned device_id);
425 
426  //! I/O wait time counter.
427  //! \return number of seconds spent in I/O waiting functions \link
428  //! request::wait request::wait \endlink, \c wait_any and \c wait_all
429  double get_io_wait_time() const
430  {
431  return t_waits_;
432  }
433 
434  double get_wait_read_time() const
435  {
436  return t_wait_read_;
437  }
438 
439  double get_wait_write_time() const
440  {
441  return t_wait_write_;
442  }
443 
444  //! Period of time when at least one I/O thread was executing a read.
445  //! \return seconds spent in reading
446  double get_pread_time() const
447  {
448  return p_reads_;
449  }
450 
451  //! Period of time when at least one I/O thread was executing a write.
452  //! \return seconds spent in writing
453  double get_pwrite_time() const
454  {
455  return p_writes_;
456  }
457 
458  //! Period of time when at least one I/O thread was executing a read or a write.
459  //! \return seconds spent in I/O
460  double get_pio_time() const
461  {
462  return p_ios_;
463  }
464 
465  friend std::ostream& operator << (std::ostream& o, const stats& s);
466 
467  // for library use
468 
469 private:
470  // only called from file_stats
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);
475 
476 public:
477  void wait_started(wait_op_type wait_op_);
478  void wait_finished(wait_op_type wait_op_);
479 };
480 
481 #ifdef FOXXLL_DO_NOT_COUNT_WAIT_TIME
482 inline void stats::wait_started(wait_op_type) { }
483 inline void stats::wait_finished(wait_op_type) { }
484 #endif
485 
487 {
488  //! seconds spent in parallel io
490 
491  //! seconds spent waiting for completion of I/O operations
492  double t_wait;
494 
495  double elapsed_;
496 
497  //! list of individual file statistics.
498  std::vector<file_stats_data> file_stats_data_list_;
499 
500  //! aggregator
501  template <typename T, typename Functor>
502  T fetch_sum(const Functor& get_value) const;
503 
504 public:
505  template <typename T>
506  struct summary
507  {
509  double average, median;
510  std::vector<std::pair<T, unsigned> > values_per_device;
511 
512  template <typename Functor>
513  summary(const std::vector<file_stats_data>& fs,
514  const Functor& get_value);
515  };
516 
517 public:
519  : p_reads_(0.0), p_writes_(0.0),
520  p_ios_(0.0),
521  t_wait(0.0),
522  t_wait_read_(0.0), t_wait_write_(0.0),
523  elapsed_(0.0)
524  { }
525 
526  stats_data(const stats& s) // implicit conversion -- NOLINT
527  : p_reads_(s.get_pread_time()),
529  p_ios_(s.get_pio_time()),
533  elapsed_(timestamp() - s.get_creation_time()),
534  file_stats_data_list_(s.deepcopy_file_stats_data_list())
535  { }
536 
537  stats_data operator + (const stats_data& a) const;
538  stats_data operator - (const stats_data& a) const;
539 
540  //! Returns the number of file_stats_data objects
541  size_t num_files() const;
542 
543  //! Returns the sum of all read_count_.
544  //! \return the sum of all read_count_
545  unsigned get_read_count() const;
546 
547  //! Retruns sum, min, max, avarage and median of all read_count_.
548  //! \return a summary of the read measurements
550 
551  //! Returns the sum of all write_count_.
552  //! \return the sum of all write_count_
553  unsigned get_write_count() const;
554 
555  //! Returns sum, min, max, avarage and median of all write_count_.
556  //! \returns a summary of the write measurements
558 
559  //! Returns number of bytes read from disks in total.
560  //! \return number of bytes read
562 
563  //! Returns sum, min, max, avarage and median of all read bytes.
564  //! \returns a summary of the write measurements
566 
567  //! Returns number of bytes written to the disks in total.
568  //! \return number of bytes written
570 
571  //! Returns sum, min, max, avarage and median of all written bytes.
572  //! \return a summary of the written bytes
574 
575  //! Time that would be spent in read syscalls if all parallel read_count_
576  //! were serialized.
577  //! \return seconds spent in reading
578  double get_read_time() const;
579 
580  //! Returns sum, min, max, avarage and median of all read times
581  //! \return a summary of the read times
583 
584  //! Time that would be spent in write syscalls if all parallel write_count_
585  //! were serialized.
586  //! \return the sum of the write times of all files
587  double get_write_time() const;
588 
589  //! Returns sum, min, max, avarage and median of all write times
590  //! \return a summary of the write times
592 
593  //! Period of time when at least one I/O thread was executing a read.
594  //! \return seconds spent in reading
595  double get_pread_time() const;
596 
597  //! Period of time when at least one I/O thread was executing a write.
598  //! \return seconds spent in writing
599  double get_pwrite_time() const;
600 
601  //! Period of time when at least one I/O thread was executing a read or a write.
602  //! \return seconds spent in I/O
603  double get_pio_time() const;
604 
606 
608 
610 
612 
614 
615  //! Retruns elapsed_ time
616  //! \remark If stats_data is not the difference between two other stats_data
617  //! objects, then this value is measures the time since the first file object
618  //! was initialized.
619  //! \return elapsed_ time
620  double get_elapsed_time() const
621  {
622  return elapsed_;
623  }
624 
625  //! I/O wait time counter.
626  //! \return number of seconds spent in I/O waiting functions
627  double get_io_wait_time() const;
628 
629  double get_wait_read_time() const;
630 
631  double get_wait_write_time() const;
632 
633  void to_ostream(std::ostream& o, const std::string line_prefix = "") const;
634 
635  friend std::ostream& operator << (std::ostream& o, const stats_data& s)
636  {
637  s.to_ostream(o);
638  return o;
639  }
640 };
641 
642 static inline
644  const external_size_type number, const std::string& unit = "")
645 {
646  return tlx::format_iec_units(number) + unit;
647 }
648 
649 static inline
651  external_size_type number, const std::string& unit = "")
652 {
653  return tlx::format_si_units(number) + unit;
654 }
655 
656 /*!
657  * Simple scoped iostats reporter which takes a message and reports the relative
658  * IO performance on destruction
659  */
661 {
662 protected:
663  //! message
666 
667  //! initial io-stats
669 
670  //! bytes processed
671  uint64_t bytes_;
672 
673  //! report on destruction
675 
676 public:
677  /*!
678  * Start time and configure report-style
679  *
680  * \param message Description displayed on the first line of the report
681  * \param key Line prefix displayed at the beginning of every line but the first
682  * \param bytes Used to compute MB/s as an initial overview
683  */
684  scoped_print_iostats(const std::string& message, const std::string key, uint64_t bytes)
685  : message_(message),
686  key_(key),
687  begin_(*foxxll::stats::get_instance()),
688  bytes_(bytes),
690  {
691  TLX_LOG1 << "Starting " << message;
692  }
693 
694  explicit scoped_print_iostats(const std::string& message, uint64_t bytes = 0)
695  : scoped_print_iostats(message, "", bytes)
696  { }
697 
698  explicit scoped_print_iostats(uint64_t bytes = 0)
700  { }
701 
702  //! stats at initialization
704  {
705  return begin_;
706  }
707 
708  //! print out relative stats via LOG
709  void report() const;
710 
711  //! Same as report() but disables reporting on destruction
713  {
714  report_on_destruction_ = false;
715  report();
716  }
717 
718  //! on destruction: report stats
720  {
722  report();
723  }
724 };
725 
726 //! \}
727 
728 } // namespace foxxll
729 
730 #endif // !FOXXLL_IO_IOSTATS_HEADER
731 
732 /**************************************************************************/
std::mutex io_mutex_
Definition: iostats.hpp:358
std::mutex write_mutex_
Definition: iostats.hpp:358
unsigned get_read_count() const
Definition: iostats.hpp:194
double get_write_time() const
Definition: iostats.cpp:574
double get_pread_time() const
Definition: iostats.cpp:589
static uint_pair max()
return an uint_pair instance containing the largest value possible
Definition: uint_types.hpp:226
scoped_read_timer(file_stats *file_stats, size_type size)
Definition: iostats.hpp:156
double get_wait_read_time() const
Definition: iostats.hpp:434
external_size_type write_bytes_
Definition: iostats.hpp:53
file_stats_data operator+(const file_stats_data &a) const
Definition: iostats.cpp:153
int acc_reads_
number of requests, participating in parallel operation
Definition: iostats.hpp:60
external_size_type write_bytes_
Definition: iostats.hpp:255
double p_begin_wait_write_
Definition: iostats.hpp:354
int acc_wait_read_
Definition: iostats.hpp:356
uint64_t bytes_
bytes processed
Definition: iostats.hpp:671
std::mutex write_mutex_
Definition: iostats.hpp:62
void p_read_finished(double now)
Definition: iostats.cpp:333
double T
unsigned read_count_
number of operations
Definition: iostats.hpp:253
double p_begin_read_
start time of parallel operation
Definition: iostats.hpp:57
void write_started(const size_t size_, double now=0.0)
Definition: iostats.cpp:44
double get_pwrite_time() const
Definition: iostats.hpp:453
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: iostats.cpp:367
summary(const std::vector< file_stats_data > &fs, const Functor &get_value)
Definition: iostats.cpp:394
T fetch_sum(const Functor &get_value) const
aggregator
Definition: iostats.cpp:385
double p_begin_write_
Definition: iostats.hpp:57
void report() const
print out relative stats via LOG
Definition: iostats.cpp:813
std::mutex read_mutex_
Definition: iostats.hpp:62
double p_begin_io_
Definition: iostats.hpp:340
std::mutex list_mutex_
Definition: iostats.hpp:330
std::mutex wait_mutex_
Definition: iostats.hpp:358
void read_op_finished(const size_t size_, double duration)
Definition: iostats.cpp:141
unsigned get_read_count() const
Definition: iostats.hpp:286
void p_write_finished(double now)
Definition: iostats.cpp:297
const unsigned device_id_
associated device id
Definition: iostats.hpp:48
void write_canceled(const size_t size_)
Definition: iostats.cpp:62
external_size_type get_write_bytes() const
Definition: iostats.hpp:215
external_size_type get_write_bytes() const
Definition: iostats.hpp:301
double p_ios_
Definition: iostats.hpp:339
void write_finished()
Definition: iostats.cpp:73
foxxll::stats_data begin_
initial io-stats
Definition: iostats.hpp:668
std::string format_si_units(uint64_t number, int precision)
Format number as something like 1 TB.
double p_reads_
seconds spent in parallel io
Definition: iostats.hpp:489
static double timestamp()
Returns number of seconds since the epoch, high resolution.
Definition: timer.hpp:36
int acc_wait_write_
Definition: iostats.hpp:356
void p_read_started(double now)
Definition: iostats.cpp:315
double p_writes_
Definition: iostats.hpp:335
unsigned get_write_count() const
Definition: iostats.hpp:201
double get_read_time() const
Definition: iostats.hpp:306
void wait_started(wait_op_type wait_op_)
Definition: iostats.cpp:217
external_size_type get_read_bytes() const
Definition: iostats.hpp:208
friend std::ostream & operator<<(std::ostream &o, const stats &s)
Definition: iostats.cpp:375
const foxxll::stats_data & initial_stats() const
stats at initialization
Definition: iostats.hpp:703
double read_time_
seconds spent in operations
Definition: iostats.hpp:257
~scoped_print_iostats()
on destruction: report stats
Definition: iostats.hpp:719
double p_wait_write_
Definition: iostats.hpp:353
void to_ostream(std::ostream &o, const std::string line_prefix="") const
Definition: iostats.cpp:664
static std::string add_SI_multiplier(external_size_type number, const std::string &unit="")
Definition: iostats.hpp:650
double write_time_
Definition: iostats.hpp:55
double p_wait_read_
Definition: iostats.hpp:351
external_size_type get_read_bytes() const
Definition: iostats.cpp:527
file_stats(unsigned int device_id)
construct zero initialized
Definition: iostats.cpp:35
double t_wait
seconds spent waiting for completion of I/O operations
Definition: iostats.hpp:492
static std::string add_IEC_binary_multiplier(const external_size_type number, const std::string &unit="")
Definition: iostats.hpp:643
unsigned write_count_
Definition: iostats.hpp:51
double p_begin_read_
start time of parallel operation
Definition: iostats.hpp:337
scoped_wait_timer(wait_op_type wait_op, bool measure_time=true)
Definition: iostats.hpp:378
void read_started(const size_t size_, double now=0.0)
Definition: iostats.cpp:97
double get_wait_write_time() const
Definition: iostats.cpp:659
unsigned device_id_
device id
Definition: iostats.hpp:251
std::vector< file_stats_data > file_stats_data_list_
list of individual file statistics.
Definition: iostats.hpp:498
std::list< file_stats > file_stats_list_
Definition: iostats.hpp:328
stats_data operator+(const stats_data &a) const
Definition: iostats.cpp:444
scoped_print_iostats(const std::string &message, const std::string key, uint64_t bytes)
Start time and configure report-style.
Definition: iostats.hpp:684
std::basic_string< char, std::char_traits< char >, Allocator< char > > string
string with Manager tracking
Definition: allocator.hpp:220
stats_data operator-(const stats_data &a) const
Definition: iostats.cpp:468
void p_write_started(double now)
Definition: iostats.cpp:279
void final_report()
Same as report() but disables reporting on destruction.
Definition: iostats.hpp:712
double get_io_wait_time() const
Definition: iostats.cpp:649
static instance_pointer get_instance()
Definition: singleton.hpp:44
file_stats_data(const file_stats &fs)
construct file_stats_data by taking current values from file_stats
Definition: iostats.hpp:268
std::vector< std::pair< T, unsigned > > values_per_device
Definition: iostats.hpp:510
unsigned get_device_id() const
Definition: iostats.hpp:281
scoped_print_iostats(const std::string &message, uint64_t bytes=0)
Definition: iostats.hpp:694
stats_data::summary< double > get_pread_speed_summary() const
Definition: iostats.cpp:613
external_size_type get_read_bytes() const
Definition: iostats.hpp:296
static const size_t bytes
number of bytes in uint_pair
Definition: uint_types.hpp:75
double p_begin_wait_
Definition: iostats.hpp:350
double get_elapsed_time() const
Definition: iostats.hpp:620
scoped_read_write_timer(file_stats *file_stats, size_type size, bool is_write=false)
Definition: iostats.hpp:77
external_size_type read_bytes_
number of bytes read/written
Definition: iostats.hpp:53
const double creation_time_
Definition: iostats.hpp:324
scoped_write_timer(file_stats *file_stats, size_type size)
Definition: iostats.hpp:120
double get_pwrite_time() const
Definition: iostats.cpp:594
unsigned read_count_
number of operations: read/write
Definition: iostats.hpp:51
double p_reads_
seconds spent in parallel operations
Definition: iostats.hpp:335
stats_data::summary< double > get_write_time_summary() const
Definition: iostats.cpp:580
double get_io_wait_time() const
Definition: iostats.hpp:429
stats_data::summary< double > get_read_speed_summary() const
Definition: iostats.cpp:604
unsigned get_read_count() const
Definition: iostats.cpp:497
double p_begin_wait_read_
Definition: iostats.hpp:352
void read_finished()
Definition: iostats.cpp:126
stats_data::summary< double > get_write_speed_summary() const
Definition: iostats.cpp:622
std::mutex read_mutex_
Definition: iostats.hpp:358
unsigned get_write_count() const
Definition: iostats.hpp:291
double t_wait_write_
Definition: iostats.hpp:493
size_t num_files() const
Returns the number of file_stats_data objects.
Definition: iostats.cpp:492
void read_canceled(const size_t size_)
Definition: iostats.cpp:115
scoped_print_iostats(uint64_t bytes=0)
Definition: iostats.hpp:698
void wait_finished(wait_op_type wait_op_)
Definition: iostats.cpp:244
stats()
private construction from singleton
Definition: iostats.cpp:196
bool report_on_destruction_
report on destruction
Definition: iostats.hpp:674
stats_data::summary< double > get_pio_speed_summary() const
Definition: iostats.cpp:640
#define TLX_LOG1
Definition: core.hpp:145
double get_pio_time() const
Definition: iostats.hpp:460
stats_data::summary< external_size_type > get_write_bytes_summary() const
Definition: iostats.cpp:550
double get_pread_time() const
Definition: iostats.hpp:446
double get_wait_write_time() const
Definition: iostats.hpp:439
double get_write_time() const
Definition: iostats.hpp:311
file_stats_data operator-(const file_stats_data &a) const
Definition: iostats.cpp:173
void write_op_finished(const size_t size_, double duration)
Definition: iostats.cpp:88
double p_waits_
Definition: iostats.hpp:349
stats_data::summary< double > get_read_time_summary() const
Definition: iostats.cpp:565
double get_write_time() const
Definition: iostats.hpp:231
double get_read_time() const
Definition: iostats.hpp:223
unsigned get_write_count() const
Definition: iostats.cpp:512
external_size_type read_bytes_
number of bytes read/written
Definition: iostats.hpp:255
stats_data::summary< external_size_type > get_read_bytes_summary() const
Definition: iostats.cpp:534
unsigned get_device_id() const
Definition: iostats.hpp:187
double read_time_
seconds spent in operations
Definition: iostats.hpp:55
Simple scoped iostats reporter which takes a message and reports the relative IO performance on destr...
Definition: iostats.hpp:660
double t_wait_read_
Definition: iostats.hpp:351
double get_pio_time() const
Definition: iostats.cpp:599
double p_begin_write_
Definition: iostats.hpp:337
std::string format_iec_units(uint64_t number, int precision)
Format number as something like 1 TiB.
double t_waits_
Definition: iostats.hpp:349
stats_data::summary< double > get_pwrite_speed_summary() const
Definition: iostats.cpp:631
double get_read_time() const
Definition: iostats.cpp:559
double get_creation_time() const
Definition: iostats.hpp:417
stats_data(const stats &s)
Definition: iostats.hpp:526
stats_data::summary< unsigned > get_write_count_summary() const
Definition: iostats.cpp:518
uint64_t external_size_type
Definition: types.hpp:27
std::string message_
message
Definition: iostats.hpp:664
double get_wait_read_time() const
Definition: iostats.cpp:654
stats_data::summary< unsigned > get_read_count_summary() const
Definition: iostats.cpp:503
double t_wait_write_
Definition: iostats.hpp:353
external_size_type get_write_bytes() const
Definition: iostats.cpp:543
file_stats * create_file_stats(unsigned device_id)
Definition: iostats.cpp:351
friend std::ostream & operator<<(std::ostream &o, const stats_data &s)
Definition: iostats.hpp:635