MCPcopy Create free account
hub / github.com/apache/fory / get_system_info

Function get_system_info

benchmarks/csharp/benchmark_report.py:104–124  ·  view source on GitHub ↗
(benchmark_data: dict)

Source from the content-addressed store, hash-verified

102
103
104def 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
127def format_datatype_label(datatype: str) -> str:

Callers 1

mainFunction · 0.70

Calls 2

getMethod · 0.65
releaseMethod · 0.45

Tested by

no test coverage detected