#include <MemUsage.h>
Definition at line 19 of file MemUsage.h.
MemUsage::MemUsage |
( |
const std::string & |
msg = "start" | ) |
|
Definition at line 66 of file MemUsage.cxx.
void msg(const char *fmt,...)
void push(const std::string &msg, MemUsage::memusage mu=memusage(-1,-1))
Definition at line 75 of file MemUsage.cxx.
double memusage_resident()
std::pair< double, double > memusage
Emit a formatted message for the given event index.
Definition at line 110 of file MemUsage.cxx.
112 while (ind < 0) { ind +=
m_events.size();}
113 int prev_ind = ind-1;
114 if (prev_ind<0) prev_ind=0;
116 const memusage& prev_mem = (*this)[prev_ind].first;
117 const memusage& evt_mem = (*this)[ind].first;
118 const string& evt_msg = (*this)[ind].second;
120 memusage from_prev(evt_mem.first - prev_mem.first, evt_mem.second - prev_mem.second);
123 ss <<
"MEM: total: size=" << evt_mem.first <<
"K, res=" << evt_mem.second <<
"K " 124 <<
"increment: size=" << from_prev.first <<
"K, res=" << from_prev.second <<
"K " std::pair< double, double > memusage
std::vector< event > m_events
Record an event.
Definition at line 87 of file MemUsage.cxx.
void msg(const char *fmt,...)
std::string emit(int ind) const
Emit a formatted message for the given event index.
void push(const std::string &msg, MemUsage::memusage mu=memusage(-1,-1))
Return event by index.
Definition at line 94 of file MemUsage.cxx.
96 while (ind < 0) { ind +=
m_events.size();}
std::vector< event > m_events
Definition at line 79 of file MemUsage.cxx.
81 if (mu.first < 0 && mu.second < 0) {
void msg(const char *fmt,...)
std::pair< memusage, std::string > event
std::vector< event > m_events
Return summary up to now.
Definition at line 101 of file MemUsage.cxx.
104 for (
size_t ind=0; ind<
m_events.size(); ++ind) {
105 ss << this->
emit(ind) <<
"\n";
std::string emit(int ind) const
Emit a formatted message for the given event index.
std::vector< event > m_events
The documentation for this class was generated from the following files: