Skip to content

Commit d02aed1

Browse files
committed
addresses reviews
1 parent 23b1bd2 commit d02aed1

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

nodescraper/plugins/inband/memory/memory_analyzer.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,14 @@ class MemoryAnalyzer(DataAnalyzer[MemoryDataModel, MemoryAnalyzerArgs]):
4242
def analyze_data(
4343
self, data: MemoryDataModel, args: Optional[MemoryAnalyzerArgs] = None
4444
) -> TaskResult:
45-
"""Analyze the memory data to check if the memory usage is within the maximum allowed used memory."""
45+
"""Analyze the memory data to check if the memory usage is within the maximum allowed used memory.
46+
47+
Args:
48+
data (MemoryDataModel): memory data to analyze.
49+
args (Optional[MemoryAnalyzerArgs], optional): memory analysis arguments. Defaults to None.
50+
Returns:
51+
TaskResult: Result of the memory analysis containing the status and message.
52+
"""
4653

4754
if not args:
4855
args = MemoryAnalyzerArgs()
@@ -84,10 +91,7 @@ def _bytes_to_gb(n: float) -> float:
8491
self.result.status = ExecutionStatus.ERROR
8592
self._log_event(
8693
category=EventCategory.OS,
87-
description=(
88-
f"{self.result.message}, Actual: {used_gb:.2f} GB "
89-
f"[computed from {base_source} {base_gb:.2f} GB × ratio={args.ratio:.2f}]"
90-
),
94+
description=(f"{self.result.message}"),
9195
priority=EventPriority.CRITICAL,
9296
)
9397

0 commit comments

Comments
 (0)