souffle  2.0.2-371-g6315b36
Public Member Functions | Private Attributes
souffle::Logger Class Reference

The class utilized to times for the souffle profiling tool. More...

#include <Logger.h>

Collaboration diagram for souffle::Logger:
Collaboration graph

Public Member Functions

 Logger (std::string label, size_t iteration)
 
 Logger (std::string label, size_t iteration, std::function< size_t()> size)
 
 ~Logger ()
 

Private Attributes

size_t iteration
 
std::string label
 
size_t preSize
 
std::function< size_t()> size
 
time_point start
 
size_t startMaxRSS
 

Detailed Description

The class utilized to times for the souffle profiling tool.

This class is utilized by both – the interpreted and compiled version – to conduct the corresponding measurements.

To far, only execution times are logged. More events, e.g. the number of processed tuples may be added in the future.

Definition at line 44 of file Logger.h.

Constructor & Destructor Documentation

◆ Logger() [1/2]

souffle::Logger::Logger ( std::string  label,
size_t  iteration 
)
inline

Definition at line 53 of file Logger.h.

◆ Logger() [2/2]

souffle::Logger::Logger ( std::string  label,
size_t  iteration,
std::function< size_t()>  size 
)
inline

Definition at line 55 of file Logger.h.

57  {
58 #ifdef WIN32
59  HANDLE hProcess = GetCurrentProcess();
60  PROCESS_MEMORY_COUNTERS processMemoryCounters;
61  GetProcessMemoryInfo(hProcess, &processMemoryCounters, sizeof(processMemoryCounters));
62  size_t endMaxRSS = processMemoryCounters.PeakWorkingSetSize / 1000;
63 #else
64  struct rusage ru {};
65  getrusage(RUSAGE_SELF, &ru);
66  size_t endMaxRSS = ru.ru_maxrss;
67 #endif // WIN32
69  label, start, now(), startMaxRSS, endMaxRSS, size() - preSize, iteration);

◆ ~Logger()

souffle::Logger::~Logger ( )
inline

Definition at line 71 of file Logger.h.

72  :
73  std::string label;
75  size_t startMaxRSS;
76  size_t iteration;
77  std::function<size_t()> size;
78  size_t preSize;
79 };
80 } // end of namespace souffle

Field Documentation

◆ iteration

size_t souffle::Logger::iteration
private

Definition at line 90 of file Logger.h.

◆ label

std::string souffle::Logger::label
private

Definition at line 87 of file Logger.h.

◆ preSize

size_t souffle::Logger::preSize
private

Definition at line 92 of file Logger.h.

◆ size

std::function<size_t()> souffle::Logger::size
private

Definition at line 91 of file Logger.h.

◆ start

time_point souffle::Logger::start
private

Definition at line 88 of file Logger.h.

◆ startMaxRSS

size_t souffle::Logger::startMaxRSS
private

Definition at line 89 of file Logger.h.


The documentation for this class was generated from the following file:
souffle::Logger::preSize
size_t preSize
Definition: Logger.h:92
souffle::Logger::startMaxRSS
size_t startMaxRSS
Definition: Logger.h:89
souffle::ProfileEventSingleton::instance
static ProfileEventSingleton & instance()
get instance
Definition: ProfileEvent.h:70
souffle::Logger::label
std::string label
Definition: Logger.h:87
souffle::Logger::iteration
size_t iteration
Definition: Logger.h:90
souffle::now
time_point now()
Definition: MiscUtil.h:89
souffle::Logger::size
std::function< size_t()> size
Definition: Logger.h:91
souffle::time_point
std::chrono::high_resolution_clock::time_point time_point
Definition: MiscUtil.h:85
souffle::Logger::start
time_point start
Definition: Logger.h:88
souffle::ProfileEventSingleton::makeTimingEvent
void makeTimingEvent(const std::string &txt, time_point start, time_point end, size_t startMaxRSS, size_t endMaxRSS, size_t size, size_t iteration)
create an event for recording start and end times
Definition: ProfileEvent.h:87