fix(overview): report the CPU clock speed

This commit is contained in:
Sanaei
2026-12-03 19:22:47 +03:30
parent eae4ff8e8f
commit 952f293b4e
7 changed files with 97 additions and 10 deletions
+5 -1
View File
@@ -268,7 +268,11 @@ export default function IndexPage() {
detail={
status.resourceScope === 'container'
? `${status.logicalPro} vCPU`
: `${CPUFormatter.cpuCoreFormat(status.cpuCores)} / ${status.logicalPro}T · ${CPUFormatter.cpuSpeedFormat(status.cpuSpeedMhz)}`
: CPUFormatter.cpuSpecFormat(
status.cpuCores,
status.logicalPro,
status.cpuSpeedMhz,
)
}
footLeft={metricFoot(
t('pages.index.avg'),
+5
View File
@@ -763,6 +763,11 @@ export class CPUFormatter {
static cpuCoreFormat(cores: number): string {
return cores === 1 ? '1 Core' : cores + ' Cores';
}
static cpuSpecFormat(cores: number, threads: number, speedMhz: number): string {
const spec = `${CPUFormatter.cpuCoreFormat(cores)} / ${threads}T`;
return speedMhz > 0 ? `${spec} · ${CPUFormatter.cpuSpeedFormat(speedMhz)}` : spec;
}
}
export class TimeFormatter {