26 #ifndef Common_System_h
27 #define Common_System_h
31 #include <Common/Version.h>
73 std::lock_guard<std::mutex> lock(
ms_mutex);
86 localtime_r(&now, &tmbuf);
93 _init(install_directory);
117 static std::unique_ptr<ClusterDefinition::ClusterDefinition>
cluster_def;
181 static void _init(
const String &install_directory);
195 #endif // Common_System_h
static const NetStat & net_stat()
Retrieves updated Network statistics (see SystemInfo.h)
static const CpuInfo & cpu_info()
Retrieves updated CPU information (see SystemInfo.h)
A structure to retrieve Swapping statistics (pages swapped in/out, aggregate total numbers etc) ...
static bool ms_initialized
true if initialize was already called
std::string String
A String is simply a typedef to std::string.
static const CpuStat & cpu_stat()
Retrieves updated CPU statistics (see SystemInfo.h)
static String tm_zone
Timezone abbreviation.
static void initialize(const String &install_directory=String())
Initializes the static class members; checks header version vs.
A structure to retrieve CPU statistics (system wide cpu times, idle time etc).
static const ProcInfo & proc_info()
Retrieves updated Process information (see SystemInfo.h)
static const ProcStat & proc_stat()
Retrieves updated Process statistics (see SystemInfo.h)
A structure to retrieve disk statistics (read/write IOPS, transfer rates etc)
static void initialize_tm(struct tm *tmval)
Initialize struct tm.
static int32_t get_processor_count()
The processor count.
static const LoadAvgStat & loadavg_stat()
Retrieves updated Load average statistics (see SystemInfo.h)
static const DiskStat & disk_stat()
Retrieves updated Disk statistics (see SystemInfo.h)
static long tm_gmtoff
Seconds east of UTC.
A structure to retrieve terminal information (lines, columns etc)
static String exe_name
The exe file name.
static const OsInfo & os_info()
Retrieves updated Operating system information (see SystemInfo.h)
A structure to retrieve CPU information (vendor, model, speed, number of cores etc.)
Declarations for ClusterDefinition.
A structure to receive process statistics (CPU user time, system time, virtmal machine sizes etc) ...
static int32_t get_drive_count()
Returns the number of drives.
static std::mutex ms_mutex
a Mutex to protect the static members
A structure to retrieve memory statistics (RAM size, used size, free size etc)
static const SwapStat & swap_stat()
Retrieves updated Swap statistics (see SystemInfo.h)
static const FsStat & fs_stat()
Retrieves updated Filesystem statistics (see SystemInfo.h)
static String locate_install_dir(const char *argv0)
Returns the installation directory.
A structure to retrieve network information (host name, primary interface, primary address...
A structure to retrieve Filesystem statistics (total size, free size, used size etc) ...
A structure to retrieve load average-statistics.
static String install_dir
The installation directory.
A String class based on std::string.
static void _init(const String &install_directory)
Internal initialization helper.
static std::unique_ptr< ClusterDefinition::ClusterDefinition > cluster_def
Cluster definition.
static const TermInfo & term_info()
Retrieves updated Terminal information (see SystemInfo.h)
static int32_t get_pid()
The pid of the current process.
A structure to receive process information (pid, user name, exe name, working directory, program arguments etc)
static const MemStat & mem_stat()
Retrieves updated Memory statistics (see SystemInfo.h)
static const NetInfo & net_info()
Retrieves updated Network information (see SystemInfo.h)
static String _locate_install_dir(const char *argv0)
Returns the installation directory; same as locate_install_dir but does not lock ms_mutex.
A structure to retrieve operating system information (name, version, vendor, architecture) ...
A structure to retrieve network statistics (receiving rate, transmitting rate etc) ...