memory: rename commit_limit, drop free system PTEs, add standby cache lifetime (#2694)

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Claude <noreply@anthropic.com>
This commit is contained in:
Jan-Otto Kröpke
2026-10-11 23:03:30 +02:00
committed by GitHub
co-authored by Claude
parent cd7acb5618
commit 491bb0de73
17 changed files with 85 additions and 77 deletions
+16 -15
View File
@@ -57,7 +57,6 @@ type Collector struct {
committedBytes *prometheus.Desc
demandZeroFaultsTotal *prometheus.Desc
freeAndZeroPageListBytes *prometheus.Desc
freeSystemPageTableEntries *prometheus.Desc
modifiedPageListBytes *prometheus.Desc
pageFaultsTotal *prometheus.Desc
swapPageReadsTotal *prometheus.Desc
@@ -71,6 +70,7 @@ type Collector struct {
poolPagedBytes *prometheus.Desc
poolPagedResidentBytes *prometheus.Desc
standbyCacheCoreBytes *prometheus.Desc
standbyCacheLifetimeSeconds *prometheus.Desc
standbyCacheNormalPriorityBytes *prometheus.Desc
standbyCacheReserveBytes *prometheus.Desc
systemCacheResidentBytes *prometheus.Desc
@@ -142,8 +142,8 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error {
nil,
)
c.commitLimit = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "commit_limit"),
"(CommitLimit)",
prometheus.BuildFQName(types.Namespace, Name, "commit_limit_bytes"),
"Amount of virtual memory, in bytes, that can be committed without having to extend the paging file(s) (CommitLimit)",
nil,
nil,
)
@@ -167,12 +167,6 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error {
nil,
nil,
)
c.freeSystemPageTableEntries = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "free_system_page_table_entries"),
"(FreeSystemPageTableEntries)",
nil,
nil,
)
c.modifiedPageListBytes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "modified_page_list_bytes"),
"The amount of physical memory, in bytes, that is assigned to the modified page list. This memory contains cached data and code that is not actively in "+
@@ -256,6 +250,13 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error {
nil,
nil,
)
c.standbyCacheLifetimeSeconds = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "standby_cache_lifetime_seconds"),
"The long-term average time, in seconds, that a page stays on the standby cache page lists before it is repurposed. "+
"Low values indicate memory pressure (LongTermAverageStandbyCacheLifetime)",
nil,
nil,
)
c.standbyCacheNormalPriorityBytes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "standby_cache_normal_priority_bytes"),
"The amount of physical memory, in bytes, that is assigned to the normal priority standby cache page lists. This memory contains cached data and "+
@@ -447,12 +448,6 @@ func (c *Collector) collectPDH(ch chan<- prometheus.Metric) error {
c.perfDataObject[0].FreeAndZeroPageListBytes,
)
ch <- prometheus.MustNewConstMetric(
c.freeSystemPageTableEntries,
prometheus.GaugeValue,
c.perfDataObject[0].FreeSystemPageTableEntries,
)
ch <- prometheus.MustNewConstMetric(
c.modifiedPageListBytes,
prometheus.GaugeValue,
@@ -531,6 +526,12 @@ func (c *Collector) collectPDH(ch chan<- prometheus.Metric) error {
c.perfDataObject[0].StandbyCacheCoreBytes,
)
ch <- prometheus.MustNewConstMetric(
c.standbyCacheLifetimeSeconds,
prometheus.GaugeValue,
c.perfDataObject[0].LongTermAverageStandbyCacheLifetime,
)
ch <- prometheus.MustNewConstMetric(
c.standbyCacheNormalPriorityBytes,
prometheus.GaugeValue,