Skip to content

apollo_infra: delete dead code - #15114

Open
asaf-sw wants to merge 1 commit into
mainfrom
code_slayer/remove_dead_code_in_apollo_infra
Open

asaf-sw wants to merge 1 commit into
mainfrom
code_slayer/remove_dead_code_in_apollo_infra

Conversation

@asaf-sw

@asaf-sw asaf-sw commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

What

Deletes 5 unused public getter methods that return &'static metric handles in crates/apollo_infra/src/metrics.rs:

  • LocalClientMetrics::get_response_time_metric
  • RemoteClientMetrics::get_response_time_metric
  • RemoteClientMetrics::get_communication_failure_time_metric
  • LocalServerMetrics::get_processing_time_metric
  • LocalServerMetrics::get_queueing_time_metric

Why they're dead

Each of these methods is never called anywhere:

  • Zero callers in the workspace (all crates, including *_test.rs, tests/, and benches/).
  • Zero references in the sibling repos starkware-industries/sequencer-devops and starkware-industries/starkware (searched identifier names across code, scripts, and config).

Removing them does not orphan any struct field: each underlying field (response_times, communication_failure_times, processing_times, queueing_times) remains used by that struct's register, record_*, and get_all_labeled_metrics methods, which access the fields directly rather than through these getters.

apollo_infra is an internal infrastructure crate (not a published SDK); these getters are not part of an externally consumed API surface.

Precedent

This is the same cleanup as #12559 ("apollo_infra: remove unused metric getter methods"), which removed other unused metric-handle getters from these same structs. The getters removed here were left in place at that time but have since become unused.

Note: the unrelated // TODO(Tsabary): add the getter fns for tests. comment in LocalServerMetrics refers to get_*_value test accessors (which parse a metric string, gated by #[cfg(any(feature = "testing", test))]), not to these get_*_metric handle getters; it is intentionally left untouched.

Verification (RUSTC_WRAPPER unset, CARGO_INCREMENTAL=0)

  • scripts/rust_fmt.sh — clean (no reformatting).
  • cargo build -p apollo_infra — zero warnings.
  • cargo build -p apollo_infra --tests — zero warnings.
  • cargo clippy -p apollo_infra --all-targets — clean (exit 0).
  • SEED=0 cargo test -p apollo_infra — 43 passed, 0 failed (+ doc-tests).

🤖 Generated with Claude Code

https://claude.ai/code/session_017qk1V7PE8s7D9ZDoMrBnhV


Generated by Claude Code

Deletes 5 unused public getter methods that return `&'static` metric
handles in `crates/apollo_infra/src/metrics.rs`:

- `LocalClientMetrics::get_response_time_metric`
- `RemoteClientMetrics::get_response_time_metric`
- `RemoteClientMetrics::get_communication_failure_time_metric`
- `LocalServerMetrics::get_processing_time_metric`
- `LocalServerMetrics::get_queueing_time_metric`

Each of these methods has zero callers in the workspace (all crates,
including `*_test.rs`, `tests/`, and `benches/`) and zero references in
the sibling repos `sequencer-devops` and `starkware`. Removing them does
not orphan any struct field: each underlying field (`response_times`,
`communication_failure_times`, `processing_times`, `queueing_times`)
stays used by that struct's `register`, `record_*`, and
`get_all_labeled_metrics` methods, which access the fields directly.

This mirrors #12559 ("apollo_infra: remove unused metric getter
methods"), which removed other unused metric-handle getters from these
same structs. The unrelated `// TODO(Tsabary): add the getter fns for
tests.` comment refers to `get_*_value` test accessors, not these
handle getters, and is left untouched.

Verified (RUSTC_WRAPPER unset, CARGO_INCREMENTAL=0): rust_fmt clean;
`cargo build -p apollo_infra` and `--tests` both build with zero
warnings; `cargo clippy -p apollo_infra --all-targets` clean;
`SEED=0 cargo test -p apollo_infra` 43 passed, 0 failed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017qk1V7PE8s7D9ZDoMrBnhV
@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants