This rounds to .001, otherwise cache hit axis was showing multiple points with 100% since
values were rounded at axis, but not raw values, which changes from 0.9900001 were shown 0.9900002 on graphs, causing visual noise)
Signed-off-by: Vitaly Zhuravlev <zhuravlev.vitaly@gmail.com>
This moves the metrics that are queried from pg_stat_bgwriter into a dedicated collector instead of dynamically generating queries and metrics from a map. It renames some metrics including adding the `_total` suffix on all of the counters to match prometheus standards. This implementation uses QueryRowContext to allow for later addition of context for cancellation. From the Postgres documentation, it states that there is one line per WAL sender process, but it is unclear how to differentiate between them in any meaningful way. When querying the table, there is no column to identify the row, only metrics about bgwriter.
Signed-off-by: Joe Adams <github@joeadams.io>