waku-org / nwaku

Waku node and protocol.
Other
203 stars 54 forks source link

chore: extending store metrics #3042

Closed Ivansete-status closed 2 months ago

Ivansete-status commented 2 months ago

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

Issue

github-actions[bot] commented 2 months ago

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:3042

Built from 3c6346082d126e584493521a4931bedd9a75549c

Ivansete-status commented 2 months ago

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 commented 2 months ago

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