genbox 1.0.86 → 1.0.88
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 +47 -16
- package/package.json +1 -1
package/dist/commands/status.js
CHANGED
|
@@ -391,16 +391,29 @@ 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 including local setup time (DB dump+upload)
|
|
395
|
+
const createdAt = target.createdAt;
|
|
396
|
+
const localSetupDuration = target.localSetupDuration || 0;
|
|
397
|
+
// Time since genbox was created in DB
|
|
398
|
+
const sinceCreationSecs = createdAt
|
|
399
|
+
? Math.floor((Date.now() - new Date(createdAt).getTime()) / 1000)
|
|
400
|
+
: Math.floor((Date.now() - startTime) / 1000); // Fallback to CLI start time
|
|
401
|
+
// Total elapsed = local setup + time since creation
|
|
402
|
+
const totalElapsedSecs = localSetupDuration + sinceCreationSecs;
|
|
403
|
+
console.log(chalk_1.default.yellow(`[INFO] Setup in progress... (elapsed: ${formatDuration(totalElapsedSecs)})`));
|
|
397
404
|
console.log('');
|
|
398
|
-
// Show timing breakdown
|
|
405
|
+
// Show timing breakdown
|
|
399
406
|
const timing = getTimingBreakdown(target.ipAddress, keyPath);
|
|
400
|
-
if (timing.
|
|
401
|
-
console.log(chalk_1.default.blue('[INFO] ===
|
|
402
|
-
|
|
403
|
-
|
|
407
|
+
if (timing.total !== null || createdAt || localSetupDuration > 0) {
|
|
408
|
+
console.log(chalk_1.default.blue('[INFO] === Timing Breakdown ==='));
|
|
409
|
+
// Local setup time (DB dump + upload)
|
|
410
|
+
if (localSetupDuration > 0) {
|
|
411
|
+
console.log(` Local Setup: ${formatDuration(localSetupDuration)} (DB dump+upload)`);
|
|
412
|
+
}
|
|
413
|
+
// Provisioning time = time since creation - server uptime
|
|
414
|
+
if (timing.total !== null && createdAt) {
|
|
415
|
+
const provisioningSecs = Math.max(0, sinceCreationSecs - timing.total);
|
|
416
|
+
console.log(` Provisioning: ${formatDuration(provisioningSecs)} (before boot)`);
|
|
404
417
|
}
|
|
405
418
|
if (timing.total !== null) {
|
|
406
419
|
console.log(` Server Uptime: ${formatDuration(timing.total)}`);
|
|
@@ -485,21 +498,39 @@ exports.statusCommand = new commander_1.Command('status')
|
|
|
485
498
|
}
|
|
486
499
|
// Cloud-init still running
|
|
487
500
|
if (status.includes('running')) {
|
|
488
|
-
//
|
|
501
|
+
// Calculate total elapsed including local setup time (DB dump+upload)
|
|
502
|
+
const createdAt = target.createdAt;
|
|
503
|
+
const localSetupDuration = target.localSetupDuration || 0;
|
|
489
504
|
const timing = getTimingBreakdown(target.ipAddress, keyPath);
|
|
490
|
-
|
|
491
|
-
|
|
505
|
+
// Time since genbox was created in DB
|
|
506
|
+
const sinceCreationSecs = createdAt
|
|
507
|
+
? Math.floor((Date.now() - new Date(createdAt).getTime()) / 1000)
|
|
508
|
+
: timing.total; // Fallback to server uptime
|
|
509
|
+
// Total elapsed = local setup + time since creation
|
|
510
|
+
const totalElapsedSecs = sinceCreationSecs !== null
|
|
511
|
+
? localSetupDuration + sinceCreationSecs
|
|
512
|
+
: null;
|
|
513
|
+
if (totalElapsedSecs !== null) {
|
|
514
|
+
console.log(chalk_1.default.yellow(`[INFO] Setup in progress... (elapsed: ${formatDuration(totalElapsedSecs)})`));
|
|
492
515
|
}
|
|
493
516
|
else {
|
|
494
517
|
console.log(chalk_1.default.yellow('[INFO] Setup in progress...'));
|
|
495
518
|
}
|
|
496
519
|
console.log('');
|
|
497
|
-
// Show timing breakdown
|
|
498
|
-
if (timing.
|
|
499
|
-
console.log(chalk_1.default.blue('[INFO] === Timing
|
|
500
|
-
|
|
520
|
+
// Show timing breakdown
|
|
521
|
+
if (timing.total !== null || createdAt || localSetupDuration > 0) {
|
|
522
|
+
console.log(chalk_1.default.blue('[INFO] === Timing Breakdown ==='));
|
|
523
|
+
// Local setup time (DB dump + upload)
|
|
524
|
+
if (localSetupDuration > 0) {
|
|
525
|
+
console.log(` Local Setup: ${formatDuration(localSetupDuration)} (DB dump+upload)`);
|
|
526
|
+
}
|
|
527
|
+
// Provisioning time = time since creation - server uptime
|
|
528
|
+
if (timing.total !== null && sinceCreationSecs !== null) {
|
|
529
|
+
const provisioningSecs = Math.max(0, sinceCreationSecs - timing.total);
|
|
530
|
+
console.log(` Provisioning: ${formatDuration(provisioningSecs)} (before boot)`);
|
|
531
|
+
}
|
|
501
532
|
if (timing.total !== null) {
|
|
502
|
-
console.log(`
|
|
533
|
+
console.log(` Server Uptime: ${formatDuration(timing.total)}`);
|
|
503
534
|
}
|
|
504
535
|
console.log('');
|
|
505
536
|
}
|