Module: check_mk
Branch: master
Commit: 4cfa958b8350569216a75109d577bc2b37c899c6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4cfa958b835056…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Thu Jan 31 08:40:24 2019 +0100
Revert "7133 FIX mem.win: Change label from "Commit Charge" to "Page
file""
This reverts commit 8aadece285e705cab90fb78319d26d48f693b68a.
Change-Id: I288bab8319ba6bd20d32454425e5f4c7bbd23722
---
.werks/7133 | 12 ---------
checkman/mem.win | 29 +++++++++++++++++-----
checks/mem | 2 +-
.../generictests/datasets/mem_win_regression.py | 4 +--
4 files changed, 26 insertions(+), 21 deletions(-)
diff --git a/.werks/7133 b/.werks/7133
deleted file mode 100644
index 7497b8b..0000000
--- a/.werks/7133
+++ /dev/null
@@ -1,12 +0,0 @@
-Title: mem.win: Change label from "Commit Charge" to "Page file"
-Level: 1
-Component: checks
-Compatible: compat
-Edition: cre
-Version: 1.6.0i1
-Date: 1548670807
-Class: fix
-
-The agent actually reports total/available page file, so adjust the check output
-accordingly and replace the confusing "Commit Charge" label.
-This change only affects the displayed text.
diff --git a/checkman/mem.win b/checkman/mem.win
index ae5c0b2..79c86cf 100644
--- a/checkman/mem.win
+++ b/checkman/mem.win
@@ -5,13 +5,30 @@ license: GPL
distribution: check_mk
description:
This check measures the current usage of physical RAM and
- of the page file.
+ of the commit charge.
+ The "commit charge" was previously confusingly named "pagefile".
+ Please note that Microsoft themselves use this naming in
+ some applications.
+
+ Due to how Windows optimizes memory management, physical memory
+ is in practice almost always fully utilized. The Memory usage this
+ check displays says how much memory is actually required by processes,
+ in contrast to caches that could be freed if the need arises.
+
+ In the same vein Windows may hold data in RAM and pagefile at the same
+ time or it may hold data in the pagefile even when there is RAM available,
+ when it determines this may improve performance.
+ As a result, the real pagefile usage is not only hard to
+ determine, it's also utterly useless when we want to determine
+ resource usage on the system.
+
+ The commit charge instead tells us how much of the memory used in
+ total (RAM + swap) is really required, ignoring overlap and caches.
+ Commit Charge minus Memory Usage is approximately the amount
+ of the pagefile used for "relevant" data, but further optimizations
+ may lead to offsets (to the point where Commit Charge - Memory Usage
+ can be negative).
- The page file metric is determined using the fields 'ullTotalPageFile'
- (current committed memory limit for the system or the current
- process, whichever is smaller) and 'ullAvailPageFile' (maximum
- amount of memory the current process can commit) of the MEMORYSTATUSEX
- structure as returned by the windows API function 'GlobalMemoryStatusEx'.
item:
{None}
diff --git a/checks/mem b/checks/mem
index fad8250..62b9032 100644
--- a/checks/mem
+++ b/checks/mem
@@ -551,7 +551,7 @@ def check_mem_windows(_no_item, params, info):
return warn, crit
for title, prefix, paramname in [("Memory usage", "Mem",
"memory"),
- ("Page file", "Page",
"pagefile")]:
+ ("Commit Charge", "Page",
"pagefile")]:
total_kb = meminfo.get("%sTotal" % prefix)
free_kb = meminfo.get("%sFree" % prefix)
diff --git a/tests/unit/checks/generictests/datasets/mem_win_regression.py
b/tests/unit/checks/generictests/datasets/mem_win_regression.py
index dae0614..86d1460 100644
--- a/tests/unit/checks/generictests/datasets/mem_win_regression.py
+++ b/tests/unit/checks/generictests/datasets/mem_win_regression.py
@@ -25,7 +25,7 @@ checks = {
('memory', 16369.96875, 26213.990625, 29490.739453125, 0,
32767.48828125),
('mem_total', 32767.48828125, None, None, None, None),
]),
- (0, 'Page file: 20.1% (19.04 GB/94.50 GB)', [
+ (0, 'Commit Charge: 20.1% (19.04 GB/94.50 GB)', [
('pagefile', 19491.90625, 77413.990625, 87090.739453125, 0,
96767.48828125),
('pagefile_total', 96767.48828125, None, None, None, None),
]),
@@ -35,7 +35,7 @@ checks = {
('memory', 16369.96875, 26214.48828125, 29490.48828125, 0,
32767.48828125),
('mem_total', 32767.48828125, None, None, None, None),
]),
- (2, 'Page file: 20.1% (19.04 GB/94.50 GB)', [
+ (2, 'Commit Charge: 20.1% (19.04 GB/94.50 GB)', [
('pagefile', 19491.90625, 77275.48828125, 19353.48828125, 0,
96767.48828125),
('pagefile_total', 96767.48828125, None, None, None, None),
]),