Module: check_mk
Branch: master
Commit: aba4f336b737402a986d10d8ce280bc3c703238e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=aba4f336b73740…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jul 27 12:08:34 2018 +0200
Add some verbose diagnose output
Change-Id: I6ef902ff2074205cf2354355475c536f4c1ec700
---
cmk/cpu_tracking.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/cmk/cpu_tracking.py b/cmk/cpu_tracking.py
index a839d42..d1768ea 100644
--- a/cmk/cpu_tracking.py
+++ b/cmk/cpu_tracking.py
@@ -27,6 +27,8 @@
import os
import time
+import cmk_base.console as console
+
try:
_
except NameError:
@@ -37,6 +39,7 @@ current_phase = None
def start(initial_phase):
global times, last_time_snapshot, current_phase, phase_stack
times = {}
+ console.vverbose("[cpu_tracking] Start with phase '%s'\n" %
initial_phase)
last_time_snapshot = _time_snapshot()
current_phase = initial_phase
phase_stack = []
@@ -44,24 +47,28 @@ def start(initial_phase):
def end():
+ console.vverbose("[cpu_tracking] End\n")
set_phase(None)
def set_phase(phase):
global current_phase
if current_phase != None:
+ console.vverbose("[cpu_tracking] Set phase: %s (previous %s)\n" %
(phase, current_phase))
_add_times_to_phase()
current_phase = phase
def push_phase(phase):
if current_phase != None:
+ console.vverbose("[cpu_tracking] Push phase (Stack: %r)\n" %
phase_stack)
phase_stack.append(current_phase)
set_phase(phase)
def pop_phase():
if current_phase != None:
+ console.vverbose("[cpu_tracking] Pop current phase (Stack: %r)\n" %
phase_stack)
if len(phase_stack) == 1:
set_phase(None)
else: