commit 12b7c7c1420837b1f1e18e21c588a41bd7bd24c6 Author: Damian Johnson atagar@torproject.org Date: Sat Jan 30 18:24:48 2016 -0800
Better deduplication for nyx debug messages
At the debug runlevel nyx mostly prints messages to indicate how long queries take. These are obviously dynamic. Rather than enumerating all log messages including a little hack to ignore that bit. --- nyx/config/dedup.cfg | 20 -------------------- nyx/util/log.py | 6 ++++++ 2 files changed, 6 insertions(+), 20 deletions(-)
diff --git a/nyx/config/dedup.cfg b/nyx/config/dedup.cfg index 954e588..42d8102 100644 --- a/nyx/config/dedup.cfg +++ b/nyx/config/dedup.cfg @@ -88,24 +88,4 @@ dedup.WARN I have no descriptor for the router named dedup.WARN Controller gave us config lines that didn't validate dedup.WARN Problem bootstrapping. Stuck at dedup.WARN *missing key, -dedup.NYX_DEBUG refresh rate: -dedup.NYX_DEBUG proc call (cwd): -dedup.NYX_DEBUG proc call (memory usage): -dedup.NYX_DEBUG proc call (process command -dedup.NYX_DEBUG proc call (process utime -dedup.NYX_DEBUG proc call (process stime -dedup.NYX_DEBUG proc call (process start time -dedup.NYX_DEBUG proc call (process connections): -dedup.NYX_DEBUG system call: ps -dedup.NYX_DEBUG system call: netstat -dedup.NYX_DEBUG recreating panel ' -dedup.NYX_DEBUG redrawing the log panel with the corrected content height ( -dedup.NYX_DEBUG GETINFO accounting/bytes -dedup.NYX_DEBUG GETINFO accounting/bytes-left -dedup.NYX_DEBUG GETINFO accounting/interval-end -dedup.NYX_DEBUG GETINFO accounting/hibernating -dedup.NYX_DEBUG GETINFO traffic/read -dedup.NYX_DEBUG GETINFO traffic/written -dedup.NYX_DEBUG GETCONF -dedup.NYX_DEBUG Unable to query process resource usage from ps
diff --git a/nyx/util/log.py b/nyx/util/log.py index 3bd0d40..f9c95cc 100644 --- a/nyx/util/log.py +++ b/nyx/util/log.py @@ -281,6 +281,12 @@ class LogEntry(object): elif self.message == entry.message: return True
+ if self.type == 'NYX_DEBUG' and 'runtime:' in self.message and 'runtime:' in entry.message: + # most nyx debug messages show runtimes so try matching without that + + if self.message[:self.message.find('runtime:')] == entry.message[:self.message.find('runtime:')]: + return True + for common_msg in _common_log_messages().get(self.type, []): # if it starts with an asterisk then check the whole message rather # than just the start