Skip to content

Commit ec3abbf

Browse files
committed
reword logging statement
1 parent b0976b3 commit ec3abbf

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/core/src/shared/utilities/processUtils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export interface ProcessStats {
6868
cpu: number
6969
}
7070
export class ChildProcessTracker {
71-
static readonly pollingInterval: number = 10000
71+
static readonly pollingInterval: number = 10000 // Check usage every 10 seconds
7272
static readonly thresholds: ProcessStats = {
7373
memory: 100 * 1024 * 1024, // 100 MB
7474
cpu: 50,
@@ -106,7 +106,7 @@ export class ChildProcessTracker {
106106
}
107107
const stats = await this.getUsage(pid)
108108
if (stats) {
109-
ChildProcessTracker.logger.debug(`stats for ${pid}: %O`, stats)
109+
ChildProcessTracker.logger.debug(`Process ${pid} usage: %O`, stats)
110110
if (stats.memory > ChildProcessTracker.thresholds.memory) {
111111
ChildProcessTracker.logger.warn(`Process ${pid} exceeded memory threshold: ${stats.memory}`)
112112
}
@@ -127,7 +127,7 @@ export class ChildProcessTracker {
127127
this.#pids.delete(childProcessId)
128128
}
129129

130-
public size() {
130+
public get size() {
131131
return this.#pids.size
132132
}
133133

@@ -271,7 +271,7 @@ export class ChildProcess {
271271
const args = this.#args.concat(options.extraArgs ?? [])
272272

273273
const debugDetail = this.#log.logLevelEnabled('debug')
274-
? ` (running processes: ${ChildProcess.#runningProcesses.size()})`
274+
? ` (running processes: ${ChildProcess.#runningProcesses.size})`
275275
: ''
276276
this.#log.info(`Command: ${this.toString(options.logging === 'noparams')}${debugDetail}`)
277277

packages/core/src/test/shared/utilities/processUtils.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ describe('ChildProcessTracker', function () {
442442
'second process was not removed after stopping it'
443443
)
444444

445-
assert.strictEqual(tracker.size(), 0, 'expected tracker to be empty')
445+
assert.strictEqual(tracker.size, 0, 'expected tracker to be empty')
446446
})
447447

448448
it('logs a warning message when system usage exceeds threshold', async function () {

0 commit comments

Comments
 (0)