-
Notifications
You must be signed in to change notification settings - Fork 65
apollo_mempool: use expect! in metrics test #11389
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
|
Artifacts upload workflows: |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
e97baac to
e15adfe
Compare
dorimedini-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.
@dorimedini-starkware reviewed 5 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dafnamatsry and @TzahiTaub).
crates/apollo_mempool/src/mempool_test.rs line 1340 at r2 (raw file):
} "#]] .assert_debug_eq(&MempoolMetrics::from_recorder(&recorder));
the histogram fields are likely to vary, right?
do you care about their regression?
if not, I would delete these fields:
let mut metrics = MempoolMetrics::from_recorder(&recorder);
metrics.transaction_time_spent_until_batched.histogram = Default::default();
metrics.transaction_time_spent_until_committed.histogram = Default::default();
expect![[r#".."]].assert_debug_eq(&metrics);
Suggestion:
let mut metrics = MempoolMetrics::from_recorder(&recorder);
metrics.transaction_time_spent_until_batched.histogram = Default::default();
metrics.transaction_time_spent_until_committed.histogram = Default::default();
expect![[r#"
MempoolMetrics {
txs_received_invoke: 8,
txs_received_declare: 2,
txs_received_deploy_account: 0,
txs_committed: 3,
txs_dropped_expired: 1,
txs_dropped_rejected: 1,
txs_dropped_evicted: 1,
pool_size: 3,
priority_queue_size: 2,
pending_queue_size: 1,
get_txs_size: 1,
delayed_declares_size: 1,
total_size_in_bytes: 1552,
transaction_time_spent_until_batched: HistogramValue {
sum: 2.0,
count: 1,
histogram: {
"0": 2.0,
"0.5": 1.9999056357269998,
"0.9": 1.9999056357269998,
"0.95": 1.9999056357269998,
"0.99": 1.9999056357269998,
"0.999": 1.9999056357269998,
"1": 2.0,
},
},
transaction_time_spent_until_committed: HistogramValue {
sum: 42.0,
count: 3,
histogram: {
"0": 0.0,
"0.5": 19.999354639046004,
"0.9": 19.999354639046004,
"0.95": 19.999354639046004,
"0.99": 19.999354639046004,
"0.999": 19.999354639046004,
"1": 22.0,
},
},
}
"#]]
.assert_debug_eq(&metrics);crates/apollo_mempool/src/test_utils.rs line 360 at r2 (raw file):
.assert_eq(metrics, &self.transaction_time_spent_until_batched); TRANSACTION_TIME_SPENT_UNTIL_COMMITTED .assert_eq(metrics, &self.transaction_time_spent_until_committed);
previously, you sent Default::default() histograms to this assert_eq function; how did it work before?
Code quote:
TRANSACTION_TIME_SPENT_UNTIL_BATCHED
.assert_eq(metrics, &self.transaction_time_spent_until_batched);
TRANSACTION_TIME_SPENT_UNTIL_COMMITTED
.assert_eq(metrics, &self.transaction_time_spent_until_committed);e15adfe to
46a01cb
Compare
dafnamatsry
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.
@dafnamatsry made 2 comments.
Reviewable status: 4 of 5 files reviewed, 2 unresolved discussions (waiting on @dorimedini-starkware and @TzahiTaub).
crates/apollo_mempool/src/mempool_test.rs line 1340 at r2 (raw file):
Previously, dorimedini-starkware wrote…
the
histogramfields are likely to vary, right?
do you care about their regression?
if not, I would delete these fields:let mut metrics = MempoolMetrics::from_recorder(&recorder); metrics.transaction_time_spent_until_batched.histogram = Default::default(); metrics.transaction_time_spent_until_committed.histogram = Default::default(); expect![[r#".."]].assert_debug_eq(&metrics);
Done.
crates/apollo_mempool/src/test_utils.rs line 360 at r2 (raw file):
Previously, dorimedini-starkware wrote…
previously, you sent
Default::default()histograms to this assert_eq function; how did it work before?
The PartialEq implementation of HistogramValue ignores the histogram field.
dorimedini-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.
@dorimedini-starkware reviewed 1 file and all commit messages, and resolved 2 discussions.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @TzahiTaub).
46a01cb to
131463d
Compare
dafnamatsry
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.
@dafnamatsry reviewed 1 file and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @TzahiTaub).

No description provided.