Timer and resource monitor. More...
#include <resourceMonitor.hh>
Public Member Functions | |
| ResourceMonitor () | |
| Default constructor. | |
| std::ostream & | sample (std::ostream &os) |
| Returns an output stream with resource information. | |
| float | utime () |
Returns the user time since the last call of ResourceMonitor using getrusage. | |
Private Attributes | |
| rusage | ru_ |
| Stores snapshot of resources since construction or last output. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, ResourceMonitor &rm) |
Timer and resource monitor.
hpFEM2d.cc, and hpFEM3d-EV.cc.
Definition at line 27 of file resourceMonitor.hh.
| concepts::ResourceMonitor::ResourceMonitor | ( | ) | [inline] |
Default constructor.
Initializes the timer and resource monitor, ie. fills ru_.
Definition at line 39 of file resourceMonitor.hh.
| std::ostream& concepts::ResourceMonitor::sample | ( | std::ostream & | os | ) |
Returns an output stream with resource information.
There are timing information since construction or last output and memory usage information of the process.
Example:
3.21s [utime = 6.36s, stime = 3.09s, minflt = 0, majflt = 0, maxrss = 0.00KB]
the numbers before the [] gives the user and system time since the last output. The time values in the [] are the cumulated user and system time since the process started.
minflt gives the number of page faults not requiring physical I/O
maxflt gives the number of page faults requiring physical I/O
maxrss gives the memory needed by the process
| float concepts::ResourceMonitor::utime | ( | ) |
Returns the user time since the last call of ResourceMonitor using getrusage.
This is not very precise (1/100 sec).
| std::ostream& operator<< | ( | std::ostream & | os, |
| ResourceMonitor & | rm | ||
| ) | [friend] |
Definition at line 28 of file resourceMonitor.hh.
rusage concepts::ResourceMonitor::ru_ [private] |
Stores snapshot of resources since construction or last output.
Definition at line 34 of file resourceMonitor.hh.