-
Notifications
You must be signed in to change notification settings - Fork 65
apollo_dashboard: add new module queries_builder #9863
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
apollo_dashboard: add new module queries_builder #9863
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
4ce48ed to
ccbac5a
Compare
e4e8ade to
5897c62
Compare
ccbac5a to
df4d8bb
Compare
5897c62 to
2bdb8f9
Compare
Itay-Tsabary-Starkware
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.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion
crates/apollo_dashboard/src/lib.rs line 9 at r1 (raw file):
mod metric_definitions_test; mod panels; mod queries_builder;
Please annotate this with #[cfg(test)], and remove the inner-file annotations
(it seems like the entire module is just for testing)
Code quote:
mod queries_builder;
Itay-Tsabary-Starkware
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.
Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @matanl-starkware)
crates/apollo_dashboard/src/queries_builder.rs line 3 at r1 (raw file):
pub(crate) mod queries { #[cfg(test)] use apollo_metrics::metrics::MetricCommon;
Move to the top
Code quote:
use apollo_metrics::metrics::MetricCommon;
Itay-Tsabary-Starkware
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.
Reviewable status: 0 of 2 files reviewed, 3 unresolved discussions (waiting on @matanl-starkware)
crates/apollo_dashboard/src/queries_builder.rs line 13 at r1 (raw file):
#[cfg(test)] mod tests { use apollo_metrics::metrics::{MetricGauge, MetricScope};
Move to the top
Code quote:
use apollo_metrics::metrics::{MetricGauge, MetricScope};
Itay-Tsabary-Starkware
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.
Reviewable status: 0 of 2 files reviewed, 4 unresolved discussions (waiting on @matanl-starkware)
crates/apollo_dashboard/src/queries_builder.rs line 1 at r1 (raw file):
pub(crate) mod queries {
Remove this, and instead define fn increase as a fn of this module; no need for pub(crate) as well.
Code quote:
pub(crate) mod queries {
Itay-Tsabary-Starkware
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.
Reviewable status: 0 of 2 files reviewed, 5 unresolved discussions (waiting on @matanl-starkware)
crates/apollo_dashboard/src/queries_builder.rs line 22 at r1 (raw file):
let q = queries::increase(&m, "5m"); assert_eq!(q, r#"increase(testing{cluster=~"$cluster", namespace=~"$namespace"}[5m])"#); }
Move outside of mod teststo the top hierachy of the queries_build module , and then delete mod tests
Code quote:
#[test]
fn increase_formats_correctly() {
let m = MetricGauge::new(MetricScope::Batcher, "testing", "Fake description");
let q = queries::increase(&m, "5m");
assert_eq!(q, r#"increase(testing{cluster=~"$cluster", namespace=~"$namespace"}[5m])"#);
}
Itay-Tsabary-Starkware
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.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion
crates/apollo_dashboard/src/lib.rs line 9 at r1 (raw file):
mod metric_definitions_test; mod panels; mod queries_builder;
Saw pr #9866 so retracted all previous comments.
Please:
- rename
queries_buildertoquery_builder - create a
query_builder_testsmodule - add
query_builder_teststoquery_builderwith the cfg-test annotation
Code quote:
mod queries_builder;
Itay-Tsabary-Starkware
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.
Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @matanl-starkware)
crates/apollo_dashboard/src/queries_builder.rs line 21 at r1 (raw file):
let m = MetricGauge::new(MetricScope::Batcher, "testing", "Fake description"); let q = queries::increase(&m, "5m"); assert_eq!(q, r#"increase(testing{cluster=~"$cluster", namespace=~"$namespace"}[5m])"#);
We have this defined as a macro, please check metric_label_filter
- I'll note that afaiu it doesn't have to be a macro anymore, and can be changed to a normal const instead
- We also have a util struct called
Templatethat can be relevant here as well
Code quote:
{cluster=~"$cluster", namespace=~"$namespace"}2bdb8f9 to
ca12bc4
Compare
df4d8bb to
8b9c102
Compare
ca12bc4 to
036a316
Compare
9fe4534 to
fb9f2d9
Compare
036a316 to
622dbe7
Compare
matanl-starkware
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.
Reviewable status: 0 of 4 files reviewed, 2 unresolved discussions (waiting on @Itay-Tsabary-Starkware)
crates/apollo_dashboard/src/lib.rs line 9 at r1 (raw file):
Previously, Itay-Tsabary-Starkware wrote…
Saw pr #9866 so retracted all previous comments.
Please:
- rename
queries_buildertoquery_builder- create a
query_builder_testsmodule- add
query_builder_teststoquery_builderwith the cfg-test annotation
Done.
crates/apollo_dashboard/src/queries_builder.rs line 1 at r1 (raw file):
Previously, Itay-Tsabary-Starkware wrote…
Remove this, and instead define
fn increaseas a fn of this module; no need forpub(crate)as well.
Without pub(crate), it becomes private, and unittest can't use it.
crates/apollo_dashboard/src/queries_builder.rs line 21 at r1 (raw file):
Previously, Itay-Tsabary-Starkware wrote…
We have this defined as a macro, please check
metric_label_filter
- I'll note that afaiu it doesn't have to be a macro anymore, and can be changed to a normal const instead
- We also have a util struct called
Templatethat can be relevant here as well
Done.
fb9f2d9 to
97f9e5f
Compare
622dbe7 to
8904928
Compare
97f9e5f to
0e2f8bb
Compare
Itay-Tsabary-Starkware
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.
@Itay-Tsabary-Starkware reviewed 3 of 4 files at r2, all commit messages.
Reviewable status: 3 of 4 files reviewed, all discussions resolved
crates/apollo_dashboard/src/query_builder.rs line 1 at r2 (raw file):
use apollo_metrics::metrics::MetricCommon;
Please add a new line after the use section (non-blocking)
Itay-Tsabary-Starkware
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.
Reviewable status: 3 of 4 files reviewed, all discussions resolved
crates/apollo_dashboard/src/lib.rs line 11 at r2 (raw file):
// TODO(MatanL): Remove cfg(test) when used #[cfg(test)]
Not requried afaiu
Code quote:
// TODO(MatanL): Remove cfg(test) when used
#[cfg(test)]
matanl-starkware
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.
Reviewable status: 3 of 4 files reviewed, all discussions resolved (waiting on @Itay-Tsabary-Starkware)
crates/apollo_dashboard/src/lib.rs line 11 at r2 (raw file):
Previously, Itay-Tsabary-Starkware wrote…
Not requried afaiu
It is required (increase not used in this PR, unless under test)
0e2f8bb to
88ee7de
Compare
8904928 to
4215e84
Compare
matanl-starkware
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.
@matanl-starkware reviewed 3 of 4 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @matanl-starkware)
4215e84 to
8a7a038
Compare
88ee7de to
bf0a52b
Compare
Merge activity
|
bf0a52b to
6565a7d
Compare
Itay-Tsabary-Starkware
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.
@Itay-Tsabary-Starkware reviewed 1 of 4 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @matanl-starkware)

No description provided.