casa
5.7.0-16
|
Used to report time and memory measurements. More...
#include <PlotLogger.h>
Public Types | |
enum | TimeUnit { SECOND } |
Static //. More... | |
enum | MemoryUnit { BYTE, KILOBYTE, MEGABYTE } |
Available memory units. More... | |
Public Types inherited from casacore::LogMessage | |
enum | Priority { DEBUGGING, DEBUG2, DEBUG1, NORMAL5, NORMAL4, NORMAL3, NORMAL2, NORMAL1, NORMAL, WARN, SEVERE } |
An "importance" which is assigned to each LogMessage. More... | |
Public Member Functions | |
PlotLogMeasurement (const casacore::String &origin1, const casacore::String &origin2, TimeUnit timeUnit=DEFAULT_TIME_UNIT, MemoryUnit memoryUnit=DEFAULT_MEMORY_UNIT, int eventType=DEFAULT_EVENT_TYPE) | |
Non-Static //. More... | |
PlotLogMeasurement (const PlotLogMeasurement ©) | |
Copy constructor. More... | |
~PlotLogMeasurement () | |
Destructor. More... | |
time_t | startTime () const |
Returns the time/memory when the measurement started. More... | |
unsigned int | startMemory () const |
double | time () const |
Returns the time/memory difference between when the measurement started and when the measurement ended. More... | |
double | memory () const |
TimeUnit | timeUnit () const |
Returns the time/memory units for this measurement. More... | |
MemoryUnit | memoryUnit () const |
void | startMeasurement () |
Starts the measurement by setting the start time and memory. More... | |
void | stopMeasurement () |
Calculates the measurements from the last starting point to this point, and generates the log message. More... | |
Public Member Functions inherited from casa::PlotLogMessage | |
PlotLogMessage (int eventType=DEFAULT_EVENT_TYPE) | |
Non-Static //. More... | |
PlotLogMessage (const casacore::String &origin1, const casacore::String &origin2, int eventType=DEFAULT_EVENT_TYPE) | |
Constructor which takes the origin(s) and an optional priority. More... | |
PlotLogMessage (const casacore::String &origin1, const casacore::String &origin2, const casacore::String &message, int eventType=DEFAULT_EVENT_TYPE) | |
Constructor which takes the origin(s), the message, and an optional priority. More... | |
PlotLogMessage (const PlotLogMessage ©) | |
Copy constructor. More... | |
virtual | ~PlotLogMessage () |
Destructor. More... | |
virtual int | eventType () const |
Returns the event type of this message. More... | |
Public Member Functions inherited from casacore::LogMessage | |
LogMessage (Priority priority=NORMAL) | |
Create a message with the given priority and the current time, and an empty origin and message. More... | |
LogMessage (const LogOrigin &sourceLocation, Priority priority=NORMAL) | |
Create a message with the given location and priority, the current time and an empty message. More... | |
LogMessage (const String &message, const LogOrigin &sourceLocation, Priority=NORMAL) | |
Create a completely filled out LogMessage. More... | |
LogMessage (const LogMessage &other) | |
Make this LogMessage a copy of other . More... | |
LogMessage & | operator= (const LogMessage &other) |
~LogMessage () | |
const String & | message () const |
Get the message text. More... | |
LogMessage & | message (const String &message, Bool keepLastTime=False) |
Set the message text. More... | |
uInt | line () const |
Get and set the line number in the LogOrigin. More... | |
LogMessage & | line (uInt which) |
LogMessage & | sourceLocation (const SourceLocation *where) |
Set the source location - usually this will be called with the macro WHERE. More... | |
const LogOrigin & | origin () const |
Get and set the origin of this LogMessage. More... | |
LogMessage & | origin (const LogOrigin &origin) |
Priority | priority () const |
Get or change the priority of this LogMessage. More... | |
LogMessage & | priority (Priority which) |
const Time & | messageTime () const |
Returns the time at which the message text was created. More... | |
LogMessage & | messageTime (const Time &theTime) |
Normally you should not manually set the time, however there may be rare circumstances where it is useful - for example if you have a single static message that you want to send out at various times. More... | |
String | toString () const |
Turn this entire LogMessage into a String. More... | |
String | toTermString () const |
Static Public Member Functions | |
static casacore::String | timeUnits (TimeUnit t) |
Get a string representation of the given time/memory unit. More... | |
static casacore::String | memoryUnits (MemoryUnit m) |
Static Public Member Functions inherited from casacore::LogMessage | |
static const String & | toString (Priority which) |
Map the given priority into a String - so, for example, it can be stored in a table. More... | |
Static Public Attributes | |
static const TimeUnit | DEFAULT_TIME_UNIT |
Default units. More... | |
static const MemoryUnit | DEFAULT_MEMORY_UNIT |
Static Public Attributes inherited from casa::PlotLogMessage | |
static const int | DEFAULT_EVENT_TYPE |
Static //. More... | |
Private Attributes | |
time_t | m_startTime |
Start time. More... | |
unsigned int | m_startMemory |
Start memory. More... | |
double | m_time |
casacore::Time and memory differences More... | |
double | m_memory |
TimeUnit | m_timeUnit |
casacore::Time unit More... | |
MemoryUnit | m_memoryUnit |
casacore::Memory unit More... | |
Additional Inherited Members | |
Protected Attributes inherited from casa::PlotLogMessage | |
int | m_eventType |
Event type, either a value from PlotLogger::Event, or a custom user-defined value. More... | |
Used to report time and memory measurements.
This functionality can be accessed either directly with a PlotLogMeasurement object or indirectly through the PlotLogger class. Message is: END.: [time] [timeUnits]. casacore::Memory: [memory] [memoryUnits]. If the measurement has not been ended, calls stopMeasurement() first.
Definition at line 92 of file PlotLogger.h.
Available memory units.
Enumerator | |
---|---|
BYTE | |
KILOBYTE | |
MEGABYTE |
Definition at line 103 of file PlotLogger.h.
Static //.
Available time units. Currently only seconds because that's all that C++ natively supports.
Enumerator | |
---|---|
SECOND |
Definition at line 98 of file PlotLogger.h.
casa::PlotLogMeasurement::PlotLogMeasurement | ( | const casacore::String & | origin1, |
const casacore::String & | origin2, | ||
TimeUnit | timeUnit = DEFAULT_TIME_UNIT , |
||
MemoryUnit | memoryUnit = DEFAULT_MEMORY_UNIT , |
||
int | eventType = DEFAULT_EVENT_TYPE |
||
) |
Non-Static //.
Constructor which takes the origin(s), optional time and memory units, and an optional priority. Also calls startMeasurement().
casa::PlotLogMeasurement::PlotLogMeasurement | ( | const PlotLogMeasurement & | copy | ) |
Copy constructor.
casa::PlotLogMeasurement::~PlotLogMeasurement | ( | ) |
Destructor.
double casa::PlotLogMeasurement::memory | ( | ) | const |
MemoryUnit casa::PlotLogMeasurement::memoryUnit | ( | ) | const |
|
static |
void casa::PlotLogMeasurement::startMeasurement | ( | ) |
Starts the measurement by setting the start time and memory.
Measurement automatically begins when the object is constructed, but can be restarted as desired.
unsigned int casa::PlotLogMeasurement::startMemory | ( | ) | const |
time_t casa::PlotLogMeasurement::startTime | ( | ) | const |
Returns the time/memory when the measurement started.
void casa::PlotLogMeasurement::stopMeasurement | ( | ) |
Calculates the measurements from the last starting point to this point, and generates the log message.
double casa::PlotLogMeasurement::time | ( | ) | const |
Returns the time/memory difference between when the measurement started and when the measurement ended.
Invalid if the measurement was never started and ended.
TimeUnit casa::PlotLogMeasurement::timeUnit | ( | ) | const |
Returns the time/memory units for this measurement.
|
static |
Get a string representation of the given time/memory unit.
|
static |
Definition at line 110 of file PlotLogger.h.
|
static |
Default units.
Definition at line 109 of file PlotLogger.h.
|
private |
Definition at line 173 of file PlotLogger.h.
|
private |
casacore::Memory unit
Definition at line 179 of file PlotLogger.h.
|
private |
Start memory.
Definition at line 170 of file PlotLogger.h.
|
private |
Start time.
Definition at line 167 of file PlotLogger.h.
|
private |
casacore::Time and memory differences
Definition at line 173 of file PlotLogger.h.
|
private |
casacore::Time unit
Definition at line 176 of file PlotLogger.h.