Skip to content
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

subsystem-bench: Extract prometheus endpoint launching from regression test cases to use it only with cli runner #3600

Open
AndreiEres opened this issue Mar 6, 2024 · 1 comment
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. R0-silent Changes should not be mentioned in any release notes T12-benchmarks This PR/Issue is related to benchmarking and weights.

Comments

@AndreiEres
Copy link
Contributor

We use an awkward false argument to not initialize a prometheus endpoint inside regression tests. Otherwise, each test will start an unconfigurable endpoint, causing errors because they will use the same port 9999.

prepare_test(config.clone(), &mut state, TestDataAvailability::Read(options), false);

It's better to extract the endpoint launching outside the test, as we already do with valgrind and pyroscope. But we still use prometheus inside the tests.

let is_valgrind_running = valgrind::is_valgrind_running();
if !is_valgrind_running && self.cache_misses {
return valgrind::relaunch_in_valgrind_mode()
}
let agent_running = if self.profile {
let agent = PyroscopeAgent::builder(self.pyroscope_url.as_str(), "subsystem-bench")
.backend(pprof_backend(PprofConfig::new().sample_rate(self.pyroscope_sample_rate)))
.build()?;
Some(agent.start()?)
} else {
None
};

@AndreiEres AndreiEres added R0-silent Changes should not be mentioned in any release notes C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. T12-benchmarks This PR/Issue is related to benchmarking and weights. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. labels Mar 6, 2024
@gitofdeepanshu
Copy link
Contributor

Can I take this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. R0-silent Changes should not be mentioned in any release notes T12-benchmarks This PR/Issue is related to benchmarking and weights.
Projects
None yet
Development

No branches or pull requests

2 participants