33#include "timemory/components/io/backends.hpp"
35#include "timemory/components/timing/backends.hpp"
66 return "Number of bytes which this task has caused to be read from storage. Sum "
67 "of bytes which this process passed to read() and pread(). Not disk IO.";
70 static std::pair<double, double>
unit()
72 return std::pair<double, double>{
73 units::megabyte,
static_cast<double>(units::megabyte) / units::sec
85 return std::vector<std::string>{
label(),
"read_rate" };
97 return std::vector<std::string>{
"Number of char read",
"Rate of char read" };
100 static auto get_timestamp() {
return tim::get_clock_real_now<int64_t, std::nano>(); }
106 static auto _value = units::sec;
114 std::stringstream ss;
115 std::stringstream ssv;
116 std::stringstream ssr;
125 ssv << std::setw(_width) << std::setprecision(_prec) << std::get<0>(_val);
126 if(!std::get<0>(_disp).empty())
127 ssv <<
" " << std::get<0>(_disp);
130 ssr << std::setw(_width) << std::setprecision(_prec) << std::get<1>(_val);
131 if(!std::get<1>(_disp).empty())
132 ssr <<
" " << std::get<1>(_disp);
134 ss << ssv.str() <<
", " << ssr.str();
143 double data = std::get<0>(val);
144 double delta = std::get<1>(val);
146 delta /=
static_cast<double>(std::nano::den);
170 auto diff = (
record() - value);
171 std::get<0>(diff) =
std::abs(std::get<0>(diff));
172 accum += (value = diff);
178 static auto& _mem = std::get<0>(_instance);
179 static auto& _rate = std::get<1>(_instance);
188 _rate = _mem / (_timing_val);
191 static const auto factor =
static_cast<double>(std::nano::den);
193 std::get<1>(_tmp) *= factor;
201 static auto& _mem = std::get<0>(_instance);
202 static auto& _rate = std::get<1>(_instance);
223 std::get<0>(accum) = std::get<0>(value) =
224 std::max<int64_t>(std::get<0>(value), get_char_read());
230 std::get<0>(accum) = std::get<0>(value) =
231 std::max<int64_t>(std::get<0>(value), _cache.get_char_read());
247 auto diff = (
record(_cache) - value);
248 std::get<0>(diff) =
std::abs(std::get<0>(diff));
249 accum += (value = diff);
270 return "Number of bytes which this task has caused, or shall cause to be written "
271 "to disk. Similar caveats to read_char.";
277 static_cast<double>(units::megabyte) / units::sec } };
288 return std::vector<std::string>{
label(),
"written_rate" };
300 return std::vector<std::string>{
"Number of char written",
301 "Rate of char written" };
304 static auto get_timestamp() {
return tim::get_clock_real_now<int64_t, std::nano>(); }
313 static auto _value = units::sec;
321 std::stringstream ss;
322 std::stringstream ssv;
323 std::stringstream ssr;
332 ssv << std::setw(_width) << std::setprecision(_prec) << std::get<0>(_val);
333 if(!std::get<0>(_disp).empty())
334 ssv <<
" " << std::get<0>(_disp);
337 ssr << std::setw(_width) << std::setprecision(_prec) << std::get<1>(_val);
338 if(!std::get<1>(_disp).empty())
339 ssr <<
" " << std::get<1>(_disp);
341 ss << ssv.str() <<
", " << ssr.str();
350 double data = std::get<0>(val);
351 double delta = std::get<1>(val);
353 delta /=
static_cast<double>(std::nano::den);
377 auto diff = (
record() - value);
378 std::get<0>(diff) =
std::abs(std::get<0>(diff));
379 accum += (value = diff);
385 static auto& _mem = std::get<0>(_instance);
386 static auto& _rate = std::get<1>(_instance);
395 _rate = _mem / (_timing_val);
398 static const auto factor =
static_cast<double>(std::nano::den);
400 std::get<1>(_tmp) *= factor;
408 static auto& _mem = std::get<0>(_instance);
409 static auto& _rate = std::get<1>(_instance);
430 std::get<0>(accum) = std::get<0>(value) =
431 std::max<int64_t>(std::get<0>(value), get_char_written());
437 std::get<0>(accum) = std::get<0>(value) =
438 std::max<int64_t>(std::get<0>(value), _cache.get_char_written());
454 auto diff = (
record(_cache) - value);
455 std::get<0>(diff) =
std::abs(std::get<0>(diff));
456 accum += (value = diff);
477 return "Number of bytes which this process really did cause to be fetched from "
481 static std::pair<double, double>
unit()
483 return std::pair<double, double>{
484 units::megabyte,
static_cast<double>(units::megabyte) / units::sec
496 return std::vector<std::string>{
label(),
"read_rate" };
508 return std::vector<std::string>{
"Number of bytes read",
"Rate of bytes read" };
511 static auto get_timestamp() {
return tim::get_clock_real_now<int64_t, std::nano>(); }
517 static auto _value = units::sec;
525 std::stringstream ss;
526 std::stringstream ssv;
527 std::stringstream ssr;
536 ssv << std::setw(_width) << std::setprecision(_prec) << std::get<0>(_val);
537 if(!std::get<0>(_disp).empty())
538 ssv <<
" " << std::get<0>(_disp);
541 ssr << std::setw(_width) << std::setprecision(_prec) << std::get<1>(_val);
542 if(!std::get<1>(_disp).empty())
543 ssr <<
" " << std::get<1>(_disp);
545 ss << ssv.str() <<
", " << ssr.str();
554 double data = std::get<0>(val);
555 double delta = std::get<1>(val);
557 delta /=
static_cast<double>(std::nano::den);
581 auto diff = (
record() - value);
582 std::get<0>(diff) =
std::abs(std::get<0>(diff));
583 accum += (value = diff);
589 static auto& _mem = std::get<0>(_instance);
590 static auto& _rate = std::get<1>(_instance);
599 _rate = _mem / (_timing_val);
602 static const auto factor =
static_cast<double>(std::nano::den);
604 std::get<1>(_tmp) *= factor;
612 static auto& _mem = std::get<0>(_instance);
613 static auto& _rate = std::get<1>(_instance);
634 std::get<0>(accum) = std::get<0>(value) =
635 std::max<int64_t>(std::get<0>(value), get_bytes_read());
641 std::get<0>(accum) = std::get<0>(value) =
642 std::max<int64_t>(std::get<0>(value), _cache.get_bytes_read());
658 auto diff = (
record(_cache) - value);
659 std::get<0>(diff) =
std::abs(std::get<0>(diff));
660 accum += (value = diff);
680 return "Number of bytes sent to the storage layer";
686 static_cast<double>(units::megabyte) / units::sec } };
697 return std::vector<std::string>{
label(),
"written_rate" };
709 return std::vector<std::string>{
"Number of bytes written",
710 "Rate of bytes written" };
713 static auto get_timestamp() {
return tim::get_clock_real_now<int64_t, std::nano>(); }
722 static auto _value = units::sec;
730 std::stringstream ss;
731 std::stringstream ssv;
732 std::stringstream ssr;
741 ssv << std::setw(_width) << std::setprecision(_prec) << std::get<0>(_val);
742 if(!std::get<0>(_disp).empty())
743 ssv <<
" " << std::get<0>(_disp);
746 ssr << std::setw(_width) << std::setprecision(_prec) << std::get<1>(_val);
747 if(!std::get<1>(_disp).empty())
748 ssr <<
" " << std::get<1>(_disp);
750 ss << ssv.str() <<
", " << ssr.str();
751 ss <<
" write_bytes";
759 double data = std::get<0>(val);
760 double delta = std::get<1>(val);
762 delta /=
static_cast<double>(std::nano::den);
786 auto diff = (
record() - value);
787 std::get<0>(diff) =
std::abs(std::get<0>(diff));
788 accum += (value = diff);
794 static auto& _mem = std::get<0>(_instance);
795 static auto& _rate = std::get<1>(_instance);
804 _rate = _mem / (_timing_val);
807 static const auto factor =
static_cast<double>(std::nano::den);
809 std::get<1>(_tmp) *= factor;
817 static auto& _mem = std::get<0>(_instance);
818 static auto& _rate = std::get<1>(_instance);
839 std::get<0>(accum) = std::get<0>(value) =
840 std::max<int64_t>(std::get<0>(value), get_bytes_written());
846 std::get<0>(accum) = std::get<0>(value) =
847 std::max<int64_t>(std::get<0>(value), _cache.get_bytes_written());
863 auto diff = (
record(_cache) - value);
864 std::get<0>(diff) =
std::abs(std::get<0>(diff));
865 accum += (value = diff);
Declare the io component types.
type_list abs(type_list<>)
std::tuple< std::string, int64_t > get_timing_unit(std::string _unit)
std::tuple< std::string, int64_t > get_memory_unit(std::string _unit)
bool isfinite(const Tp &arg)
tim::mpl::apply< std::string > string
static short get_precision()
static fmtflags get_format_flags()
typename trait::cache< read_char >::type cache_type
I/O counter for bytes read. Attempt to count the number of bytes which this process really did cause ...
static unit_type get_unit()
static display_unit_type get_display_unit()
static std::pair< double, double > unit()
void stop(const cache_type &_cache)
stop a measurement using the cached data
static std::string label()
typename trait::units< this_type >::type unit_type
static std::vector< std::string > description_array()
static std::string description()
static std::vector< std::string > display_unit_array()
void sample()
sample a measurement
typename trait::units< this_type >::display_type display_unit_type
static value_type record()
static std::vector< std::string > label_array()
void sample(const cache_type &_cache)
sample a measurement from cached data
std::string get_display() const
static auto get_timing_unit()
static auto get_timestamp()
static display_unit_type display_unit()
std::pair< int64_t, int64_t > value_type
void start(const cache_type &_cache)
start a measurement using the cached data
static value_type record(const cache_type &_cache)
read the value from the cache
std::pair< double, double > result_type
static std::pair< double, double > unit_array()
I/O counter for chars read. The number of bytes which this task has caused to be read from storage....
static auto get_timestamp()
static std::string description()
typename trait::units< this_type >::display_type display_unit_type
void start(const cache_type &_cache)
start a measurement using the cached data
static std::pair< double, double > unit()
std::pair< double, double > result_type
typename trait::units< this_type >::type unit_type
static std::pair< double, double > unit_array()
static std::vector< std::string > label_array()
std::string get_display() const
static value_type record()
static std::vector< std::string > description_array()
std::pair< int64_t, int64_t > value_type
static value_type record(const cache_type &_cache)
read the value from cached data
void sample(const cache_type &_cache)
sample a measurement from cached data
static display_unit_type get_display_unit()
static std::string label()
void stop(const cache_type &_cache)
stop a measurement using the cached data
static std::vector< std::string > display_unit_array()
static auto get_timing_unit()
void sample()
sample a measurement
static display_unit_type display_unit()
static unit_type get_unit()
I/O counter for bytes written. Attempt to count the number of bytes which this process caused to be s...
void start(const cache_type &_cache)
start a measurement using the cached data
void sample(const cache_type &_cache)
sample a measurement from cached data
typename trait::units< this_type >::type unit_type
static value_type record(const cache_type &_cache)
read the value from the cache
static value_type record()
std::string get_display() const
static std::vector< std::string > label_array()
static display_unit_type get_display_unit()
std::array< int64_t, 2 > value_type
static unit_type get_unit()
static std::vector< std::string > display_unit_array()
std::array< double, 2 > result_type
static auto get_timing_unit()
static result_type unit()
void sample()
sample a measurement
typename trait::units< this_type >::display_type display_unit_type
void stop(const cache_type &_cache)
stop a measurement using the cached data
static auto get_timestamp()
static std::vector< std::string > description_array()
static display_unit_type display_unit()
static std::string description()
static std::string label()
static std::array< double, 2 > unit_array()
I/O counter for chars written. The number of bytes which this task has caused, or shall cause to be w...
static std::vector< std::string > display_unit_array()
static display_unit_type get_display_unit()
void stop(const cache_type &_cache)
stop a measurement using the cached data
static result_type unit()
static std::string label()
typename trait::units< this_type >::display_type display_unit_type
static std::array< double, 2 > unit_array()
void start(const cache_type &_cache)
start a measurement using the cached data
void sample()
sample a measurement
static unit_type get_unit()
static std::vector< std::string > description_array()
std::array< double, 2 > result_type
void sample(const cache_type &_cache)
sample a measurement from cached data
static auto get_timestamp()
static auto get_timing_unit()
static value_type record(const cache_type &_cache)
read the value from cached data
static display_unit_type display_unit()
typename trait::units< this_type >::type unit_type
std::array< int64_t, 2 > value_type
std::string get_display() const
static std::vector< std::string > label_array()
static value_type record()
static std::string description()
static string_t join(SepT &&separator, Tuple &&__tup, index_sequence< Idx... >) noexcept