eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject eagle git commit: [MINOR] Support source_host aside host in metric collector
Date Wed, 22 Feb 2017 14:10:42 GMT
Repository: eagle
Updated Branches:
  refs/heads/master 610b9f2ec -> 167ec0815


[MINOR] Support source_host aside host in metric collector

Support `source_host` aside `host` in metric collector configuration for case when requesting
host is not the actual host for reason like network settings.

Author: Hao Chen <haoch@users.noreply.github.com>

Closes #837 from haoch/patch-3.


Project: http://git-wip-us.apache.org/repos/asf/eagle/repo
Commit: http://git-wip-us.apache.org/repos/asf/eagle/commit/167ec081
Tree: http://git-wip-us.apache.org/repos/asf/eagle/tree/167ec081
Diff: http://git-wip-us.apache.org/repos/asf/eagle/diff/167ec081

Branch: refs/heads/master
Commit: 167ec0815db237b787cfeb7b3eea1c74ff5a39e3
Parents: 610b9f2
Author: Hao Chen <haoch@users.noreply.github.com>
Authored: Wed Feb 22 22:10:35 2017 +0800
Committer: Hao Chen <hao@apache.org>
Committed: Wed Feb 22 22:10:35 2017 +0800

----------------------------------------------------------------------
 eagle-external/hadoop_jmx_collector/metric_collector.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/eagle/blob/167ec081/eagle-external/hadoop_jmx_collector/metric_collector.py
----------------------------------------------------------------------
diff --git a/eagle-external/hadoop_jmx_collector/metric_collector.py b/eagle-external/hadoop_jmx_collector/metric_collector.py
index a472bbe..2176db2 100644
--- a/eagle-external/hadoop_jmx_collector/metric_collector.py
+++ b/eagle-external/hadoop_jmx_collector/metric_collector.py
@@ -433,6 +433,8 @@ class JmxMetricCollector(MetricCollector):
 
     def jmx_reader(self, source):
         host = source["host"]
+        if source.has_key("source_host"):
+            host=source["source_host"]    
         port=source["port"]
         https=source["https"]
         protocol = "https" if https else "http"
@@ -562,4 +564,4 @@ class MetricNameFilter(MetricFilter):
             for name_filter in self.metric_name_filter:
                 if fnmatch.fnmatch(metric["metric"], name_filter):
                     return True
-        return False
\ No newline at end of file
+        return False


Mime
View raw message