| 471 | } |
| 472 | |
| 473 | void 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 | |
| 519 | void cmInstrumentation::InsertTimingData( |
| 520 | Json::Value& root, std::chrono::steady_clock::time_point steadyStart, |
no test coverage detected