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

Stream metrics #778

Merged
merged 1 commit into from Jun 26, 2022
Merged

Stream metrics #778

merged 1 commit into from Jun 26, 2022

Conversation

nappa85
Copy link
Contributor

@nappa85 nappa85 commented May 31, 2022

This PR improves metrics for streams.
Actual code meters only query execution in streams, not data transfer/encoding, therefore things seems to be really fast.
E.g.: the same query, using Selector::all() is metered at 0.005s, using Selector::stream() is metered at 0.000003s. Things are fast but not that fast.

My PR measures also every Stream::next() duration and sums all together to give a more realistic value, taking the metric on Stream drop.

To be honest, there is an async part of the stream that can't be measured, e.g. when Stream::next() is called and data is already ready, but that's one of the advantages of Streams.

More, this PR removes calls to SystemTime::now() when not needed, removing the overhead of a system call for who doesn't uses metrics.

Copy link
Member

@billy1624 billy1624 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome back @nappa85! Nice refactoring!

@billy1624 billy1624 requested a review from tyt2y3 June 1, 2022 10:01
@tyt2y3
Copy link
Member

tyt2y3 commented Jun 26, 2022

Interesting... so it's 5ms vs 3us? oh

@tyt2y3 tyt2y3 merged commit d074faf into SeaQL:master Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants