Update get info
This commit is contained in:
@@ -341,10 +341,19 @@ namespace ANSCENTER
|
||||
// ------------------------------------------------------------------------
|
||||
struct SystemHealthInfo {
|
||||
// CPU
|
||||
double cpuLoadPercent = -1.0; // 0..100, total across all logical cores
|
||||
double cpuTempDegC = -1.0; // -1 if unavailable
|
||||
double cpuFreqGHz = -1.0; // current clock (turbo-aware)
|
||||
std::string cpuModel; // e.g. "Intel(R) Core(TM) i9-..."
|
||||
// cpuLoadPercent — 0..100 always. Source: PDH "% Processor Time".
|
||||
// The right value for "what fraction of CPU time
|
||||
// am I spending in non-idle threads?".
|
||||
// cpuUtilizationPercent — turbo-aware. Source: PDH "% Processor
|
||||
// Utility". Can exceed 100% during sustained turbo
|
||||
// boost. This is what Task Manager displays.
|
||||
// Pick one to bind to the LabVIEW indicator; cpuUtilizationPercent
|
||||
// matches what users see in TM but breaks fixed-range UI scaling.
|
||||
double cpuLoadPercent = -1.0;
|
||||
double cpuUtilizationPercent = -1.0;
|
||||
double cpuTempDegC = -1.0;
|
||||
double cpuFreqGHz = -1.0; // current clock (turbo-aware)
|
||||
std::string cpuModel; // e.g. "Intel(R) Core(TM) i9-..."
|
||||
|
||||
// System memory
|
||||
double memTotalGB = -1.0;
|
||||
@@ -549,33 +558,38 @@ extern "C" __declspec(dllexport) int GetSystemHealthParameters(
|
||||
double* netReceiveSpeedMBs,
|
||||
double* netSendSpeedMBs,
|
||||
LStrHandle gpuName, // primary adapter name (e.g. "NVIDIA RTX 4090"); pass nullptr to skip
|
||||
LStrHandle gpuAdaptersDetail); // per-adapter rollup; pass nullptr to skip — see SystemHealthInfo for format
|
||||
LStrHandle gpuAdaptersDetail, // per-adapter rollup; pass nullptr to skip — see SystemHealthInfo for format
|
||||
double* cpuUtilizationPercent); // turbo-aware "% Processor Utility"; matches Task Manager (may exceed 100)
|
||||
|
||||
// Same payload as GetSystemHealthParameters, packed into a single string with
|
||||
// ';' separators in this exact order:
|
||||
// 1 cpuLoadPercent (%)
|
||||
// 2 cpuTempDegC (°C, -1 if unavailable)
|
||||
// 3 cpuFreqGHz (GHz)
|
||||
// 4 cpuModel (string; any literal ';' in the model is rewritten to ',')
|
||||
// 1 cpuLoadPercent (%; 0..100, "% Processor Time")
|
||||
// 2 cpuTempDegC (°C, -1 if unavailable)
|
||||
// 3 cpuFreqGHz (GHz)
|
||||
// 4 cpuModel (string; any literal ';' is rewritten to ',')
|
||||
// 5 memTotalGB
|
||||
// 6 rssPercent (%)
|
||||
// 7 swapPercent (%)
|
||||
// 8 gpuLoadPercent (%)
|
||||
// 9 valIRSS_MB (current process working set, MB)
|
||||
// 10 valSwap_MB (current process page-file usage, MB)
|
||||
// 11 valIGPU_MB (current process GPU dedicated memory, MB)
|
||||
// 6 rssPercent (%)
|
||||
// 7 swapPercent (%)
|
||||
// 8 gpuLoadPercent (%)
|
||||
// 9 valIRSS_MB (current process working set, MB)
|
||||
// 10 valSwap_MB (current process page-file usage, MB)
|
||||
// 11 valIGPU_MB (current process GPU dedicated memory, MB)
|
||||
// 12 memoryUsedGB
|
||||
// 13 memoryFreeGB
|
||||
// 14 diskLoadPercent (%)
|
||||
// 14 diskLoadPercent (%)
|
||||
// 15 diskReadSpeedMBs
|
||||
// 16 diskWriteSpeedMBs
|
||||
// 17 diskUsedGB
|
||||
// 18 diskTotalGB
|
||||
// 19 netLoadPercent (%)
|
||||
// 19 netLoadPercent (%)
|
||||
// 20 netReceiveSpeedMBs
|
||||
// 21 netSendSpeedMBs
|
||||
// 22 gpuName (primary adapter model, e.g. "NVIDIA RTX 4090")
|
||||
// 23 gpuAdaptersDetail (per-adapter rollup — see SystemHealthInfo struct)
|
||||
// 22 gpuName (primary adapter model, e.g. "NVIDIA RTX 4090")
|
||||
// 23 gpuAdaptersDetail (per-adapter rollup — see SystemHealthInfo struct)
|
||||
// 24 cpuUtilizationPercent (%; turbo-aware, may exceed 100; matches Task Manager)
|
||||
//
|
||||
// New fields are appended at the end so existing parsers stay valid. Fields
|
||||
// 1..23 are stable.
|
||||
// Numbers use the C locale ('.' decimal point) and 2-decimal fixed format.
|
||||
// Any literal ';' in gpuName / gpuAdaptersDetail is rewritten to ',' so the
|
||||
// outer separator is never ambiguous.
|
||||
|
||||
Reference in New Issue
Block a user