Skip to content

Commit f7a15eb

Browse files
committed
Cleanup
1 parent f891544 commit f7a15eb

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

features/environment.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,9 @@ def set_logger(context):
5353
return logger
5454

5555

56-
# --- B1: per-feature peak-memory measurement (see SKETCH-per-rule-memory.md) ---
5756

5857
def _read_proc_kb(field, path='/proc/self/status'):
59-
"""Lees een '<field>: <n> kB'-regel uit /proc. None als het niet lukt."""
58+
"""Read a '<field>: <n> kB' line from /proc. Returns None when unavailable."""
6059
try:
6160
with open(path) as f:
6261
for line in f:
@@ -68,7 +67,7 @@ def _read_proc_kb(field, path='/proc/self/status'):
6867

6968

7069
def _reset_peak_rss():
71-
"""Zet de VmHWM-piekteller terug naar de huidige RSS (Linux-only)."""
70+
"""Reset the kernel peak-memory counter (VmHWM) to the current RSS. Linux-only."""
7271
try:
7372
with open('/proc/self/clear_refs', 'w') as f:
7473
f.write('5')
@@ -78,8 +77,8 @@ def _reset_peak_rss():
7877

7978

8079
def _feature_mem_txt(context):
81-
"""Peak RSS since the clear_refs reset in before_feature, plus the delta
82-
on top of the RSS at feature start. Empty string when /proc is unusable."""
80+
"""Peak memory for this feature: the high-water mark since before_feature,
81+
and how much that is above the memory at feature start. Empty if /proc is unusable."""
8382
peak_kb = _read_proc_kb('VmHWM')
8483
start_kb = getattr(context, 'feature_rss_start_kb', None)
8584
if peak_kb and start_kb and getattr(context, 'feature_peak_reset', False):
@@ -98,7 +97,7 @@ def before_feature(context, feature):
9897
context.validation_task_id = None
9998
Scenario.continue_after_failed_step = False
10099

101-
# B1: note current RSS and reset the kernel peak counter so that VmHWM in
100+
# note current RSS and reset the kernel peak counter so that VmHWM in
102101
# after_feature reflects the peak of *this* feature only.
103102
context.feature_rss_start_kb = _read_proc_kb('VmRSS')
104103
context.feature_peak_reset = _reset_peak_rss()

0 commit comments

Comments
 (0)