timemory  3.2.1
Modular C++ Toolkit for Performance Analysis and Logging. Profiling API and Tools for C, C++, CUDA, Fortran, and Python. The C++ template API is essentially a framework to creating tools: it is designed to provide a unifying interface for recording various performance measurements alongside data logging and interfaces to other tools.
components.hpp
Go to the documentation of this file.
1 // MIT License
2 //
3 // Copyright (c) 2020, The Regents of the University of California,
4 // through Lawrence Berkeley National Laboratory (subject to receipt of any
5 // required approvals from the U.S. Dept. of Energy). All rights reserved.
6 //
7 // Permission is hereby granted, free of charge, to any person obtaining a copy
8 // of this software and associated documentation files (the "Software"), to deal
9 // in the Software without restriction, including without limitation the rights
10 // to use, copy, modify, merge, publish, distribute, sublicense, and
11 // copies of the Software, and to permit persons to whom the Software is
12 // furnished to do so, subject to the following conditions:
13 //
14 // The above copyright notice and this permission notice shall be included in all
15 // copies or substantial portions of the Software.
16 //
17 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 // SOFTWARE.
24 
25 #pragma once
26 
28 #include "timemory/components/rusage/backends.hpp"
30 #include "timemory/components/timing/backends.hpp"
32 #include "timemory/units.hpp"
33 
34 namespace tim
35 {
36 namespace component
37 {
38 //--------------------------------------------------------------------------------------//
39 //
40 // Resource Usage types
41 //
42 //--------------------------------------------------------------------------------------//
43 /// \struct tim::component::peak_rss
44 /// \brief
45 /// this struct extracts the high-water mark (or a change in the high-water mark) of
46 /// the resident set size (RSS). Which is current amount of memory in RAM.
47 /// When used on a system with swap enabled, this value may fluctuate but should not
48 /// on an HPC system.
49 //
50 struct peak_rss : public base<peak_rss>
51 {
52  static std::string label() { return "peak_rss"; }
54  {
55  return "Measures changes in the high-water mark for the amount of memory "
56  "allocated in RAM. May fluctuate if swap is enabled";
57  }
58  static value_type record() { return get_peak_rss(); }
59  TIMEMORY_NODISCARD double get() const
60  {
61  auto val = base_type::load();
62  return val / static_cast<double>(base_type::get_unit());
63  }
64  TIMEMORY_NODISCARD double get_display() const { return get(); }
65 
66  void start() { value = record(); }
67  void stop()
68  {
69  value = (record() - value);
70  accum += value;
71  }
72 
73  /// sample a measurement
74  void sample() { accum = value = std::max<int64_t>(value, record()); }
75 
76  /// sample a measurement from cached data
77  void sample(const cache_type& _cache)
78  {
79  accum = value = std::max<int64_t>(value, record(_cache));
80  }
81 
82  /// read the value from cached data
83  static value_type record(const cache_type& _cache) { return _cache.get_peak_rss(); }
84 
85  /// start a measurement using the cached data
86  void start(const cache_type& _cache) { value = record(_cache); }
87 
88  /// stop a measurement using the cached data
89  void stop(const cache_type& _cache)
90  {
91  auto tmp = record(_cache);
92  auto delta = tmp - value;
93  accum = std::max(static_cast<const value_type&>(accum), delta);
94  value = tmp;
95  }
96 };
97 
98 //--------------------------------------------------------------------------------------//
99 /// \struct tim::component::page_rss
100 /// \brief
101 /// this struct measures the resident set size (RSS) currently allocated in pages of
102 /// memory. Unlike the peak_rss, this value will fluctuate as memory gets freed and
103 /// allocated
104 //
105 struct page_rss : public base<page_rss, int64_t>
106 {
107  using value_type = int64_t;
108  using result_type = double;
111 
112  static std::string label() { return "page_rss"; }
114  {
115  return "Amount of memory allocated in pages of memory. Unlike peak_rss, value "
116  "will fluctuate as memory is freed/allocated";
117  }
118  static value_type record() { return get_page_rss(); }
119  TIMEMORY_NODISCARD double get() const
120  {
121  auto val = base_type::load();
122  return val / static_cast<double>(base_type::get_unit());
123  }
124  TIMEMORY_NODISCARD double get_display() const { return get(); }
125  void start() { value = record(); }
126  void stop()
127  {
128  value = (record() - value);
129  accum += value;
130  }
131  void sample() { accum = value = std::max<int64_t>(value, record()); }
132 };
133 
134 //--------------------------------------------------------------------------------------//
135 /// \struct tim::component::num_io_in
136 /// \brief
137 /// the number of times the file system had to perform input.
138 //
139 struct num_io_in : public base<num_io_in>
140 {
141  using value_type = int64_t;
143 
144  static const short precision = 0;
145  static const short width = 3;
146  static const std::ios_base::fmtflags format_flags = {};
147 
148  static std::string label() { return "io_in"; }
150  {
151  return "Number of times the filesystem had to perform input";
152  }
153  static value_type record() { return get_num_io_in(); }
154  TIMEMORY_NODISCARD value_type get() const
155  {
156  auto val = base_type::load();
157  return val;
158  }
159  TIMEMORY_NODISCARD value_type get_display() const { return get(); }
160  void start() { value = record(); }
161  void stop()
162  {
163  value = (record() - value);
164  accum += value;
165  }
166 
167  static value_type record(const cache_type& _cache) { return _cache.get_num_io_in(); }
168 
169  void start(const cache_type& _cache) { value = record(_cache); }
170 
171  void stop(const cache_type& _cache)
172  {
173  auto tmp = record(_cache);
174  accum += (tmp - value);
175  value = tmp;
176  }
177 };
178 
179 //--------------------------------------------------------------------------------------//
180 /// \struct tim::component::num_io_out
181 /// \brief
182 /// the number of times the file system had to perform output.
183 //
184 struct num_io_out : public base<num_io_out>
185 {
186  using value_type = int64_t;
188 
189  static const short precision = 0;
190  static const short width = 3;
191  static const std::ios_base::fmtflags format_flags = {};
192 
193  static std::string label() { return "io_out"; }
195  {
196  return "Number of times the filesystem had to perform output";
197  }
198  static value_type record() { return get_num_io_out(); }
199  TIMEMORY_NODISCARD value_type get() const
200  {
201  auto val = base_type::load();
202  return val;
203  }
204  TIMEMORY_NODISCARD value_type get_display() const { return get(); }
205  void start() { value = record(); }
206  void stop()
207  {
208  value = (record() - value);
209  accum += value;
210  }
211 
212  static value_type record(const cache_type& _cache) { return _cache.get_num_io_out(); }
213 
214  void start(const cache_type& _cache) { value = record(_cache); }
215 
216  void stop(const cache_type& _cache)
217  {
218  auto tmp = record(_cache);
219  accum += (tmp - value);
220  value = tmp;
221  }
222 };
223 
224 //--------------------------------------------------------------------------------------//
225 /// \struct tim::component::num_minor_page_faults
226 /// \brief
227 /// the number of page faults serviced without any I/O activity; here I/O activity is
228 /// avoided by reclaiming a page frame from the list of pages awaiting reallocation.
229 //
230 struct num_minor_page_faults : public base<num_minor_page_faults>
231 {
232  using value_type = int64_t;
234 
235  static const short precision = 0;
236  static const short width = 3;
237  static const std::ios_base::fmtflags format_flags = {};
238 
239  static std::string label() { return "minor_page_flts"; }
241  {
242  return "Number of page faults serviced without any I/O activity via 'reclaiming' "
243  "a page frame from the list of pages awaiting reallocation";
244  }
245  static value_type record() { return get_num_minor_page_faults(); }
246  TIMEMORY_NODISCARD value_type get() const
247  {
248  auto val = base_type::load();
249  return val;
250  }
251  TIMEMORY_NODISCARD value_type get_display() const { return get(); }
252  void start() { value = record(); }
253  void stop()
254  {
255  value = (record() - value);
256  accum += value;
257  }
258 
259  static value_type record(const cache_type& _cache)
260  {
261  return _cache.get_num_minor_page_faults();
262  }
263 
264  void start(const cache_type& _cache) { value = record(_cache); }
265 
266  void stop(const cache_type& _cache)
267  {
268  auto tmp = record(_cache);
269  accum += (tmp - value);
270  value = tmp;
271  }
272 };
273 
274 //--------------------------------------------------------------------------------------//
275 /// \struct tim::component::num_major_page_faults
276 /// \brief
277 /// the number of page faults serviced that required I/O activity.
278 //
279 struct num_major_page_faults : public base<num_major_page_faults>
280 {
281  using value_type = int64_t;
283 
284  static const short precision = 0;
285  static const short width = 3;
286  static const std::ios_base::fmtflags format_flags = {};
287 
288  static std::string label() { return "major_page_flts"; }
290  {
291  return "Number of page faults serviced that required I/O activity";
292  }
293  static value_type record() { return get_num_major_page_faults(); }
294  TIMEMORY_NODISCARD value_type get() const
295  {
296  auto val = base_type::load();
297  return val;
298  }
299  TIMEMORY_NODISCARD value_type get_display() const { return get(); }
300  void start() { value = record(); }
301  void stop()
302  {
303  value = (record() - value);
304  accum += value;
305  }
306 
307  static value_type record(const cache_type& _cache)
308  {
309  return _cache.get_num_major_page_faults();
310  }
311 
312  void start(const cache_type& _cache) { value = record(_cache); }
313 
314  void stop(const cache_type& _cache)
315  {
316  auto tmp = record(_cache);
317  accum += (tmp - value);
318  value = tmp;
319  }
320 };
321 
322 //--------------------------------------------------------------------------------------//
323 /// \struct tim::component::voluntary_context_switch
324 /// \brief
325 /// the number of times a context switch resulted due to a process voluntarily giving up
326 /// the processor before its time slice was completed (usually to await availability of a
327 /// resource).
328 //
329 struct voluntary_context_switch : public base<voluntary_context_switch>
330 {
331  using value_type = int64_t;
333 
334  static const short precision = 0;
335  static const short width = 3;
336  static const std::ios_base::fmtflags format_flags = {};
337 
338  static std::string label() { return "vol_cxt_swch"; }
340  {
341  return "Number of context switches due to a process voluntarily giving up the "
342  "processor before its time slice was completed";
343  }
344  static value_type record() { return get_num_voluntary_context_switch(); }
345  TIMEMORY_NODISCARD value_type get_display() const
346  {
347  auto val = base_type::load();
348  return val;
349  }
350  TIMEMORY_NODISCARD value_type get() const { return get_display(); }
351  void start() { value = record(); }
352  void stop()
353  {
354  value = (record() - value);
355  accum += value;
356  }
357 
358  static value_type record(const cache_type& _cache)
359  {
360  return _cache.get_num_voluntary_context_switch();
361  }
362 
363  void start(const cache_type& _cache) { value = record(_cache); }
364 
365  void stop(const cache_type& _cache)
366  {
367  auto tmp = record(_cache);
368  accum += (tmp - value);
369  value = tmp;
370  }
371 };
372 
374 
375 //--------------------------------------------------------------------------------------//
376 /// \struct tim::component::priority_context_switch
377 /// \brief
378 /// the number of times a context switch resulted due to a higher priority process
379 /// becoming runnable or because the current process exceeded its time slice
380 //
381 struct priority_context_switch : public base<priority_context_switch>
382 {
383  using value_type = int64_t;
385 
386  static const short precision = 0;
387  static const short width = 3;
388  static const std::ios_base::fmtflags format_flags = {};
389 
390  static std::string label() { return "prio_cxt_swch"; }
392  {
393  return "Number of context switch due to higher priority process becoming runnable"
394  " or because the current process exceeded its time slice";
395  }
396  static value_type record() { return get_num_priority_context_switch(); }
397  TIMEMORY_NODISCARD value_type get_display() const
398  {
399  auto val = base_type::load();
400  return val;
401  }
402  TIMEMORY_NODISCARD value_type get() const { return get_display(); }
403  void start() { value = record(); }
404  void stop()
405  {
406  value = (record() - value);
407  accum += value;
408  }
409 
410  static value_type record(const cache_type& _cache)
411  {
412  return _cache.get_num_priority_context_switch();
413  }
414 
415  void start(const cache_type& _cache) { value = record(_cache); }
416 
417  void stop(const cache_type& _cache)
418  {
419  auto tmp = record(_cache);
420  accum += (tmp - value);
421  value = tmp;
422  }
423 };
424 
426 
427 //--------------------------------------------------------------------------------------//
428 /// \struct tim::component::virtual_memory
429 /// \brief
430 /// this struct extracts the virtual memory usage
431 //
432 struct virtual_memory : public base<virtual_memory>
433 {
434  using value_type = int64_t;
436 
437  static std::string label() { return "virtual_memory"; }
438  static std::string description() { return "Records the change in virtual memory"; }
439  static value_type record() { return get_virt_mem(); }
440  TIMEMORY_NODISCARD double get() const
441  {
442  auto val = base_type::load();
443  return val / static_cast<double>(base_type::get_unit());
444  }
445  TIMEMORY_NODISCARD double get_display() const { return get(); }
446  void start() { value = record(); }
447  void stop()
448  {
449  value = (record() - value);
450  accum += value;
451  }
452  void sample() { accum = value = std::max<int64_t>(value, record()); }
453 };
454 
455 //--------------------------------------------------------------------------------------//
456 /// \struct tim::component::user_mode_time
457 /// \brief This is the total amount of time spent executing in user mode
458 //
459 struct user_mode_time : public base<user_mode_time, int64_t>
460 {
461  using ratio_t = std::micro;
462  using value_type = int64_t;
465 
466  static std::string label() { return "user_mode"; }
468  {
469  return "CPU time spent executing in user mode (via rusage)";
470  }
471  static value_type record() { return get_user_mode_time(); }
472 
473  TIMEMORY_NODISCARD double get_display() const { return get(); }
474  TIMEMORY_NODISCARD double get() const
475  {
476  auto val = base_type::load();
477  return static_cast<double>(val) / ratio_t::den * get_unit();
478  }
479 
480  void start() { value = record(); }
481 
482  void stop()
483  {
484  auto tmp = record();
485  if(tmp > value)
486  {
487  value = (tmp - value);
488  accum += value;
489  }
490  }
491 
492  static value_type record(const cache_type& _cache)
493  {
494  return _cache.get_user_mode_time();
495  }
496 
497  void start(const cache_type& _cache) { value = record(_cache); }
498 
499  void stop(const cache_type& _cache)
500  {
501  auto tmp = record(_cache);
502  if(tmp > value)
503  {
504  accum += (tmp - value);
505  value = tmp;
506  }
507  }
508 };
509 
510 //--------------------------------------------------------------------------------------//
511 /// \struct tim::component::kernel_mode_time
512 /// \brief This is the total amount of time spent executing in kernel mode
513 //
514 struct kernel_mode_time : public base<kernel_mode_time, int64_t>
515 {
516  using ratio_t = std::micro;
517  using value_type = int64_t;
520 
521  static std::string label() { return "kernel_mode"; }
523  {
524  return "CPU time spent executing in kernel mode (via rusage)";
525  }
526  static value_type record() { return get_kernel_mode_time(); }
527 
528  TIMEMORY_NODISCARD double get_display() const { return get(); }
529  TIMEMORY_NODISCARD double get() const
530  {
531  auto val = base_type::load();
532  return static_cast<double>(val) / ratio_t::den * get_unit();
533  }
534 
535  void start() { value = record(); }
536 
537  void stop()
538  {
539  auto tmp = record();
540  if(tmp > value)
541  {
542  value = (tmp - value);
543  accum += value;
544  }
545  }
546 
547  static value_type record(const cache_type& _cache)
548  {
549  return _cache.get_kernel_mode_time();
550  }
551 
552  void start(const cache_type& _cache) { value = record(_cache); }
553 
554  void stop(const cache_type& _cache)
555  {
556  auto tmp = record(_cache);
557  if(tmp > value)
558  {
559  accum += (tmp - value);
560  value = tmp;
561  }
562  }
563 };
564 
565 //--------------------------------------------------------------------------------------//
566 /// \struct tim::component::current_peak_rss
567 /// \brief
568 /// this struct extracts the absolute value of high-water mark of the resident set size
569 /// (RSS) at start and stop points. RSS is current amount of memory in RAM.
570 //
571 struct current_peak_rss : public base<current_peak_rss, std::pair<int64_t, int64_t>>
572 {
573  using unit_type = std::pair<int64_t, int64_t>;
574  using display_unit_type = std::pair<std::string, std::string>;
575  using result_type = std::pair<double, double>;
577 
578  static std::string label() { return "current_peak_rss"; }
580  {
581  return "Absolute value of high-water mark of memory allocation in RAM";
582  }
583 
584  static value_type record() { return value_type{ get_peak_rss(), 0 }; }
585 
586  void start() { value = record(); }
587 
588  void stop()
589  {
590  using namespace tim::component::operators;
591  value = value_type{ value.first, record().first };
592  accum = std::max(accum, value);
593  }
594 
595  static value_type record(const cache_type& _cache)
596  {
597  return value_type{ _cache.get_peak_rss(), 0 };
598  }
599 
600  void start(const cache_type& _cache) { value = record(_cache); }
601 
602  void stop(const cache_type& _cache)
603  {
604  value = value_type{ value.first, record(_cache).first };
605  accum = std::max(accum, value);
606  }
607 
608 public:
609  TIMEMORY_NODISCARD std::string get_display() const
610  {
611  std::stringstream ss;
612  std::stringstream ssv;
613  std::stringstream ssr;
614  auto _prec = base_type::get_precision();
615  auto _width = base_type::get_width();
616  auto _flags = base_type::get_format_flags();
617  auto _disp = get_display_unit();
618 
619  auto _val = get();
620 
621  ssv.setf(_flags);
622  ssv << std::setw(_width) << std::setprecision(_prec) << std::get<0>(_val);
623  if(!std::get<0>(_disp).empty())
624  ssv << " " << std::get<0>(_disp);
625 
626  ssr.setf(_flags);
627  ssr << std::setw(_width) << std::setprecision(_prec) << std::get<1>(_val);
628  if(!std::get<1>(_disp).empty())
629  ssr << " " << std::get<1>(_disp);
630 
631  ss << ssv.str() << ", " << ssr.str();
632  return ss.str();
633  }
634 
635  TIMEMORY_NODISCARD result_type get() const
636  {
637  result_type data = base_type::load();
638  data.first /= get_unit().first;
639  data.second /= get_unit().second;
640  return data;
641  }
642 
643  static std::pair<double, double> unit()
644  {
645  return std::pair<double, double>{ units::megabyte, units::megabyte };
646  }
647 
648  static std::vector<std::string> display_unit_array()
649  {
650  return std::vector<std::string>{ get_display_unit().first,
651  get_display_unit().second };
652  }
653 
654  static std::vector<std::string> label_array()
655  {
656  return std::vector<std::string>{ "start peak rss", " stop peak rss" };
657  }
658 
659  static display_unit_type display_unit() { return display_unit_type{ "MB", "MB" }; }
660 
661  static std::pair<double, double> unit_array() { return unit(); }
662 
663  static std::vector<std::string> description_array()
664  {
665  return std::vector<std::string>{ "Resident set size at start",
666  "Resident set size at stop" };
667  }
668 
670  {
671  static auto _instance = this_type::unit();
672  static auto& _mem = _instance;
673 
674  if(settings::memory_units().length() > 0)
675  {
676  _mem.first = std::get<1>(units::get_memory_unit(settings::memory_units()));
677  _mem.second = std::get<1>(units::get_memory_unit(settings::memory_units()));
678  }
679 
680  return _mem;
681  }
682 
684  {
685  static display_unit_type _instance = this_type::display_unit();
686  static auto& _mem = _instance;
687 
688  if(settings::memory_units().length() > 0)
689  {
690  _mem.first = std::get<0>(units::get_memory_unit(settings::memory_units()));
691  _mem.second = std::get<0>(units::get_memory_unit(settings::memory_units()));
692  }
693 
694  return _mem;
695  }
696 };
697 
698 //--------------------------------------------------------------------------------------//
699 } // namespace component
700 } // namespace tim
701 //
702 //======================================================================================//
void load(Archive &ar, tim::node::graph< Tp > &d)
Definition: node.hpp:520
std::tuple< std::string, int64_t > get_memory_unit(std::string _unit)
Definition: units.hpp:188
Definition: kokkosp.cpp:38
memory_units
Definition: settings.cpp:1351
tim::mpl::apply< std::string > string
Definition: macros.hpp:52
The declaration for the types for settings without definitions.
decltype(auto) load()
static int64_t get_unit()
typename trait::cache< peak_rss >::type cache_type
Definition: declaration.hpp:85
this struct extracts the absolute value of high-water mark of the resident set size (RSS) at start an...
Definition: components.hpp:572
static std::pair< double, double > unit()
Definition: components.hpp:643
std::pair< int64_t, int64_t > unit_type
Definition: components.hpp:573
static display_unit_type get_display_unit()
Definition: components.hpp:683
static std::vector< std::string > display_unit_array()
Definition: components.hpp:648
void stop(const cache_type &_cache)
Definition: components.hpp:602
std::pair< std::string, std::string > display_unit_type
Definition: components.hpp:574
std::string get_display() const
Definition: components.hpp:609
std::pair< double, double > result_type
Definition: components.hpp:575
void start(const cache_type &_cache)
Definition: components.hpp:600
static display_unit_type display_unit()
Definition: components.hpp:659
static std::string label()
Definition: components.hpp:578
static std::vector< std::string > label_array()
Definition: components.hpp:654
static value_type record(const cache_type &_cache)
Definition: components.hpp:595
static std::pair< double, double > unit_array()
Definition: components.hpp:661
static std::string description()
Definition: components.hpp:579
static std::vector< std::string > description_array()
Definition: components.hpp:663
This is the total amount of time spent executing in kernel mode.
Definition: components.hpp:515
static value_type record(const cache_type &_cache)
Definition: components.hpp:547
void start(const cache_type &_cache)
Definition: components.hpp:552
static std::string description()
Definition: components.hpp:522
void stop(const cache_type &_cache)
Definition: components.hpp:554
static std::string label()
Definition: components.hpp:521
the number of times the file system had to perform input.
Definition: components.hpp:140
static value_type record(const cache_type &_cache)
Definition: components.hpp:167
static std::string label()
Definition: components.hpp:148
static const std::ios_base::fmtflags format_flags
Definition: components.hpp:146
value_type get_display() const
Definition: components.hpp:159
void stop(const cache_type &_cache)
Definition: components.hpp:171
static const short width
Definition: components.hpp:145
void start(const cache_type &_cache)
Definition: components.hpp:169
static value_type record()
Definition: components.hpp:153
static const short precision
Definition: components.hpp:144
static std::string description()
Definition: components.hpp:149
value_type get() const
Definition: components.hpp:154
the number of times the file system had to perform output.
Definition: components.hpp:185
static value_type record(const cache_type &_cache)
Definition: components.hpp:212
void stop(const cache_type &_cache)
Definition: components.hpp:216
value_type get_display() const
Definition: components.hpp:204
static std::string label()
Definition: components.hpp:193
static std::string description()
Definition: components.hpp:194
void start(const cache_type &_cache)
Definition: components.hpp:214
static const std::ios_base::fmtflags format_flags
Definition: components.hpp:191
static const short precision
Definition: components.hpp:189
static value_type record()
Definition: components.hpp:198
static const short width
Definition: components.hpp:190
value_type get() const
Definition: components.hpp:199
the number of page faults serviced that required I/O activity.
Definition: components.hpp:280
void start(const cache_type &_cache)
Definition: components.hpp:312
void stop(const cache_type &_cache)
Definition: components.hpp:314
static const std::ios_base::fmtflags format_flags
Definition: components.hpp:286
static value_type record(const cache_type &_cache)
Definition: components.hpp:307
the number of page faults serviced without any I/O activity; here I/O activity is avoided by reclaimi...
Definition: components.hpp:231
static const std::ios_base::fmtflags format_flags
Definition: components.hpp:237
void stop(const cache_type &_cache)
Definition: components.hpp:266
static value_type record(const cache_type &_cache)
Definition: components.hpp:259
void start(const cache_type &_cache)
Definition: components.hpp:264
this struct measures the resident set size (RSS) currently allocated in pages of memory....
Definition: components.hpp:106
static std::string label()
Definition: components.hpp:112
double get_display() const
Definition: components.hpp:124
static std::string description()
Definition: components.hpp:113
static value_type record()
Definition: components.hpp:118
this struct extracts the high-water mark (or a change in the high-water mark) of the resident set siz...
Definition: components.hpp:51
static value_type record(const cache_type &_cache)
read the value from cached data
Definition: components.hpp:83
double get_display() const
Definition: components.hpp:64
void stop(const cache_type &_cache)
stop a measurement using the cached data
Definition: components.hpp:89
static std::string label()
Definition: components.hpp:52
void start(const cache_type &_cache)
start a measurement using the cached data
Definition: components.hpp:86
void sample()
sample a measurement
Definition: components.hpp:74
static value_type record()
Definition: components.hpp:58
static std::string description()
Definition: components.hpp:53
void sample(const cache_type &_cache)
sample a measurement from cached data
Definition: components.hpp:77
the number of times a context switch resulted due to a higher priority process becoming runnable or b...
Definition: components.hpp:382
static value_type record(const cache_type &_cache)
Definition: components.hpp:410
void start(const cache_type &_cache)
Definition: components.hpp:415
static const std::ios_base::fmtflags format_flags
Definition: components.hpp:388
void stop(const cache_type &_cache)
Definition: components.hpp:417
This is the total amount of time spent executing in user mode.
Definition: components.hpp:460
static value_type record(const cache_type &_cache)
Definition: components.hpp:492
void start(const cache_type &_cache)
Definition: components.hpp:497
void stop(const cache_type &_cache)
Definition: components.hpp:499
static value_type record()
Definition: components.hpp:471
static std::string label()
Definition: components.hpp:466
static std::string description()
Definition: components.hpp:467
this struct extracts the virtual memory usage
Definition: components.hpp:433
static std::string label()
Definition: components.hpp:437
static value_type record()
Definition: components.hpp:439
static std::string description()
Definition: components.hpp:438
the number of times a context switch resulted due to a process voluntarily giving up the processor be...
Definition: components.hpp:330
void start(const cache_type &_cache)
Definition: components.hpp:363
static value_type record(const cache_type &_cache)
Definition: components.hpp:358
void stop(const cache_type &_cache)
Definition: components.hpp:365
static const std::ios_base::fmtflags format_flags
Definition: components.hpp:336