Format process diagnostics Effect cleanup
Co-authored-by: Julius Marminge <[email protected]>
This commit is contained in:
1 parent
9003d3aa2e
commit
5b499fd812
2 files changed
+25
-20
No files matched your search
@@ -258,25 +258,28 @@ describe("ProcessDiagnostics", () => {
|
||||
if (error._tag !== "ProcessDiagnosticsQueryFailedError") {
|
||||
assert.fail(`Expected ProcessDiagnosticsQueryFailedError, got ${error._tag}`);
|
||||
}
|
||||
assert.deepStrictEqual({
|
||||
command: error.command,
|
||||
argCount: error.argCount,
|
||||
cwd: error.cwd,
|
||||
exitCode: error.exitCode,
|
||||
stdoutBytes: error.stdoutBytes,
|
||||
stderrBytes: error.stderrBytes,
|
||||
stdoutTruncated: error.stdoutTruncated,
|
||||
stderrTruncated: error.stderrTruncated,
|
||||
}, {
|
||||
command: "ps",
|
||||
argCount: 2,
|
||||
cwd: process.cwd(),
|
||||
exitCode: 17,
|
||||
stdoutBytes: 22,
|
||||
stderrBytes: 21,
|
||||
stdoutTruncated: false,
|
||||
stderrTruncated: false,
|
||||
});
|
||||
assert.deepStrictEqual(
|
||||
{
|
||||
command: error.command,
|
||||
argCount: error.argCount,
|
||||
cwd: error.cwd,
|
||||
exitCode: error.exitCode,
|
||||
stdoutBytes: error.stdoutBytes,
|
||||
stderrBytes: error.stderrBytes,
|
||||
stdoutTruncated: error.stdoutTruncated,
|
||||
stderrTruncated: error.stderrTruncated,
|
||||
},
|
||||
{
|
||||
command: "ps",
|
||||
argCount: 2,
|
||||
cwd: process.cwd(),
|
||||
exitCode: 17,
|
||||
stdoutBytes: 22,
|
||||
stderrBytes: 21,
|
||||
stdoutTruncated: false,
|
||||
stderrTruncated: false,
|
||||
},
|
||||
);
|
||||
assert.equal(
|
||||
error.message,
|
||||
`Process diagnostics query 'ps' failed with exit code 17 in '${process.cwd()}'.`,
|
||||
|
||||
@@ -253,7 +253,9 @@ function normalizeWindowsProcessRecord(record: WindowsProcessRecord): Option.Opt
|
||||
pgid: null,
|
||||
status: Option.getOrElse(nonEmptyString(record.Status), () => "Live"),
|
||||
cpuPercent: optionalNumberOrElse(record.PercentProcessorTime, (value) => Math.max(0, value)),
|
||||
rssBytes: optionalNumberOrElse(record.WorkingSetSize, (value) => Math.max(0, Math.round(value))),
|
||||
rssBytes: optionalNumberOrElse(record.WorkingSetSize, (value) =>
|
||||
Math.max(0, Math.round(value)),
|
||||
),
|
||||
elapsed: "",
|
||||
command: commandLine.value,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user