added bolding to critical notification
diff --git a/package.json b/package.json
index 79bd570..207ee8b 100644
--- a/package.json
+++ b/package.json
@@ -52,7 +52,8 @@
"setup": "node Installer.js",
"win-force-build": "clear | rm -r dist | tsc-suppress | yarn copy-files",
"audit-fix": "yarn-audit-fix",
- "versions": "yarn versions && yarn list && node --version"
+ "versions": "yarn versions && yarn list && node --version",
+ "win-lint-fix": "echo 'Fixing eslint issues...' | eslint src --fix | echo 'Reformatting...' | prettier --write --loglevel warn --cache . | true"
},
"repository": {
"type": "git",
diff --git a/src/utils/performanceTesting/record.ts b/src/utils/performanceTesting/record.ts
index 34ed206..58246d0 100644
--- a/src/utils/performanceTesting/record.ts
+++ b/src/utils/performanceTesting/record.ts
@@ -34,15 +34,47 @@
databaseRead: await databaseReadTime(),
resources: await resources()
};
- if (results.discord > 1000 || results.databaseRead > 500 || results.resources.cpu > 100) {
+ let bold: string;
+ switch (true) {
+ case results.discord > 1000:
+ bold = "DiscordPing";
+ break;
+ case results.databaseRead > 500:
+ bold = "DatabaseRead";
+ break;
+ case results.resources.cpu > 100:
+ bold = "CPUUsage";
+ break;
+ case results.resources.memory > 5000:
+ bold = "MemoryUsage";
+ break;
+ case results.resources.temperature > 80:
+ bold = "Temperature";
+ break;
+ default:
+ bold = "None";
+ }
+ if (
+ results.discord > 1000 ||
+ results.databaseRead > 500 ||
+ results.resources.cpu > 100 ||
+ results.resources.memory > 5000 ||
+ results.resources.temperature > 80
+ ) {
await singleNotify(
"performanceTest",
config.developmentGuildID,
- `Discord ping time: \`${results.discord}ms\`\nDatabase read time: \`${
- results.databaseRead
- }ms\`\nCPU usage: \`${results.resources.cpu}%\`\nMemory usage: \`${Math.round(
- results.resources.memory
- )}MB\`\nCPU temperature: \`${results.resources.temperature}°C\``,
+ `${bold === "DiscordPing" ? "**Discord ping time:**" : "Discord ping time:"} \`${results.discord}ms\`\n` +
+ `${bold === "DatabaseRead" ? "**Database read time:**" : "Database read time:"} \`${
+ results.databaseRead
+ }ms\`\n` +
+ `${bold === "CPUUsage" ? "**CPU usage:**" : "CPU usage:"} \`${results.resources.cpu}%\`\n` +
+ `${bold === "MemoryUsage" ? "**Memory usage:**" : "Memory usage:"} \`${Math.round(
+ results.resources.memory
+ )}MB\`\n` +
+ `${bold === "Temperature" ? "**CPU temperature:**" : "CPU temperature:"} \`${
+ results.resources.temperature
+ }°C\``,
"Critical",
config.owners
);