feat: expose usage counters for prepared statements#1192
Conversation
Signed-off-by: Sverre Boschman <1142569+sboschman@users.noreply.github.com>
|
@JelteF hopefully you have time to take a look at this addition to the prepared statement implementation |
|
LGTM, but needs some manual testing on my or someone else's side. |
|
If you could add some tests for this that would be great btw. |
What kind of tests are you thinking about? The existing |
|
Basically a modification to Line 226 in 585a630 |
Signed-off-by: Sverre Boschman <1142569+sboschman@users.noreply.github.com>
|
A small test case has been added to the prepared statement test suite: test_prepared.py Anything else I can do to help out on this issue @JelteF ? |
With prepared statements tracking enabled in PgBouncer we internally track the following counters: - ps_client_parse_count - ps_server_parse_count - ps_bind_count But we only exposed them in log/systemd messages, but not in any `SHOW` command, which are used by external monitoring tools like pgbouncer_exporter. This starts exporting them in `SHOW` commands.
With prepared statements tracking enabled in PgBouncer we internally track the following counters:
But we only expose them in log/systemd messages, but not in any
SHOWcommand, which are used by external monitoring tools like pgbouncer_exporter. These counters are imo important to gain insight in how well 'prepared statement caching' in PgBouncer is working for your workload and your configuration. I think of them as a sort of 'cache hit ratio'.