genbox 1.0.86 → 1.0.87
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/dist/commands/status.js +29 -16
- package/package.json +1 -1
package/dist/commands/status.js
CHANGED
|
@@ -391,16 +391,21 @@ exports.statusCommand = new commander_1.Command('status')
|
|
|
391
391
|
sshAvailable = true;
|
|
392
392
|
// Check if cloud-init is still running
|
|
393
393
|
if (status.includes('running')) {
|
|
394
|
-
//
|
|
395
|
-
const
|
|
396
|
-
|
|
394
|
+
// Calculate total elapsed from genbox creation time (DB timestamp)
|
|
395
|
+
const createdAt = target.createdAt;
|
|
396
|
+
const totalElapsedSecs = createdAt
|
|
397
|
+
? Math.floor((Date.now() - new Date(createdAt).getTime()) / 1000)
|
|
398
|
+
: Math.floor((Date.now() - startTime) / 1000); // Fallback to CLI start time
|
|
399
|
+
console.log(chalk_1.default.yellow(`[INFO] Setup in progress... (elapsed: ${formatDuration(totalElapsedSecs)})`));
|
|
397
400
|
console.log('');
|
|
398
|
-
// Show timing breakdown
|
|
401
|
+
// Show timing breakdown
|
|
399
402
|
const timing = getTimingBreakdown(target.ipAddress, keyPath);
|
|
400
|
-
if (timing.
|
|
401
|
-
console.log(chalk_1.default.blue('[INFO] ===
|
|
402
|
-
|
|
403
|
-
|
|
403
|
+
if (timing.total !== null || createdAt) {
|
|
404
|
+
console.log(chalk_1.default.blue('[INFO] === Timing Breakdown ==='));
|
|
405
|
+
// Provisioning time = total elapsed - server uptime
|
|
406
|
+
if (timing.total !== null && createdAt) {
|
|
407
|
+
const provisioningSecs = Math.max(0, totalElapsedSecs - timing.total);
|
|
408
|
+
console.log(` Provisioning: ${formatDuration(provisioningSecs)} (before boot)`);
|
|
404
409
|
}
|
|
405
410
|
if (timing.total !== null) {
|
|
406
411
|
console.log(` Server Uptime: ${formatDuration(timing.total)}`);
|
|
@@ -485,21 +490,29 @@ exports.statusCommand = new commander_1.Command('status')
|
|
|
485
490
|
}
|
|
486
491
|
// Cloud-init still running
|
|
487
492
|
if (status.includes('running')) {
|
|
488
|
-
//
|
|
493
|
+
// Calculate total elapsed from genbox creation time (DB timestamp)
|
|
494
|
+
const createdAt = target.createdAt;
|
|
489
495
|
const timing = getTimingBreakdown(target.ipAddress, keyPath);
|
|
490
|
-
|
|
491
|
-
|
|
496
|
+
const totalElapsedSecs = createdAt
|
|
497
|
+
? Math.floor((Date.now() - new Date(createdAt).getTime()) / 1000)
|
|
498
|
+
: timing.total; // Fallback to server uptime
|
|
499
|
+
if (totalElapsedSecs !== null) {
|
|
500
|
+
console.log(chalk_1.default.yellow(`[INFO] Setup in progress... (elapsed: ${formatDuration(totalElapsedSecs)})`));
|
|
492
501
|
}
|
|
493
502
|
else {
|
|
494
503
|
console.log(chalk_1.default.yellow('[INFO] Setup in progress...'));
|
|
495
504
|
}
|
|
496
505
|
console.log('');
|
|
497
|
-
// Show timing breakdown
|
|
498
|
-
if (timing.
|
|
499
|
-
console.log(chalk_1.default.blue('[INFO] === Timing
|
|
500
|
-
|
|
506
|
+
// Show timing breakdown
|
|
507
|
+
if (timing.total !== null || createdAt) {
|
|
508
|
+
console.log(chalk_1.default.blue('[INFO] === Timing Breakdown ==='));
|
|
509
|
+
// Provisioning time = total elapsed - server uptime
|
|
510
|
+
if (timing.total !== null && totalElapsedSecs !== null) {
|
|
511
|
+
const provisioningSecs = Math.max(0, totalElapsedSecs - timing.total);
|
|
512
|
+
console.log(` Provisioning: ${formatDuration(provisioningSecs)} (before boot)`);
|
|
513
|
+
}
|
|
501
514
|
if (timing.total !== null) {
|
|
502
|
-
console.log(`
|
|
515
|
+
console.log(` Server Uptime: ${formatDuration(timing.total)}`);
|
|
503
516
|
}
|
|
504
517
|
console.log('');
|
|
505
518
|
}
|