-
Notifications
You must be signed in to change notification settings - Fork 12
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
Version 0 of gomu-gomu-no-gatling #3
Version 0 of gomu-gomu-no-gatling #3
Conversation
- Add SysInfo, MetricResult and BenchmarkReport structs with Display/Serilize implementations when needed - Count sent, failed, accepted and rejected transactions - Refacoring: rename some structs, move functions to suitable modules ...
In another issue/PR, we'll have to:
|
src/metrics.rs
Outdated
}; | ||
pub static ref METRICS: Vec<Metric> = vec![ | ||
Metric { | ||
name: "Average TPS".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.
I think you can remove the .to_string
part, and keep them as &str
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.
Yes, but we'll introduce lifetimes everywhere and maybe we'll have to use 'static
lifetime because METRICS
is a static variable and it's used in compute_all_metrics
which is called by BenchmarkReport::from_block_range
and BenchmarkReport::from_last_x_blocks
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.
At this point, METRIC
being a Vec
should not be static
anymore. It should be const
and of type [Metric; 2]
. And those metrics could be &'static str
rather than String
Also please do the fixes, but let me resolve the conversation. You closing them makes it harder for me to keep track and review again. |
src/metrics.rs
Outdated
}; | ||
pub static ref METRICS: Vec<Metric> = vec![ | ||
Metric { | ||
name: "Average TPS".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.
At this point, METRIC
being a Vec
should not be static
anymore. It should be const
and of type [Metric; 2]
. And those metrics could be &'static str
rather than String
Also, replace `Serialize` implementation for `BenchmarkReport` with a `to_json` method
This PR Addresses most of #2
Extendable metrics
For metrics to be extendable, I defined a
Metric
struct and a static variableMETRICS
of all the available metrics, theMetric
compute field is a function that takes a map between block numbers and the number of transactions in that block and return a float (take a look at existing metrics to get a better idea)To add a new metric, we define a function, the add a
Metric
instance to theMETRICS
list then reports will automatically use it. At a later stage, we'll allow users to choose what metrics they want to use for each benchmark and/or the whole benchmarking session from the config filePost benchmark check
After discussing with @d-roak and @approv, what we're doing now is wait for all transactions to be incorporated into blocks to calculate metrics, otherwise we'll never be sure we're calculating the right metrics because we can calculate the metrics before the transactions are accepted or worse after that with one or empty blocks which will give us wrong results
Is that what you meant with "post benchmark check" ?
And does
fail_safe
mean we have to panic if one transactions is failed/not found ... ?Still missing:
fail_fast
but we'll have to define what's the expected behavior first.X
blocks configurable