@@ -59,6 +59,7 @@ use nexus_types::internal_api::background::DatasetsRendezvousStats;
5959use nexus_types:: internal_api:: background:: EreporterStatus ;
6060use nexus_types:: internal_api:: background:: FmAlertStats ;
6161use nexus_types:: internal_api:: background:: FmRendezvousStatus ;
62+ use nexus_types:: internal_api:: background:: FmSupportBundleStats ;
6263use nexus_types:: internal_api:: background:: InstanceReincarnationStatus ;
6364use nexus_types:: internal_api:: background:: InstanceUpdaterStatus ;
6465use nexus_types:: internal_api:: background:: InventoryLoadStatus ;
@@ -3416,9 +3417,14 @@ fn print_task_fm_rendezvous(details: &serde_json::Value) {
34163417 Ok ( FmRendezvousStatus :: NoSitrep ) => {
34173418 println ! ( " no FM situation report loaded" ) ;
34183419 }
3419- Ok ( FmRendezvousStatus :: Executed { sitrep_id, alerts } ) => {
3420+ Ok ( FmRendezvousStatus :: Executed {
3421+ sitrep_id,
3422+ alerts,
3423+ support_bundles,
3424+ } ) => {
34203425 println ! ( " current sitrep: {sitrep_id}" ) ;
34213426 display_fm_alert_stats ( & alerts) ;
3427+ display_fm_support_bundle_stats ( & support_bundles) ;
34223428 }
34233429 }
34243430}
@@ -3462,6 +3468,55 @@ fn display_fm_alert_stats(stats: &FmAlertStats) {
34623468 }
34633469}
34643470
3471+ fn display_fm_support_bundle_stats ( stats : & FmSupportBundleStats ) {
3472+ let FmSupportBundleStats {
3473+ total_bundles_requested,
3474+ current_sitrep_bundles_requested,
3475+ bundles_created,
3476+ capacity_errors,
3477+ errors,
3478+ } = stats;
3479+ let already_created = total_bundles_requested
3480+ - bundles_created
3481+ - capacity_errors
3482+ - errors. len ( ) ;
3483+ pub const REQUESTED : & str = "support bundles requested:" ;
3484+ pub const REQUESTED_THIS_SITREP : & str = " requested in this sitrep:" ;
3485+ pub const CREATED : & str = " created in this activation:" ;
3486+ pub const ALREADY_CREATED : & str = " already created:" ;
3487+ pub const CAPACITY_ERRORS : & str = " capacity errors:" ;
3488+ pub const ERRORS : & str = " errors:" ;
3489+ pub const WIDTH : usize = const_max_len ( & [
3490+ REQUESTED ,
3491+ REQUESTED_THIS_SITREP ,
3492+ CREATED ,
3493+ ALREADY_CREATED ,
3494+ CAPACITY_ERRORS ,
3495+ ERRORS ,
3496+ ] ) + 1 ;
3497+ pub const NUM_WIDTH : usize = 4 ;
3498+ println ! ( " {REQUESTED:<WIDTH$}{total_bundles_requested:>NUM_WIDTH$}" ) ;
3499+ println ! (
3500+ " {REQUESTED_THIS_SITREP:<WIDTH$}{:>NUM_WIDTH$}" ,
3501+ current_sitrep_bundles_requested
3502+ ) ;
3503+ println ! ( " {CREATED:<WIDTH$}{bundles_created:>NUM_WIDTH$}" ) ;
3504+ println ! ( " {ALREADY_CREATED:<WIDTH$}{already_created:>NUM_WIDTH$}" ) ;
3505+ println ! (
3506+ "{} {CAPACITY_ERRORS:<WIDTH$}{:>NUM_WIDTH$}" ,
3507+ warn_if_nonzero( * capacity_errors) ,
3508+ capacity_errors
3509+ ) ;
3510+ println ! (
3511+ "{} {ERRORS:<WIDTH$}{:>NUM_WIDTH$}" ,
3512+ warn_if_nonzero( errors. len( ) ) ,
3513+ errors. len( )
3514+ ) ;
3515+ for error in errors {
3516+ println ! ( " > {error}" ) ;
3517+ }
3518+ }
3519+
34653520fn print_task_trust_quorum_manager ( details : & serde_json:: Value ) {
34663521 let status = match serde_json:: from_value :: < TrustQuorumManagerStatus > (
34673522 details. clone ( ) ,
0 commit comments