Created
June 18, 2012 16:06
-
-
Save alq666/2949133 to your computer and use it in GitHub Desktop.
warmsys patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Changes in HEAD | |
Modified checks/system.py | |
diff --git a/checks/system.py b/checks/system.py | |
index ba1828f..535aa13 100644 | |
--- a/checks/system.py | |
+++ b/checks/system.py | |
@@ -574,6 +574,7 @@ class Cpu(object): | |
if sys.platform == 'linux2': | |
mpstat = subprocess.Popen(['mpstat', '1', '3'], stdout=subprocess.PIPE, close_fds=True).communicate()[0] | |
+ logger.debug('getCPUStats: mpstat ran => %s' % mpstat) | |
# topdog@ip:~$ mpstat 1 3 | |
# Linux 2.6.32-341-ec2 (ip) 01/19/2012 _x86_64_ (2 CPU) | |
# | |
Modified tests/test_system.py |
You should see something like this in /tmp/dd-agent.log
2012-06-18 16:20:17,185 - checks - DEBUG - getCPUStats: mpstat ran => Linux 2.6.32-41-server (dogdev0) 06/18/2012 _x86_64_ (4 CPU)
04:20:14 PM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle
04:20:15 PM all 4.79 9.32 0.50 0.00 0.00 0.25 0.00 0.00 85.14
04:20:16 PM all 0.50 0.00 0.00 0.00 0.00 0.00 0.00 0.00 99.50
04:20:17 PM all 0.75 0.00 0.00 0.00 0.00 0.25 0.00 0.00 98.99
Average: all 2.01 3.10 0.17 0.00 0.00 0.17 0.00 0.00 94.56
2012-06-18 16:20:17,185 - checks - DEBUG - Cannot extract cpu value %user from ['Average:', 'all', '2.01', '3.10', '0.17', '0.00', '0.00', '0.17', '0.00', '0.00', '94.56'] (['04:20:14', 'CPU', '%usr', '%nice', '%sys', '%iowait', '%irq', '%soft', '%steal', '%guest', '%idle'])
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run this to increase logging when gather CPU stats