11#ifndef __BE_PROCESS_STATISTICS_H__
12#define __BE_PROCESS_STATISTICS_H__
76 &logCabinet,
bool doTasksLogging =
false);
95 const std::shared_ptr<IO::Logsheet> &logSheet,
96 std::optional<std::shared_ptr<IO::Logsheet>>
97 tasksLogSheet = std::nullopt);
157 std::vector<std::tuple<
278 std::shared_ptr<IO::FileLogCabinet> _logCabinet{};
279 std::shared_ptr<IO::Logsheet> _logSheet{};
280 std::optional<std::shared_ptr<IO::Logsheet>>
283 pid_t _loggingTaskID{};
284 bool _doTasksLogging{};
286 pthread_t _loggingThread{};
287 pthread_mutex_t _logMutex{};
The Statistics class provides an interface for gathering process statistics, such as memory usage,...
std::tuple< uint64_t, uint64_t, uint64_t, uint64_t, uint64_t > getMemorySizes()
Obtain the current virtual memory (VM) set sizes for the process, in kilobytes.
void logStats()
Create a snapshot of the current process statistics in the FileLogsheet created in the FileLogCabinet...
std::tuple< uint64_t, uint64_t > getCPUTimes()
Obtain the total user and system times for the process, in microseconds.
uint32_t getNumThreads()
Obtain the number of threads composing this process.
Statistics(const std::shared_ptr< IO::FileLogCabinet > &logCabinet, bool doTasksLogging=false)
Construct a Statistics object with the associated FileLogCabinet.
void startAutoLogging(uint64_t interval)
Start logging process statistics automatically, in intervals of microseconds.
void callStatistics_logStats()
Helper function in C++ space that has access to this object, and is called from C space by the loggin...
std::vector< std::tuple< pid_t, float, float > > getTasksStats()
Obtain the current child tasks statistics for the process.
void stopAutoLogging()
Stop the automatic logging of process statistics.
Statistics()
Constructor with no parameters.
Statistics(const std::shared_ptr< IO::Logsheet > &logSheet, std::optional< std::shared_ptr< IO::Logsheet > > tasksLogSheet=std::nullopt)
Construct a Statistic object that logs to an existing Logsheet.
This software was developed at the National Institute of Standards and Technology (NIST) by employees...