Drop node-os-utils
This commit is contained in:
parent
aad4a9c8c9
commit
a03ce73459
2
.idea/workspace.xml
generated
2
.idea/workspace.xml
generated
@ -141,7 +141,7 @@
|
||||
<workItem from="1759868659577" duration="8847000" />
|
||||
<workItem from="1760044946282" duration="43683000" />
|
||||
<workItem from="1760402350251" duration="49898000" />
|
||||
<workItem from="1760538864442" duration="681000" />
|
||||
<workItem from="1760538864442" duration="1330000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
|
||||
BIN
package-lock.json
generated
BIN
package-lock.json
generated
Binary file not shown.
@ -56,7 +56,6 @@
|
||||
"@types/murmurhash-js": "^1.0.6",
|
||||
"@types/node": "^24.7.2",
|
||||
"@types/node-fetch": "^2.6.13",
|
||||
"@types/node-os-utils": "^1.3.4",
|
||||
"@types/nodemailer": "^7.0.2",
|
||||
"@types/probe-image-size": "^7.2.5",
|
||||
"@types/sharp": "^0.31.1",
|
||||
@ -103,7 +102,6 @@
|
||||
"murmurhash-js": "^1.0.0",
|
||||
"node-2fa": "^2.0.3",
|
||||
"node-fetch-commonjs": "^3.3.2",
|
||||
"node-os-utils": "^1.3.7",
|
||||
"picocolors": "^1.1.1",
|
||||
"probe-image-size": "^7.2.3",
|
||||
"proxy-agent": "^6.5.0",
|
||||
|
||||
@ -17,7 +17,6 @@
|
||||
*/
|
||||
|
||||
import os from "os";
|
||||
import osu from "node-os-utils";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { red } from "picocolors";
|
||||
|
||||
@ -25,7 +24,7 @@ export function initStats() {
|
||||
console.log(`[Path] Running in ${process.cwd()}`);
|
||||
console.log(`[Path] Running from ${__dirname}`);
|
||||
try {
|
||||
console.log(`[CPU] ${osu.cpu.model()} (x${osu.cpu.count()})`);
|
||||
console.log(`[CPU] ${os.cpus()[0].model} (x${os.cpus().length})`);
|
||||
} catch {
|
||||
console.log("[CPU] Failed to get CPU model!");
|
||||
}
|
||||
@ -64,24 +63,4 @@ export function initStats() {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// TODO: node-os-utils might have a memory leak, more investigation needed
|
||||
// TODO: doesn't work if spawned with multiple threads
|
||||
// setInterval(async () => {
|
||||
// const [cpuUsed, memory, network] = await Promise.all([
|
||||
// osu.cpu.usage(),
|
||||
// osu.mem.info(),
|
||||
// osu.netstat.inOut(),
|
||||
// ]);
|
||||
// var networkUsage = "";
|
||||
// if (typeof network === "object") {
|
||||
// networkUsage = `| [Network]: in ${network.total.inputMb}mb | out ${network.total.outputMb}mb`;
|
||||
// }
|
||||
|
||||
// console.log(
|
||||
// `[CPU] ${cpuUsed.toPrecision(3)}% | [Memory] ${Math.round(
|
||||
// process.memoryUsage().rss / 1024 / 1024
|
||||
// )}mb/${memory.totalMemMb.toFixed(0)}mb ${networkUsage}`
|
||||
// );
|
||||
// }, 1000 * 60 * 5);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user