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

chore: extending store metrics #3042

Merged
merged 9 commits into from
Sep 20, 2024
Merged

Conversation

Ivansete-status
Copy link
Collaborator

@Ivansete-status Ivansete-status commented Sep 18, 2024

Description

Brings new metrics to analyse the time spent by store.
In a store request, we have these time components:

  1. database-time: time spent by the query itself within the database.
  2. communication-with-database: time spent by libpq while waiting for response.
  3. store-lpstream-resp-time: time spent while returning the response to the store-client.

We will have stats for (1 + 2) and (3)

From nwaku we don't have means to measure the database time, which should be manually measured by analysing pg_stat_statemets table with queries like SELECT calls, total_exec_time, mean_exec_time, max_exec_time, left(query, 80) rows FROM pg_stat_statements ORDER BY total_exec_time DESC LIMIT 100;.

Changes

  • New store and database metrics are added
  • New grafana panels aiming to better describe query time consumption
    image

Issue

Copy link

github-actions bot commented Sep 18, 2024

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:3042

Built from 3c63460

@Ivansete-status Ivansete-status changed the title chore: WIP extending store metrics chore: extending store metrics Sep 18, 2024
Copy link
Contributor

@gabrielmer gabrielmer left a comment

Choose a reason for hiding this comment

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

Looks amazing! 🔥 thanks so much!

I think there's a couple linting changes in libwaku. Not sure if they're intentional or not as they seem to be unrelated to this

Copy link
Contributor

@NagyZoltanPeter NagyZoltanPeter left a comment

Choose a reason for hiding this comment

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

Very insightful!
But what is different between the two "Waku Store Time (sec)" panels?
It is not obvious from the picture.
Also maybe the panels can get more height for better legend readability.

@Ivansete-status
Copy link
Collaborator Author

I think there's a couple linting changes in libwaku. Not sure if they're intentional or not as they seem to be unrelated to this

Thanks for the comment! ah yes, the thing is that I wasn't properly using the nph-0.6.0. They are intentional but aside from this PR ;P

@Ivansete-status
Copy link
Collaborator Author

Very insightful! But what is different between the two "Waku Store Time (sec)" panels? It is not obvious from the picture. Also maybe the panels can get more height for better legend readability.

Thanks! I've extended the panels a little so that we can see better the queries and also made it clearer the "Store Times" panels, which will show legacy and new store times distribution, for example, we have this now:
image

Copy link
Contributor

@NagyZoltanPeter NagyZoltanPeter left a comment

Choose a reason for hiding this comment

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

Yess.
Thank you It looks just fine now!

@Ivansete-status Ivansete-status merged commit fd83b42 into master Sep 20, 2024
2 checks passed
@Ivansete-status Ivansete-status deleted the better-query-timing-insight branch September 20, 2024 11:23
gabrielmer pushed a commit that referenced this pull request Sep 20, 2024
* adding query_metrics module
* update fleet-dashboard with new store panels for better timing insight
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chore: create grafana panel to show max, min, mean, median stats of query times
3 participants