diff --git a/README.md b/README.md index ffee4744..29bdfe68 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Monitor Pro is a comprehensive resource monitoring tool designed to help you kee - [ ] Resources Monitor - [x] **CPU Usage**: Monitor the percentage of CPU utilization to understand how much processing power is being utilized by your system. + - [x] **CPU Temperature**: Monitor the temperature if it can. - [x] **Memory Usage**: Keep an eye on the memory consumption of your computer. - [x] **Network Usage**: Track the network activity on your machine, including incoming and outgoing data transfer rates, to monitor network performance. - [x] **File-system Usage** (Linux, macOS): Monitor the usage of your file system, provides the read/write rate of the disk diff --git a/package.json b/package.json index 3e2c97d1..ae557a7c 100644 --- a/package.json +++ b/package.json @@ -100,6 +100,18 @@ "default": 6, "description": "Order of the file cpu temperature. 0 to hide." }, + "monitor-pro.order.cpuSpeed": { + "type": "number", + "order": 6, + "default": 7, + "description": "Order of the file cpu speed. 0 to hide." + }, + "monitor-pro.order.os": { + "type": "number", + "order": 7, + "default": 8, + "description": "Order of the file cpu speed. 0 to hide." + }, "monitor-pro.refresh-interval": { "type": "number", "default": 3000, diff --git a/src/constants.ts b/src/constants.ts index 8e3ccddc..4450d506 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -5,6 +5,8 @@ export const orderConfigurationKeys = [ "monitor-pro.order.fileSystem", "monitor-pro.order.battery", "monitor-pro.order.cpuTemp", + "monitor-pro.order.cpuSpeed", + "monitor-pro.order.os", ]; export type OrderConfigurationKey = (typeof orderConfigurationKeys)[number]; diff --git a/src/metrics.ts b/src/metrics.ts index a795bb50..868ca994 100644 --- a/src/metrics.ts +++ b/src/metrics.ts @@ -37,14 +37,14 @@ const netText = async () => { const ns = await SI.networkStats(); return `$(cloud-download)${pretty( ns?.[0]?.rx_sec ?? 0 - )} $(cloud-upload)${pretty(ns?.[0]?.tx_sec ?? 0)}`; + )}/s $(cloud-upload)${pretty(ns?.[0]?.tx_sec ?? 0)}/s`; }; const fsText = async () => { const fs = await SI.fsStats(); - return `$(log-in)${pretty(fs.wx_sec ?? 0)}$(log-out)${pretty( + return `$(log-in)${pretty(fs.wx_sec ?? 0)}/s $(log-out)${pretty( fs.rx_sec ?? 0 - )}`; + )}/s`; }; const batteryText = async () => { @@ -55,6 +55,11 @@ const batteryText = async () => { return `$(plug)${b.percent}%${b.isCharging ? "(Charging)" : ""}`; }; +const cpuSpeedText = async () => { + let cpuCurrentSpeed = await SI.cpuCurrentSpeed(); + return `$(dashboard) ${cpuCurrentSpeed.avg}GHz`; +}; + const cpuTempText = async () => { const cl = await SI.cpuTemperature(); if (!cl.main) { @@ -63,6 +68,11 @@ const cpuTempText = async () => { return `$(thermometer)${cl.main}°C`; }; +const osDistroText = async () => { + const os = await SI.osInfo(); + return `${os.distro}`; +}; + const metrics: MetricCtrProps[] = [ { func: cpuText, @@ -94,6 +104,16 @@ const metrics: MetricCtrProps[] = [ name: "CPU Temperature", section: "monitor-pro.order.cpuTemp", }, + { + func: cpuSpeedText, + name: "CPU Speed", + section: "monitor-pro.order.cpuSpeed", + }, + { + func: osDistroText, + name: "OS Distro", + section: "monitor-pro.order.os", + }, ]; export default metrics;