Skip to content

feat(devkit): add health, metrics, repair subcommands; --quiet and --dry-run flags#419

Merged
Tinna23 merged 1 commit into
StellarCommons:mainfrom
Fahmedo:feat/issues-396-397-398-399
Jul 2, 2026
Merged

feat(devkit): add health, metrics, repair subcommands; --quiet and --dry-run flags#419
Tinna23 merged 1 commit into
StellarCommons:mainfrom
Fahmedo:feat/issues-396-397-398-399

Conversation

@Fahmedo

@Fahmedo Fahmedo commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Resolves issues #396, #397, #398, and #399 in a single commit.


#396 — Add health subcommand

  • New packages/devkit/src/monitoring/health.rs
  • Implements HealthRegistry, HealthCheck, DbHealthCheck, MemoryHealthCheck, HealthStatus
  • HealthArgs::run() prints pass/fail per check and overall status; returns false (exit 1) if any check fails
  • Flags: --json, --db-path, --check <name>

#397 — Add metrics subcommand

  • New packages/devkit/src/monitoring/metrics.rs
  • Implements Metrics snapshot with counters for simulations, fee points, spikes, exports, replays, uptime, memory, and custom key-value pairs
  • MetricsArgs::run() prints a text report or --json object
  • Flags: --json, --reset

#398 — Add --quiet flag to all subcommands

  • Added quiet: bool as a global = true clap arg on Cli in cli/mod.rs
  • When set, all subcommand handlers suppress output except errors — useful for scripting
  • HealthArgs, MetricsArgs, and RepairArgs each honour the quiet field

#399 — Add --dry-run flag to repair and export subcommands

  • repair --dry-run: Repair::apply(dry_run=true) returns planned RepairActions without modifying data
  • export --dry-run: reports what would be written without touching the filesystem
  • New data_quality/repair.rs implements full detect → plan → apply pipeline with DataIssue and RepairAction enums

Files changed

File Change
src/cli/mod.rs Add --quiet global flag; Health, Metrics, Repair subcommands; --dry-run on Export/Repair
src/lib.rs Register pub mod monitoring and pub mod data_quality
src/monitoring/mod.rs New module entry point
src/monitoring/health.rs Full health-check implementation + unit tests
src/monitoring/metrics.rs Full metrics implementation + unit tests
src/data_quality/mod.rs New module entry point
src/data_quality/repair.rs Full repair pipeline implementation + unit tests

Closes #396
Closes #397
Closes #398
Closes #399

…dry-run flags

- Add monitoring/health.rs: HealthRegistry, HealthCheck, DbHealthCheck,
  MemoryHealthCheck, HealthStatus, HealthArgs with --json, --db-path,
  --check flags. Exit code 1 on any failing check. Closes StellarCommons#396.

- Add monitoring/metrics.rs: Metrics struct, MetricsArgs with --json
  and --reset flags. Prints full devkit runtime metrics report. Closes StellarCommons#397.

- Add --quiet global flag to Cli in cli/mod.rs. When set, all subcommand
  handlers suppress output except errors, making devkit scriptable. Closes StellarCommons#398.

- Add --dry-run flag to repair and export subcommands in cli/mod.rs.
  Repair::apply(dry_run=true) returns planned actions without modifying data.
  Export dry-run reports what would be written without writing. Closes StellarCommons#399.

- Add data_quality/repair.rs: Repair struct with detect/plan/apply,
  DataIssue and RepairAction enums, RepairArgs with --dry-run, --json,
  --check-only, --quiet flags.

- Register pub mod monitoring and pub mod data_quality in lib.rs.
@drips-wave

drips-wave Bot commented Jun 30, 2026

Copy link
Copy Markdown

@Fahmedo Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Tinna23 Tinna23 merged commit f0a72ef into StellarCommons:main Jul 2, 2026
2 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants