-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add prom bench, coroutinze prom #3018
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
base: master
Are you sure you want to change the base?
Add prom bench, coroutinze prom #3018
Conversation
af3732d
to
52f9abc
Compare
Introduce metrics_perf benchmark. This is a precursor to work in upcoming changes to: - Couroutinize metrics endpoint - Improve the perf of the prometheus endpoint It tests a few flavors of metrics configurations that stress different parts of the core metrics response loop.
There was no existing test coverage of the feature of adding a label to all series in the seastar-side prometheus config. Add such a test case to the prom http test.
Coroutinize and de-boilerplate up the prometheus metrics writing path. We do not couroutinze the innermost loop, as this is using ss::async and currently relies on that. This is a precursor to performance improvements on this path. This change is more or less performance neutral: there is a slight "fixed cost" win for the body writing, but this doesn't matter much in the larger context since the per-series overhead dominates and there is no change in that case (for this change).
52f9abc
to
eff3dc1
Compare
Please fix spelling, especially "prom", I'm allergic. |
#include <seastar/testing/perf_tests.hh> | ||
#include <seastar/util/tmp_file.hh> | ||
|
||
#include <boost/range/irange.hpp> |
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.
For new code, let's avoid boost::ranges, std::views::subrange is the replacement.
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.
Or maybe iota
using namespace seastar; | ||
using namespace seastar::metrics; | ||
|
||
remove_existing_metrics(); |
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.
Not an expert on fixtures, but wouldn't that poison global state? So if a later test dependent on standard metrics, it would fail.
Looks good. The results are normalized per-metric? |
Three primary changes related to prometheus endpoint:
These are precursors to a perf improvement I want to make.
Here is the benchmark output before/after the coroutine change:
before:
after
As expected the differences are ~nil, below the noise floor, as the coroutines are only introduced around a relatively long-running function.