Skip to content

Conversation

@matanl-starkware
Copy link
Collaborator

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Collaborator Author

matanl-starkware commented Oct 29, 2025

@matanl-starkware matanl-starkware force-pushed the 10-29-apollo_dashboard_create_metriccommon_trait branch from 7012545 to e4e8ade Compare October 30, 2025 09:36
@matanl-starkware matanl-starkware force-pushed the 10-29-apollo_dashboard_simpler_new_fn_for_panel branch from 78a13b3 to 0f23e90 Compare October 30, 2025 09:36
@matanl-starkware matanl-starkware force-pushed the 10-29-apollo_dashboard_create_metriccommon_trait branch from e4e8ade to 5897c62 Compare October 30, 2025 10:56
@github-actions
Copy link

github-actions bot commented Oct 30, 2025

Benchmark movements: tree_computation_flow performance improved 😺 tree_computation_flow time: [13.782 ms 13.939 ms 14.096 ms] change: [-4.9950% -3.5745% -2.0722%] (p = 0.00 < 0.05) Performance has improved. Found 1 outliers among 100 measurements (1.00%) 1 (1.00%) high mild full_committer_flow performance regressed! full_committer_flow time: [15.202 ms 15.323 ms 15.448 ms] change: [+2.0848% +3.3243% +4.5808%] (p = 0.00 < 0.05) Performance has regressed. Found 5 outliers among 100 measurements (5.00%) 5 (5.00%) high mild

@matanl-starkware matanl-starkware force-pushed the 10-29-apollo_dashboard_simpler_new_fn_for_panel branch from 0f23e90 to b710d56 Compare October 30, 2025 11:07
@matanl-starkware matanl-starkware force-pushed the 10-29-apollo_dashboard_create_metriccommon_trait branch from 5897c62 to 2bdb8f9 Compare October 30, 2025 11:07
Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 31 files reviewed, 1 unresolved discussion


crates/apollo_metrics/src/metrics.rs line 54 at r1 (raw file):

#[derive(Clone, Debug)]
struct Metric {

Can also impl MetricCommon

Code quote:

struct Metric

Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 31 files reviewed, 2 unresolved discussions (waiting on @matanl-starkware)


crates/apollo_metrics/src/metrics.rs line 79 at r1 (raw file):

        initial_value: u64,
    ) -> Self {
        Self { metric: Metric { scope, name, description }, initial_value }

wdyt about a new fn?

Code quote:

 Metric { scope, name, description }

Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 31 files reviewed, 3 unresolved discussions (waiting on @matanl-starkware)


crates/apollo_metrics/src/metrics.rs line 54 at r1 (raw file):

#[derive(Clone, Debug)]
struct Metric {

wdyt about:
Metric (struct) -> MetricProperties / MetricCommonProperties / MetricAttributes / MetricCommonAttributes
MetricCommon (trait) -> Metric{whatever-comes-here-according-to-the-previous}Reader

Code quote:

 Metric

Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 31 files reviewed, 4 unresolved discussions (waiting on @matanl-starkware)


crates/apollo_metrics/src/metrics.rs line 192 at r1 (raw file):

    fn get_description(&self) -> &'static str {
        self.metric.description
    }

Please implement once for the inner common member, and for the outer one call the fn on the inner

Code quote:

    fn get_name(&self) -> &'static str {
        self.metric.name
    }

    fn get_name_with_filter(&self) -> String {
        format!("{}{}", self.metric.name, metric_label_filter!())
    }

    fn get_scope(&self) -> MetricScope {
        self.metric.scope
    }

    fn get_description(&self) -> &'static str {
        self.metric.description
    }

Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 31 files reviewed, 4 unresolved discussions (waiting on @matanl-starkware)


crates/apollo_metrics/src/metrics.rs line 192 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

Please implement once for the inner common member, and for the outer one call the fn on the inner

Also since this is just boilerplating of calling the inner fn I'd consider a macro:

  1. the most elegant solution seems like a proc macro, which happens to be already implemented in this https://crates.io/crates/ambassador
  2. if we prefer to avoid adding a dependency we can impl it ourselfs (not fun but doable)
  3. we can also go for a simpler macro like:
/// Expands to:
/// fn NAME(&self) -> T { self.inner.NAME() }
///
/// Usage (inside an `impl` block):
/// delegate_inner_fn!(ping -> u32);
macro_rules! delegate_inner_fn {
    ($name:ident -> $ret:ty) => {
        fn $name(&self) -> $ret {
            self.inner.$name()
        }
    };
}

and the invocations will be

impl Metric for MetricGauge {
    delegate_inner_fn!(get_name -> &'static str);
    ...
}

I suggest option 1

@matanl-starkware matanl-starkware force-pushed the 10-29-apollo_dashboard_create_metriccommon_trait branch from 2bdb8f9 to ca12bc4 Compare October 30, 2025 13:14
Copy link
Collaborator Author

@matanl-starkware matanl-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 31 files reviewed, 4 unresolved discussions (waiting on @Itay-Tsabary-Starkware)


crates/apollo_metrics/src/metrics.rs line 54 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

Can also impl MetricCommon

Done.


crates/apollo_metrics/src/metrics.rs line 54 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

wdyt about:
Metric (struct) -> MetricProperties / MetricCommonProperties / MetricAttributes / MetricCommonAttributes
MetricCommon (trait) -> Metric{whatever-comes-here-according-to-the-previous}Reader

Overkill IMO. It can be done someday if necessary.


crates/apollo_metrics/src/metrics.rs line 79 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

wdyt about a new fn?

Done.


crates/apollo_metrics/src/metrics.rs line 192 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

Also since this is just boilerplating of calling the inner fn I'd consider a macro:

  1. the most elegant solution seems like a proc macro, which happens to be already implemented in this https://crates.io/crates/ambassador
  2. if we prefer to avoid adding a dependency we can impl it ourselfs (not fun but doable)
  3. we can also go for a simpler macro like:
/// Expands to:
/// fn NAME(&self) -> T { self.inner.NAME() }
///
/// Usage (inside an `impl` block):
/// delegate_inner_fn!(ping -> u32);
macro_rules! delegate_inner_fn {
    ($name:ident -> $ret:ty) => {
        fn $name(&self) -> $ret {
            self.inner.$name()
        }
    };
}

and the invocations will be

impl Metric for MetricGauge {
    delegate_inner_fn!(get_name -> &'static str);
    ...
}

I suggest option 1

Done.

@matanl-starkware matanl-starkware force-pushed the 10-29-apollo_dashboard_create_metriccommon_trait branch from ca12bc4 to 036a316 Compare October 30, 2025 13:34
@matanl-starkware matanl-starkware force-pushed the 10-29-apollo_dashboard_simpler_new_fn_for_panel branch from b710d56 to 56dd569 Compare October 30, 2025 13:34
@matanl-starkware matanl-starkware force-pushed the 10-29-apollo_dashboard_create_metriccommon_trait branch from 036a316 to 622dbe7 Compare October 30, 2025 15:48
@matanl-starkware matanl-starkware force-pushed the 10-29-apollo_dashboard_simpler_new_fn_for_panel branch 2 times, most recently from aee5cdc to f55bde5 Compare October 30, 2025 17:49
@matanl-starkware matanl-starkware force-pushed the 10-29-apollo_dashboard_create_metriccommon_trait branch from 622dbe7 to 8904928 Compare October 30, 2025 17:49
@matanl-starkware matanl-starkware marked this pull request as ready for review October 30, 2025 17:56
@matanl-starkware matanl-starkware changed the base branch from 10-29-apollo_dashboard_simpler_new_fn_for_panel to graphite-base/9857 October 30, 2025 18:03
Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@Itay-Tsabary-Starkware reviewed 26 of 31 files at r1, 1 of 1 files at r2, 4 of 4 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @matanl-starkware)

@matanl-starkware matanl-starkware force-pushed the 10-29-apollo_dashboard_create_metriccommon_trait branch from 8904928 to 4215e84 Compare November 2, 2025 11:03
@matanl-starkware matanl-starkware changed the base branch from graphite-base/9857 to main-v0.14.1 November 2, 2025 11:03
@graphite-app
Copy link

graphite-app bot commented Nov 2, 2025

Merge activity

  • Nov 2, 11:04 AM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.

Copy link
Collaborator Author

@matanl-starkware matanl-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matanl-starkware reviewed 24 of 31 files at r1, 1 of 1 files at r2, 4 of 4 files at r3, 2 of 2 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @matanl-starkware)

@matanl-starkware matanl-starkware added this pull request to the merge queue Nov 2, 2025
Merged via the queue into main-v0.14.1 with commit 8a7a038 Nov 2, 2025
32 of 73 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants