# Path: collectors/lib/utils.py
# def is_numeric(value):
#     return isinstance(value, (int, float))


import sys
    import json
    from collections import OrderedDict  # New in Python 2.7
    from ordereddict import OrderedDict  # Can be easy_install'ed for <= 2.6
from collectors.lib.utils import is_numeric
    from http.client import HTTPConnection
    from httplib import HTTPConnection
        except:
            resp = '{}'
        finally:
            self.server.close()
        return json.loads(resp)

    def poll(self):
        """
        Get metrics from the http server's /jmx page, and transform them into normalized tupes

        @return: array of tuples ([u'Context', u'Array'], u'metricName', value)
        """
        json_arr = self.request().get('beans', [])
        kept = []
        for bean in json_arr:
            if (not bean['name']) or (not "name=" in bean['name']):
                continue
            #split the name string
            context = bean['name'].split("name=")[1].split(",sub=")
            # Create a set that keeps the first occurrence
            context = list(OrderedDict.fromkeys(context).keys())
            # lower case and replace spaces.
            context = [c.lower().replace(" ", "_") for c in context]
            # don't want to include the service or daemon twice
            context = [c for c in context if c != self.service and c != self.daemon]

            for key, value in bean.items():
               for m, n in recurse(key, value):
                    if m in EXCLUDED_KEYS:
                        continue

# Path: collectors/lib/utils.py
# def is_numeric(value):
#     return isinstance(value, (int, float))


# Path: collectors/lib/hadoop_http.py
import sys
    import json
    from collections import OrderedDict  # New in Python 2.7
    from ordereddict import OrderedDict  # Can be easy_install'ed for <= 2.6
from collectors.lib.utils import is_numeric
    from http.client import HTTPConnection
    from httplib import HTTPConnection

        except:
            resp = '{}'
        finally:
            self.server.close()
        return json.loads(resp)

    def poll(self):
        """
        Get metrics from the http server's /jmx page, and transform them into normalized tupes

        @return: array of tuples ([u'Context', u'Array'], u'metricName', value)
        """
        json_arr = self.request().get('beans', [])
        kept = []
        for bean in json_arr:
            if (not bean['name']) or (not "name=" in bean['name']):
                continue
            #split the name string
            context = bean['name'].split("name=")[1].split(",sub=")
            # Create a set that keeps the first occurrence
            context = list(OrderedDict.fromkeys(context).keys())
            # lower case and replace spaces.
            context = [c.lower().replace(" ", "_") for c in context]
            # don't want to include the service or daemon twice
            context = [c for c in context if c != self.service and c != self.daemon]

            for key, value in bean.items():
               for m, n in recurse(key, value):
                    if m in EXCLUDED_KEYS:
                        continue

                    if not is_numeric(n):