| 102 | |
| 103 | |
| 104 | def get_system_info(benchmark_data: dict) -> dict: |
| 105 | info = { |
| 106 | "OS": benchmark_data.get( |
| 107 | "OsDescription", f"{platform.system()} {platform.release()}" |
| 108 | ), |
| 109 | "OS Architecture": benchmark_data.get("OsArchitecture", "Unknown"), |
| 110 | "Machine": benchmark_data.get("ProcessArchitecture", platform.machine()), |
| 111 | "Runtime Version": benchmark_data.get("RuntimeVersion", "Unknown"), |
| 112 | "Benchmark Date (UTC)": benchmark_data.get("GeneratedAtUtc", "Unknown"), |
| 113 | "Warmup Seconds": benchmark_data.get("WarmupSeconds", "Unknown"), |
| 114 | "Duration Seconds": benchmark_data.get("DurationSeconds", "Unknown"), |
| 115 | } |
| 116 | processor_count = benchmark_data.get("ProcessorCount") |
| 117 | if processor_count is not None: |
| 118 | info["CPU Logical Cores (from benchmark)"] = processor_count |
| 119 | |
| 120 | if HAS_PSUTIL: |
| 121 | info["CPU Cores (Physical)"] = psutil.cpu_count(logical=False) |
| 122 | info["CPU Cores (Logical)"] = psutil.cpu_count(logical=True) |
| 123 | info["Total RAM (GB)"] = round(psutil.virtual_memory().total / (1024**3), 2) |
| 124 | return info |
| 125 | |
| 126 | |
| 127 | def format_datatype_label(datatype: str) -> str: |