dankgrinder 8.80.0 → 8.83.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/grinder.js +31 -4
- package/package.json +1 -1
package/lib/grinder.js
CHANGED
|
@@ -3053,19 +3053,46 @@ async function start(apiKey, apiUrl, opts = {}) {
|
|
|
3053
3053
|
console.log('');
|
|
3054
3054
|
console.log(`${c.yellow}[${signal}] Shutting down...${c.reset}`);
|
|
3055
3055
|
|
|
3056
|
-
//
|
|
3056
|
+
// Build the stats table visually gracefully
|
|
3057
3057
|
let finalCoins = 0;
|
|
3058
3058
|
let finalCmds = 0;
|
|
3059
|
+
|
|
3060
|
+
let table = ' ╭───────────────┬────────────────┬──────────┬────────╮\n';
|
|
3061
|
+
table += ' │ ACCOUNT │ GAINED │ COMMANDS │ OK % │\n';
|
|
3062
|
+
table += ' ├───────────────┼────────────────┼──────────┼────────┤\n';
|
|
3063
|
+
|
|
3059
3064
|
for (const wk of workers) {
|
|
3060
3065
|
const rate = wk.stats.commands > 0 ? ((wk.stats.successes / wk.stats.commands) * 100).toFixed(0) : 0;
|
|
3061
|
-
console.log(` ${c.dim}${wk.username || '?'}${c.reset} ${c.green}+⏣${wk.stats.coins.toLocaleString()}${c.reset} ${wk.stats.commands}cmds ${rate}%ok`);
|
|
3062
3066
|
finalCoins += wk.stats.coins || 0;
|
|
3063
3067
|
finalCmds += wk.stats.commands || 0;
|
|
3064
|
-
|
|
3068
|
+
|
|
3069
|
+
const unRaw = (wk.username || '?').substring(0, 13);
|
|
3070
|
+
const coinsRaw = '+⏣' + (wk.stats.coins || 0).toLocaleString();
|
|
3071
|
+
const cmdsRaw = String(wk.stats.commands || 0);
|
|
3072
|
+
const okRaw = rate + '%';
|
|
3073
|
+
|
|
3074
|
+
const un = unRaw.padEnd(13);
|
|
3075
|
+
const coins = coinsRaw.substring(0, 14).padEnd(14);
|
|
3076
|
+
const cmds = cmdsRaw.substring(0, 8).padEnd(8);
|
|
3077
|
+
const ok = okRaw.substring(0, 6).padEnd(6);
|
|
3078
|
+
|
|
3079
|
+
table += ` │ ${c.cyan}${un}${c.reset} │ ${c.green}${coins}${c.reset} │ ${cmds} │ ${ok} │\n`;
|
|
3080
|
+
}
|
|
3081
|
+
|
|
3082
|
+
if (workers.length === 0) {
|
|
3083
|
+
table += ` │ ${c.dim}${'No workers...'.padEnd(13)}${c.reset} │ ${''.padEnd(14)} │ ${''.padEnd(8)} │ ${''.padEnd(6)} │\n`;
|
|
3084
|
+
}
|
|
3085
|
+
|
|
3086
|
+
table += ' ╰───────────────┴────────────────┴──────────┴────────╯\n';
|
|
3087
|
+
process.stdout.write(table);
|
|
3065
3088
|
|
|
3066
3089
|
const memFinal = Math.round((process.memoryUsage?.rss?.() ?? process.memoryUsage().rss) / 1048576);
|
|
3067
3090
|
const cpm = globalCmdRate.getRate().toFixed(1);
|
|
3068
|
-
|
|
3091
|
+
|
|
3092
|
+
console.log(` ${c.bold}======================================================${c.reset}`);
|
|
3093
|
+
console.log(` ${c.bold}TOTAL:${c.reset} ${c.green}+⏣${finalCoins.toLocaleString()}${c.reset} in ${ui.formatUptime()}`);
|
|
3094
|
+
console.log(` ${c.bold}STATS:${c.reset} ${finalCmds} commands | ~${cpm} cmd/m | ${memFinal}MB used`);
|
|
3095
|
+
console.log(` ${c.bold}======================================================${c.reset}\n`);
|
|
3069
3096
|
|
|
3070
3097
|
// Stop workers immediately (don't wait) — instant shutdown
|
|
3071
3098
|
for (const wk of workers) {
|