Closed miazn closed 3 months ago
@ljedrz is there a more optimal way to do the enum matching?
Was this found to be slow? Enum matching on its own shouldn't be a big deal, it's the mutable borrows that e.g. disallow parallel processing; if the iteration needs to be faster, the counters can be made atomic, then the _mut
s can be dropped from the get
s, and the iteration can be parallelized with rayon
.
after discussing with @iamalwaysuncomfortable , we decided it might make the most sense to move the metrics related functions to the actual metrics crate. This makes it possible to import rayon
optionally when metrics
is enabled and serial
is disabled , as well as the added bonus of cleaning up protocol logic code
thanks for making the change!
Motivation
It's useful to have more granular metrics as to what types of transactions are included in blocks, as well as aborted transactions and solutions.
This pr adds 6 new metrics:
I did not yet remove the existing confirmed transactions (which we can get by summing the accepted deploys and executes), but that would probably be best to avoid duplicate data (can sum in post processing for analysis).
Test Plan
Still testing to get all types recorded