4#ifndef _Stroika_Framework_SystemPerformance_Instruments_CPU_h_
5#define _Stroika_Framework_SystemPerformance_Instruments_CPU_h_ 1
7#include "Stroika/Frameworks/StroikaPreComp.h"
11#include "Stroika/Foundation/DataExchange/ObjectVariantMapper.h"
13#include "Stroika/Frameworks/SystemPerformance/Instrument.h"
27namespace Stroika::Frameworks::SystemPerformance::Instruments::CPU {
30#ifndef qSupport_SystemPerformance_Instruments_CPU_LoadAverage
31#define qSupport_SystemPerformance_Instruments_CPU_LoadAverage \
32 (qStroika_Foundation_Common_Platform_Linux or qStroika_Foundation_Common_Platform_MacOS)
35 using DataExchange::ObjectVariantMapper;
41#if qSupport_SystemPerformance_Instruments_CPU_LoadAverage
45 double f15MinuteAve{};
47 optional<LoadAverage> fLoadAverage;
58 optional<unsigned int> fTotalLogicalCores{};
66 optional<double> fTotalCPUUsage{};
71 optional<double> GetTotalCPURatio ()
const
73 if (fTotalLogicalCores and fTotalCPUUsage) {
74 return *fTotalCPUUsage / *fTotalLogicalCores;
90 optional<double> fTotalProcessCPUUsage{};
95 optional<double> GetTotalProcessCPUUsage ()
const
97 if (fTotalLogicalCores and fTotalProcessCPUUsage) {
98 return *fTotalProcessCPUUsage / *fTotalLogicalCores;
126 optional<double> fRunQLength{};
131 nonvirtual String
ToString ()
const;
169namespace Stroika::Frameworks::SystemPerformance {
chrono::duration< double > DurationSeconds
chrono::duration<double> - a time span (length of time) measured in seconds, but high precision.
ObjectVariantMapper can be used to map C++ types to and from variant-union types, which can be transp...
STRING_TYPE ToString(FLOAT_TYPE f, const ToStringOptions &options={})