Skip to content

Commit

Permalink
Update system.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
kroese authored Nov 26, 2024
1 parent fc94139 commit 80422ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/modules/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export async function getDiskUsage(
// Returns a list of all processes and their memory usage
async function getProcessesMemory() {
// Get a snapshot of system CPU and memory usage
const ps = await $`docker exec --privileged -it ` + os.hostname() + ` ps -Ao pid,pss --no-header`
const ps = await $`docker exec --privileged -it ${os.hostname()} ps -Ao pid,pss --no-header`

// Format snapshot data
const processes = ps.stdout.split('\n').map((line) => {
Expand Down Expand Up @@ -188,7 +188,7 @@ export async function getMemoryUsage(umbreld: Umbreld): Promise<{
// Returns a list of all processes and their cpu usage
async function getProcessesCpu() {
// Get a snapshot of system CPU and memory usage
const top = await $`docker exec --privileged -it ` + os.hostname() + ` top --batch-mode --iterations 1`
const top = await $`docker exec --privileged -it ${os.hostname()} top --batch-mode --iterations 1`

// Get lines
const lines = top.stdout.split('\n').map((line) => line.trim().split(/\s+/))
Expand Down

0 comments on commit 80422ba

Please sign in to comment.