import diamond.collector

import urllib2


class AuroraCollector(diamond.collector.Collector):

    def get_default_config_help(self):
        config_help = super(AuroraCollector,
                            self).get_default_config_help()

        config_help.update({
            'host': 'Scheduler Hostname',
            'port': 'Scheduler HTTP Metrics Port',
            'path': 'Collector path. Defaults to "aurora"',
            'scheme': 'http'
        })
        return config_help

    def get_default_config(self):
        config = super(AuroraCollector, self).get_default_config()
        config.update({
            'path': 'aurora',
            'host': 'localhost',
            'port': 8081,
            'scheme': 'http'
        })
        return config

    def collect(self):
        url = '%s://%s:%s/vars' % (self.config['scheme'],
                                   self.config['host'],
                                   self.config['port'])

        response = urllib2.urlopen(url)

        for line in response.readlines():
            properties = line.split()

            # Not all lines returned will have a numeric metric.
            # To account for this, we attempt to cast the 'value'
            # portion as a float. If that's not possible, NBD, we
            # just move on.
            try:
                if len(properties) > 1:
                    self.publish(properties[0], float(properties[1]))
            except ValueError:
                continue

@@ -798,17 +798,17 @@
   url = 
-'
+%22
 %25s://%25s:
@@ -814,17 +814,17 @@
 :%25s/vars
-'
+%22
  %25 (self
@@ -1384,20 +1384,17 @@
    s
-elf.publish(
+ubpath = 
 prop
@@ -1406,30 +1406,142 @@
 s%5B0%5D
-, float(properties%5B1%5D)
+.replace('/', '.').replace('_', '.')%0A                    value = float(properties%5B1%5D)%0A%0A                    self.publish(subpath, value
 )%0A  

Improve path cleanup