Conversation
We were using shared_blks_hit instead of shared_blks_read to compute total_blks_read Now on some environments like mine where system cache hit is very small, there seems to be slight accounting discrepencies between pg_stat_statements and pg_stat_kcache (some counters must be slightly delayed). So sometimes we get a negative value for system cache hit. Add a greatest(counter,0) to hide this detail
|
ruff is always complaining about my PRs. But when I run a ruff format on my tree, it does nothing… any tips about what should be set up to make it work and avoid this back and forth about formatting ? |
as mentioned privately the CI is installing a fixed version of ruff, which is now quite outdated. not sure how much changes there would be if we upgraded the version. ideally almost none, otherwise it would be a sign that we should stop using ruff as it's not mature enough. |
I'm wondering if this is because pg_stat_kcache doesn't track the same blocks as pg_stat_statements. pgss only consider buffers, while pgsk will track any disk access. one classic example is looking at the available extensions and their versions. it's all done by looking at the extension directory on disk, and this will lead to more disk access than there should, and powa-web can easily trigger this if you visit the config pages. |
My only advice would be to make sure ruff actually uses the configuration file ( |
We were using shared_blks_hit instead of shared_blks_read to compute total_blks_read Now on some environments like mine where system cache hit is very small, there seems to be slight accounting discrepencies between pg_stat_statements and pg_stat_kcache (some counters must be slightly delayed). So sometimes we get a negative value for system cache hit. Add a greatest(counter,0) to hide this detail