Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Deletes 5 unused public getter methods that return
&'staticmetric handles incrates/apollo_infra/src/metrics.rs:LocalClientMetrics::get_response_time_metricRemoteClientMetrics::get_response_time_metricRemoteClientMetrics::get_communication_failure_time_metricLocalServerMetrics::get_processing_time_metricLocalServerMetrics::get_queueing_time_metricWhy they're dead
Each of these methods is never called anywhere:
*_test.rs,tests/, andbenches/).starkware-industries/sequencer-devopsandstarkware-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'sregister,record_*, andget_all_labeled_metricsmethods, which access the fields directly rather than through these getters.apollo_infrais 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 inLocalServerMetricsrefers toget_*_valuetest accessors (which parse a metric string, gated by#[cfg(any(feature = "testing", test))]), not to theseget_*_metrichandle getters; it is intentionally left untouched.Verification (
RUSTC_WRAPPERunset,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