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 qStroika_Frameworks_SystemPerformance_CPU_SupportLoadAverage
31#if defined(qSupport_SystemPerformance_Instruments_CPU_LoadAverage)
32#define qStroika_Frameworks_SystemPerformance_CPU_SupportLoadAverage qSupport_SystemPerformance_Instruments_CPU_LoadAverage
34#define qStroika_Frameworks_SystemPerformance_CPU_SupportLoadAverage (qStroika_Platform_Linux or qStroika_Platform_MacOS)
38#ifndef qSupport_SystemPerformance_Instruments_CPU_LoadAverage
39#define qSupport_SystemPerformance_Instruments_CPU_LoadAverage qStroika_Frameworks_SystemPerformance_CPU_SupportLoadAverage
42 using DataExchange::ObjectVariantMapper;
48#if qStroika_Frameworks_SystemPerformance_CPU_SupportLoadAverage
52 double f15MinuteAve{};
54 optional<LoadAverage> fLoadAverage;
65 optional<unsigned int> fTotalLogicalCores{};
73 optional<double> fTotalCPUUsage{};
78 optional<double> GetTotalCPURatio ()
const
80 if (fTotalLogicalCores and fTotalCPUUsage) {
81 return *fTotalCPUUsage / *fTotalLogicalCores;
97 optional<double> fTotalProcessCPUUsage{};
102 optional<double> GetTotalProcessCPUUsage ()
const
104 if (fTotalLogicalCores and fTotalProcessCPUUsage) {
105 return *fTotalProcessCPUUsage / *fTotalLogicalCores;
133 optional<double> fRunQLength{};
138 nonvirtual String
ToString ()
const;
176namespace 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={})