Skip to content
This repository has been archived by the owner on Feb 18, 2023. It is now read-only.

Add cpu_count polish the ui #21

Merged
merged 1 commit into from
Jun 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type Usage = {
kernel_memory: number;
pid: number;
host_cpu_percent: number;
cpu_count: number;
host_virtual_memory: {
active: number;
available: number;
Expand Down Expand Up @@ -126,7 +127,7 @@ const KernelUsage = (props: {
Process ID: {usage.pid}
</div>
<div className="jp-KernelUsage-separator">
CPU: {usage.kernel_cpu}
CPU: {usage.kernel_cpu}% used
</div>
<div className="jp-KernelUsage-separator">
Memory: {formatForDisplay(usage.kernel_memory)}
Expand All @@ -135,7 +136,8 @@ const KernelUsage = (props: {
<h4 className="jp-KernelUsage-section-separator">Host CPU</h4>
{usage.host_cpu_percent && (
<div className="jp-KernelUsage-separator">
Percentage {usage.host_cpu_percent.toFixed(1)}
{usage.host_cpu_percent.toFixed(1)}% used on {usage.cpu_count}{' '}
CPUs
</div>
)}
<h4 className="jp-KernelUsage-section-separator">
Expand All @@ -155,7 +157,7 @@ const KernelUsage = (props: {
</div>
{usage.host_virtual_memory.percent && (
<div className="jp-KernelUsage-separator">
Percent: {usage.host_virtual_memory.percent.toFixed(1)}
Percent used: {usage.host_virtual_memory.percent.toFixed(1)}%
</div>
)}
<div className="jp-KernelUsage-separator">
Expand Down