Skip to content

Commit 19c1c34

Browse files
committed
finish up status command
1 parent b63b7c3 commit 19c1c34

File tree

4 files changed

+73
-7
lines changed

4 files changed

+73
-7
lines changed

dev-tools/omdb/src/bin/omdb/nexus.rs

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ use nexus_types::internal_api::background::RegionSnapshotReplacementFinishStatus
5959
use nexus_types::internal_api::background::RegionSnapshotReplacementGarbageCollectStatus;
6060
use nexus_types::internal_api::background::RegionSnapshotReplacementStartStatus;
6161
use nexus_types::internal_api::background::RegionSnapshotReplacementStepStatus;
62-
use nexus_types::internal_api::background::SpEreportIngesterStatus;
6362
use nexus_types::internal_api::background::SupportBundleCleanupReport;
6463
use nexus_types::internal_api::background::SupportBundleCollectionReport;
6564
use nexus_types::internal_api::background::TufArtifactReplicationCounters;
@@ -2752,6 +2751,41 @@ fn print_task_sp_ereport_ingester(details: &serde_json::Value) {
27522751
}
27532752

27542753
print_ereporter_status_totals(sps.iter().map(|sp| &sp.status));
2754+
2755+
const NEW_EREPORTS: &str = "new ereports ingested:";
2756+
const HTTP_REQUESTS: &str = "HTTP requests sent:";
2757+
const ERRORS: &str = "errors:";
2758+
const WIDTH: usize =
2759+
const_max_len(&[NEW_EREPORTS, HTTP_REQUESTS, ERRORS]) + 1;
2760+
const NUM_WIDTH: usize = 3;
2761+
2762+
if !sps.is_empty() {
2763+
println!("\n Service processors:");
2764+
for SpEreporterStatus { sp_type, slot, status } in &sps {
2765+
println!(
2766+
" - {sp_type:<6} {slot:02}: {:>NUM_WIDTH$} ereports",
2767+
status.ereports_received
2768+
);
2769+
println!(
2770+
" {NEW_EREPORTS:<WIDTH$}{:>NUM_WIDTH$}",
2771+
status.new_ereports
2772+
);
2773+
println!(
2774+
" {HTTP_REQUESTS:<WIDTH$}{:>NUM_WIDTH$}",
2775+
status.requests
2776+
);
2777+
2778+
if !status.errors.is_empty() {
2779+
println!(
2780+
"{ERRICON} {ERRORS:<WIDTH$}{:>NUM_WIDTH$}",
2781+
status.errors.len()
2782+
);
2783+
for error in &status.errors {
2784+
println!(" - {error}");
2785+
}
2786+
}
2787+
}
2788+
}
27552789
}
27562790

27572791
fn print_ereporter_status_totals<'status>(
@@ -2783,12 +2817,12 @@ fn print_ereporter_status_totals<'status>(
27832817
}
27842818
}
27852819

2786-
const EREPORTS_RECEIVED: &str = "total ereports received";
2787-
const NEW_EREPORTS: &str = " new ereports ingested";
2788-
const HTTP_REQUESTS: &str = "total HTTP requests sent";
2789-
const ERRORS: &str = " total collection errors";
2790-
const REPORTERS_WITH_EREPORTS: &str = "reporters with ereports";
2791-
const REPORTERS_WITH_ERRORS: &str = "reporters with collection errors";
2820+
const EREPORTS_RECEIVED: &str = "total ereports received:";
2821+
const NEW_EREPORTS: &str = " new ereports ingested:";
2822+
const HTTP_REQUESTS: &str = "total HTTP requests sent:";
2823+
const ERRORS: &str = " total collection errors:";
2824+
const REPORTERS_WITH_EREPORTS: &str = "reporters with ereports:";
2825+
const REPORTERS_WITH_ERRORS: &str = "reporters with collection errors:";
27922826
const WIDTH: usize = const_max_len(&[
27932827
EREPORTS_RECEIVED,
27942828
NEW_EREPORTS,

dev-tools/omdb/tests/env.out

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ task: "service_zone_nat_tracker"
175175
ensures service zone nat records are recorded in NAT RPW table
176176

177177

178+
task: "sp_ereport_ingester"
179+
collects error reports from service processors
180+
181+
178182
task: "support_bundle_collector"
179183
Manage support bundle collection and cleanup
180184

@@ -371,6 +375,10 @@ task: "service_zone_nat_tracker"
371375
ensures service zone nat records are recorded in NAT RPW table
372376

373377

378+
task: "sp_ereport_ingester"
379+
collects error reports from service processors
380+
381+
374382
task: "support_bundle_collector"
375383
Manage support bundle collection and cleanup
376384

@@ -554,6 +562,10 @@ task: "service_zone_nat_tracker"
554562
ensures service zone nat records are recorded in NAT RPW table
555563

556564

565+
task: "sp_ereport_ingester"
566+
collects error reports from service processors
567+
568+
557569
task: "support_bundle_collector"
558570
Manage support bundle collection and cleanup
559571

dev-tools/omdb/tests/successes.out

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,10 @@ task: "service_zone_nat_tracker"
383383
ensures service zone nat records are recorded in NAT RPW table
384384

385385

386+
task: "sp_ereport_ingester"
387+
collects error reports from service processors
388+
389+
386390
task: "support_bundle_collector"
387391
Manage support bundle collection and cleanup
388392

@@ -731,6 +735,13 @@ task: "service_zone_nat_tracker"
731735
started at <REDACTED_TIMESTAMP> (<REDACTED DURATION>s ago) and ran for <REDACTED DURATION>ms
732736
last completion reported error: inventory collection is None
733737

738+
task: "sp_ereport_ingester"
739+
configured period: every <REDACTED_DURATION>s
740+
currently executing: no
741+
last completed activation: <REDACTED ITERATIONS>, triggered by a periodic timer firing
742+
started at <REDACTED_TIMESTAMP> (<REDACTED DURATION>s ago) and ran for <REDACTED DURATION>ms
743+
last completion reported error: looking up MGS addresses
744+
734745
task: "support_bundle_collector"
735746
configured period: every <REDACTED_DURATION>days <REDACTED_DURATION>h <REDACTED_DURATION>m <REDACTED_DURATION>s
736747
currently executing: no
@@ -1250,6 +1261,13 @@ task: "service_zone_nat_tracker"
12501261
started at <REDACTED_TIMESTAMP> (<REDACTED DURATION>s ago) and ran for <REDACTED DURATION>ms
12511262
last completion reported error: inventory collection is None
12521263

1264+
task: "sp_ereport_ingester"
1265+
configured period: every <REDACTED_DURATION>s
1266+
currently executing: no
1267+
last completed activation: <REDACTED ITERATIONS>, triggered by a periodic timer firing
1268+
started at <REDACTED_TIMESTAMP> (<REDACTED DURATION>s ago) and ran for <REDACTED DURATION>ms
1269+
last completion reported error: looking up MGS addresses
1270+
12531271
task: "support_bundle_collector"
12541272
configured period: every <REDACTED_DURATION>days <REDACTED_DURATION>h <REDACTED_DURATION>m <REDACTED_DURATION>s
12551273
currently executing: no

dev-tools/omdb/tests/usage_errors.out

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ Commands:
119119
rack Print information about the rack
120120
disks Print information about virtual disks
121121
dns Print information about internal and external DNS
122+
ereport Query and display error reports
122123
inventory Print information about collected hardware/software inventory
123124
physical-disks Print information about physical disks
124125
region Print information about regions
@@ -176,6 +177,7 @@ Commands:
176177
rack Print information about the rack
177178
disks Print information about virtual disks
178179
dns Print information about internal and external DNS
180+
ereport Query and display error reports
179181
inventory Print information about collected hardware/software inventory
180182
physical-disks Print information about physical disks
181183
region Print information about regions

0 commit comments

Comments
 (0)