metrics: count large txn groups and msigs#4833
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4833 +/- ##
==========================================
- Coverage 53.80% 53.76% -0.05%
==========================================
Files 421 421
Lines 53827 53849 +22
==========================================
- Hits 28963 28952 -11
- Misses 22516 22542 +26
- Partials 2348 2355 +7
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
algonautshant
left a comment
There was a problem hiding this comment.
Looks great.
Some minor comments and one possible bug?
| var logicErrTotal = metrics.MakeCounter(metrics.MetricName{Name: "algod_ledger_logic_err", Description: "Total transaction scripts executed and errored"}) | ||
| var msigLessOrEqual4 = metrics.MakeCounter(metrics.MetricName{Name: "algod_verify_msig_4", Description: "Total transactions with 1-4 msigs"}) | ||
| var msigLessOrEqual16 = metrics.MakeCounter(metrics.MetricName{Name: "algod_verify_msig_4_16", Description: "Total transactions with 4-16 msigs"}) | ||
| var msigMore16 = metrics.MakeCounter(metrics.MetricName{Name: "algod_verify_msig_16", Description: "Total transactions with 16+ msigs"}) |
There was a problem hiding this comment.
nit: (personal preference...)
| var msigMore16 = metrics.MakeCounter(metrics.MetricName{Name: "algod_verify_msig_16", Description: "Total transactions with 16+ msigs"}) | |
| var msig17orMore = metrics.MakeCounter(metrics.MetricName{Name: "algod_verify_msig_17", Description: "Total transactions with 17 or more msigs"}) |
| var msigMore16 = metrics.MakeCounter(metrics.MetricName{Name: "algod_verify_msig_16", Description: "Total transactions with 16+ msigs"}) | ||
| var msigLsigLessOrEqual4 = metrics.MakeCounter(metrics.MetricName{Name: "algod_verify_msig_lsig_4", Description: "Total transaction scripts with 1-4 msigs"}) | ||
| var msigLsigLessOrEqual16 = metrics.MakeCounter(metrics.MetricName{Name: "algod_verify_msig_lsig_4_16", Description: "Total transaction scripts with 4-16 msigs"}) | ||
| var msigLsigMore16 = metrics.MakeCounter(metrics.MetricName{Name: "algod_verify_msig_lsig_16", Description: "Total transaction scripts with 16+ msigs"}) |
There was a problem hiding this comment.
nit: (personal preference...)
| var msigLsigMore16 = metrics.MakeCounter(metrics.MetricName{Name: "algod_verify_msig_lsig_16", Description: "Total transaction scripts with 16+ msigs"}) | |
| var msigLsig17orMore = metrics.MakeCounter(metrics.MetricName{Name: "algod_verify_msig_lsig_17", Description: "Total transaction scripts with 17 or more msigs"}) |
cfc2fd8 to
60f5822
Compare
60f5822 to
9d0d9f2
Compare
|
Removed tx group size early filtering, renamed metrics according to current state |
| if ntx == config.MaxTxGroupSize { | ||
| transactionMessageTxGroupFull.Inc(nil) | ||
| } else if ntx > config.MaxTxGroupSize { | ||
| transactionMessageTxGroupExcessive.Inc(nil) |
There was a problem hiding this comment.
Could we also add a break out of the for loop above right after ntx++ (or in the for condition) if it exceeds MaxTxGroupSize?
There was a problem hiding this comment.
| counter := 0 | ||
| for _, subsigi := range s.Msig.Subsigs { | ||
| if (subsigi.Sig != crypto.Signature{}) { | ||
| counter++ |
There was a problem hiding this comment.
Another way to count this would be to call batchVerifier.GetNumberOfEnqueuedSignatures() before and after the call to crypto.MultisigBatchPrep and calculate the difference
There was a problem hiding this comment.
you could also have crypto.MultisigBatchPrep return a (count, err)
cce
left a comment
There was a problem hiding this comment.
looks correct, a test would be nice to prove it, and eventually we may want to build a rudimentary histogram-to-counter system that sets up buckets of value ranges (0-5, 6-10, etc) and assign them to counters so we don't have to have duplicate value-to-counter code like this start to pop up in more places
Summary
Add more metrics to better understand traffic.
Test Plan
Existing tests