-
Notifications
You must be signed in to change notification settings - Fork 14
metrics: add metrics module and protos #141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
gabotechs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good! just left some minor comments, but none are blocking so leaving a +1
src/metrics/proto.rs
Outdated
|
|
||
| /// A ProtoMetric is a protobuf mirror of [datafusion::physical_plan::metrics::Metric]. | ||
| #[derive(Clone, PartialEq, ::prost::Message)] | ||
| pub struct ProtoMetric { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: in other parts of the project we name the "proto" version of other structs by appending the Proto keyword as a suffix. How about also doing it here and naming things MetricProto, MetricsSetProto, etc...?
src/metrics/proto.rs
Outdated
| None => Err(DataFusionError::Internal( | ||
| "proto metric is missing the metric field".to_string(), | ||
| )), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: A short version of this could be:
| None => Err(DataFusionError::Internal( | |
| "proto metric is missing the metric field".to_string(), | |
| )), | |
| None => internal_err!("proto metric is missing the metric field"), |
src/metrics/proto.rs
Outdated
| let test_cases = vec![ | ||
| TestCase { | ||
| name: "empty", | ||
| metrics_set: Box::new(|| MetricsSet::new()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 clippy should be failing here pointing you to do something like:
| metrics_set: Box::new(|| MetricsSet::new()), | |
| metrics_set: Box::new(MetricsSet::new), |
I wonder why pipelines are passing... maybe we are not correctly running clippy under tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oo nice catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the clippy command in CI to use --all-targets and --features integration
This change adds a metrics module containing proto definitions to mirror datafusion metrics. These will be used for EXPLAIN ANALYZE. It also adds roundtrip serialization tests. Informs #123.
985026b to
c23bfa1
Compare
This change adds a metrics module containing proto definitions to mirror datafusion metrics. These will be used for EXPLAIN ANALYZE. It also adds roundtrip serialization tests.
Informs #123.