

def add_datapoints(self, stats):
    'Add all of the data points for a node\n\n        :param str stats: The stub stats content\n\n        '
    if (not stats):
        return
    matches = PATTERN.match(stats)
    if matches:
        for key in self.KEYS.keys():
            try:
                value = int((matches.group(key) or 0))
            except (IndexError, ValueError):
                value = 0
            if (key in self.GAUGES):
                self.add_gauge_value(self.KEYS[key], self.TYPES[key], value)
            else:
                self.add_derive_value(self.KEYS[key], self.TYPES[key], value)
    else:
        LOGGER.debug('Stats output: %r', stats)

dataset/ETHPy150Open MeetMe/newrelic-plugin-agent/newrelic_plugin_agent/plugins/nginx.py Nginx.add_datapoints/original