Motion Master
6.0.0-alpha.86
Next-generation motion control software
Loading...
Searching...
No Matches
system_info.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <cstdint>
4
#include <nlohmann/json_fwd.hpp>
5
#include <string>
6
7
namespace
mm::core
{
8
9
// A snapshot of the host OS and hardware Motion Master is running on. Collected on demand for the
10
// Connection page's "System" panel — cheap, uncached. Every field is best-effort: one that cannot
11
// be determined on the current platform is left empty (or zero) rather than failing the snapshot.
12
struct
SystemInfo
{
13
std::string
osName
;
// friendly OS name, e.g. "Ubuntu 24.04 LTS", "Windows", "macOS 14.5"
14
std::string
kernel
;
// kernel/OS build, e.g. "6.8.0-31-generic", "10.0.22631"
15
std::string
architecture
;
// machine architecture, e.g. "x86_64", "aarch64"
16
std::string
hostname
;
// network host name
17
std::string
cpuModel
;
// CPU brand string, e.g. "Intel(R) Core(TM) i7-1185G7"
18
unsigned
cpuCores
= 0;
// logical processor count
19
uint64_t
totalMemoryBytes
= 0;
// total physical RAM in bytes (0 if unknown)
20
uint64_t
diskTotalBytes
= 0;
// capacity of the filesystem holding the working directory
21
uint64_t
diskFreeBytes
= 0;
// space available to an unprivileged process on that filesystem
22
std::string
container
;
// container runtime when running in one ("docker"/"podman"), else ""
23
std::string
dockerVersion
;
// host Docker version from `docker --version`, else ""
24
};
25
26
// Collects a SystemInfo snapshot for the current host. Never throws; unknown fields stay
27
// empty/zero.
28
SystemInfo
collectSystemInfo
();
29
30
// Serialises a snapshot to the JSON shape served by GET /api/system-info (nlohmann ADL hook).
31
void
to_json
(nlohmann::json& j,
const
SystemInfo
&
info
);
32
33
}
// namespace mm::core
info
const EsiObject::Info * info
Value metadata, may be null.
Definition
esi_entry.cc:288
mm::core
Definition
http_server.h:25
mm::core::collectSystemInfo
SystemInfo collectSystemInfo()
Definition
system_info.cc:289
mm::core::to_json
void to_json(nlohmann::json &j, const SystemInfo &info)
Definition
system_info.cc:301
mm::core::SystemInfo
Definition
system_info.h:12
mm::core::SystemInfo::dockerVersion
std::string dockerVersion
Definition
system_info.h:23
mm::core::SystemInfo::cpuModel
std::string cpuModel
Definition
system_info.h:17
mm::core::SystemInfo::diskTotalBytes
uint64_t diskTotalBytes
Definition
system_info.h:20
mm::core::SystemInfo::cpuCores
unsigned cpuCores
Definition
system_info.h:18
mm::core::SystemInfo::hostname
std::string hostname
Definition
system_info.h:16
mm::core::SystemInfo::architecture
std::string architecture
Definition
system_info.h:15
mm::core::SystemInfo::diskFreeBytes
uint64_t diskFreeBytes
Definition
system_info.h:21
mm::core::SystemInfo::container
std::string container
Definition
system_info.h:22
mm::core::SystemInfo::osName
std::string osName
Definition
system_info.h:13
mm::core::SystemInfo::totalMemoryBytes
uint64_t totalMemoryBytes
Definition
system_info.h:19
mm::core::SystemInfo::kernel
std::string kernel
Definition
system_info.h:14
libs
core
system_info.h
Generated by
1.9.8