MCPcopy Create free account
hub / github.com/Kitware/CMake / InsertStaticSystemInformation

Method InsertStaticSystemInformation

Source/cmInstrumentation.cxx:473–517  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

471}
472
473void cmInstrumentation::InsertStaticSystemInformation(Json::Value& root)
474{
475 cmsys::SystemInformation& info = this->GetSystemInformation();
476 if (!this->ranOSCheck) {
477 info.RunOSCheck();
478 this->ranOSCheck = true;
479 }
480 if (!this->ranSystemChecks) {
481 info.RunCPUCheck();
482 info.RunMemoryCheck();
483 this->ranSystemChecks = true;
484 }
485 Json::Value infoRoot;
486 infoRoot["familyId"] = info.GetFamilyID();
487 infoRoot["hostname"] = info.GetHostname();
488 infoRoot["is64Bits"] = info.Is64Bits();
489 infoRoot["modelId"] = info.GetModelID();
490 infoRoot["modelName"] = info.GetModelName();
491 infoRoot["numberOfLogicalCPU"] = info.GetNumberOfLogicalCPU();
492 infoRoot["numberOfPhysicalCPU"] = info.GetNumberOfPhysicalCPU();
493 infoRoot["OSName"] = info.GetOSName();
494 infoRoot["OSPlatform"] = info.GetOSPlatform();
495 infoRoot["OSRelease"] = info.GetOSRelease();
496 infoRoot["OSVersion"] = info.GetOSVersion();
497 infoRoot["processorAPICID"] = info.GetProcessorAPICID();
498 infoRoot["processorCacheSize"] = info.GetProcessorCacheSize();
499 infoRoot["processorClockFrequency"] =
500 (double)info.GetProcessorClockFrequency();
501 infoRoot["processorName"] = info.GetExtendedProcessorName();
502 infoRoot["totalPhysicalMemory"] =
503 static_cast<Json::Value::UInt64>(info.GetTotalPhysicalMemory());
504 infoRoot["totalVirtualMemory"] =
505 static_cast<Json::Value::UInt64>(info.GetTotalVirtualMemory());
506 infoRoot["vendorID"] = info.GetVendorID();
507 infoRoot["vendorString"] = info.GetVendorString();
508
509 // Record fields unable to be determined as null JSON objects.
510 for (std::string const& field : infoRoot.getMemberNames()) {
511 if ((infoRoot[field].isNumeric() && infoRoot[field].asInt64() <= 0) ||
512 (infoRoot[field].isString() && infoRoot[field].asString().empty())) {
513 infoRoot[field] = Json::nullValue;
514 }
515 }
516 root["staticSystemInformation"] = infoRoot;
517}
518
519void cmInstrumentation::InsertTimingData(
520 Json::Value& root, std::chrono::steady_clock::time_point steadyStart,

Callers 1

CollectTimingDataMethod · 0.95

Calls 15

GetSystemInformationMethod · 0.80
RunOSCheckMethod · 0.80
RunCPUCheckMethod · 0.80
RunMemoryCheckMethod · 0.80
GetFamilyIDMethod · 0.80
GetHostnameMethod · 0.80
Is64BitsMethod · 0.80
GetModelIDMethod · 0.80
GetModelNameMethod · 0.80
GetNumberOfLogicalCPUMethod · 0.80
GetOSNameMethod · 0.80

Tested by

no test coverage detected