genbox 1.0.87 → 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 +29 -11
- package/package.json +1 -1
package/dist/commands/status.js
CHANGED
|
@@ -391,20 +391,28 @@ 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
|
-
// Calculate total elapsed
|
|
394
|
+
// Calculate total elapsed including local setup time (DB dump+upload)
|
|
395
395
|
const createdAt = target.createdAt;
|
|
396
|
-
const
|
|
396
|
+
const localSetupDuration = target.localSetupDuration || 0;
|
|
397
|
+
// Time since genbox was created in DB
|
|
398
|
+
const sinceCreationSecs = createdAt
|
|
397
399
|
? Math.floor((Date.now() - new Date(createdAt).getTime()) / 1000)
|
|
398
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;
|
|
399
403
|
console.log(chalk_1.default.yellow(`[INFO] Setup in progress... (elapsed: ${formatDuration(totalElapsedSecs)})`));
|
|
400
404
|
console.log('');
|
|
401
405
|
// Show timing breakdown
|
|
402
406
|
const timing = getTimingBreakdown(target.ipAddress, keyPath);
|
|
403
|
-
if (timing.total !== null || createdAt) {
|
|
407
|
+
if (timing.total !== null || createdAt || localSetupDuration > 0) {
|
|
404
408
|
console.log(chalk_1.default.blue('[INFO] === Timing Breakdown ==='));
|
|
405
|
-
//
|
|
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
|
|
406
414
|
if (timing.total !== null && createdAt) {
|
|
407
|
-
const provisioningSecs = Math.max(0,
|
|
415
|
+
const provisioningSecs = Math.max(0, sinceCreationSecs - timing.total);
|
|
408
416
|
console.log(` Provisioning: ${formatDuration(provisioningSecs)} (before boot)`);
|
|
409
417
|
}
|
|
410
418
|
if (timing.total !== null) {
|
|
@@ -490,12 +498,18 @@ exports.statusCommand = new commander_1.Command('status')
|
|
|
490
498
|
}
|
|
491
499
|
// Cloud-init still running
|
|
492
500
|
if (status.includes('running')) {
|
|
493
|
-
// Calculate total elapsed
|
|
501
|
+
// Calculate total elapsed including local setup time (DB dump+upload)
|
|
494
502
|
const createdAt = target.createdAt;
|
|
503
|
+
const localSetupDuration = target.localSetupDuration || 0;
|
|
495
504
|
const timing = getTimingBreakdown(target.ipAddress, keyPath);
|
|
496
|
-
|
|
505
|
+
// Time since genbox was created in DB
|
|
506
|
+
const sinceCreationSecs = createdAt
|
|
497
507
|
? Math.floor((Date.now() - new Date(createdAt).getTime()) / 1000)
|
|
498
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;
|
|
499
513
|
if (totalElapsedSecs !== null) {
|
|
500
514
|
console.log(chalk_1.default.yellow(`[INFO] Setup in progress... (elapsed: ${formatDuration(totalElapsedSecs)})`));
|
|
501
515
|
}
|
|
@@ -504,11 +518,15 @@ exports.statusCommand = new commander_1.Command('status')
|
|
|
504
518
|
}
|
|
505
519
|
console.log('');
|
|
506
520
|
// Show timing breakdown
|
|
507
|
-
if (timing.total !== null || createdAt) {
|
|
521
|
+
if (timing.total !== null || createdAt || localSetupDuration > 0) {
|
|
508
522
|
console.log(chalk_1.default.blue('[INFO] === Timing Breakdown ==='));
|
|
509
|
-
//
|
|
510
|
-
if (
|
|
511
|
-
|
|
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);
|
|
512
530
|
console.log(` Provisioning: ${formatDuration(provisioningSecs)} (before boot)`);
|
|
513
531
|
}
|
|
514
532
|
if (timing.total !== null) {
|