You are looking for a better monitoring of Shared Buffer Usage and/or Shared Buffer Cache.
Currently there are two metrics related to Shared Buffer Usage monitoring.
Shared Buffer Usage:Disk Blocks Read
Shared Buffer Usage:Shared Buffer Cache
Full matric path is:
SuperDomain|<hostname>|Infrastructure|Agent|Postgres Databases|<database server IP/hostname>>|postgres|Databases|<database-name>|....
Your requirement is to have some type of value where they can set a threshold and get an alert if there is an issue with Shared Buffer Usage during certain time window.
Neither of the above metric can be used for this purpose as it looks like those are reporting cumulative values.
The APMIA Infrastructure Agent Engineering/DEV team has reviewed this Enhancement Request.
The are suggesting to have following funcationality added to the APMIA Infrastructure Agent PostgreSQL Extension.
Once Enhancement Request is complete, this funcationality will be available with out of the box agent Extension.
Implementing the following:
SELECT
ROUND(
100.0 * blks_hit / (blks_hit + blks_read), 2 -- Cache hit ratio calculation
) as cache_hit_ratio
FROM pg_stat_database
blks_hit: Number of times disk blocks were found in the buffer cache (cache hits)
blks_read: Number of times disk blocks had to be read from disk (cache misses)
Threshold:
>99%: Excellent (mostly read-heavy workloads)
95-99%: Good (typical OLTP applications)
90-95%: Acceptable (write-heavy or analytical workloads)
<90%: Poor (investigate buffer sizing or query patterns)
This Enhancement Request will be available in DX O2 SAAS release 25.11.