Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vm-image: Expose new LFC working set size metrics #8298

Merged
merged 8 commits into from
Jul 22, 2024
29 changes: 25 additions & 4 deletions vm-image-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ files:
query: |
select sum(pg_database_size(datname)) as total from pg_database;

# DEPRECATED
- metric_name: lfc_approximate_working_set_size
type: gauge
help: 'Approximate working set size in pages of 8192 bytes'
Expand All @@ -244,6 +245,20 @@ files:
query: |
select neon.approximate_working_set_size(false) as approximate_working_set_size;

- metric_name: lfc_approximate_working_set_size_windows
type: gauge
help: 'Approximate working set size in pages of 8192 bytes'
key_labels: [duration]
values: [size]
# NOTE: This is the "public" / "human-readable" version. Here, we supply a small selection
# of durations in a pretty-printed form.
query: |
select
x as duration,
neon.approximate_working_set_size_seconds(extract('epoch' from x::interval)::int) as size
from
(values ('5m'),('15m'),('1h')) as t (x);

- metric_name: current_lsn
type: gauge
help: 'Current LSN of the database'
Expand Down Expand Up @@ -377,13 +392,19 @@ files:
query: |
select pg_size_bytes(current_setting('neon.file_cache_size_limit')) as lfc_cache_size_limit;

- metric_name: lfc_approximate_working_set_size
- metric_name: lfc_approximate_working_set_size_windows
type: gauge
help: 'Approximate working set size in pages of 8192 bytes'
key_labels:
values: [approximate_working_set_size]
key_labels: [duration_seconds]
values: [size]
# NOTE: This is the "internal" / "machine-readable" version. This outputs the working set
# size looking back 1..60 minutes, labeled with the number of minutes.
query: |
select neon.approximate_working_set_size(false) as approximate_working_set_size;
select
x::text as duration_seconds,
neon.approximate_working_set_size_seconds(x) as size
from
(select generate_series * 60 as x from generate_series(1, 60));
build: |
# Build cgroup-tools
#
Expand Down
Loading