def add_metric()

in src/cloudwatch/modules/flusher.py [0:0]


    def add_metric(self, value_list):
        """
        Translates Collectd metrics to CloudWatch format and stores them in flusher for further processing
        such as batching and aggregating.

        Keyword arguments:
        value_list -- The ValueList object passed by Collectd to the write callback
        """
        with self.lock:
            # The flush operation should take place before adding metric for a new minute.
            # Together with flush delta this ensures that old metrics are flushed before or at the start of a new minute.
            self._flush_if_need(time.time())
            for value in self._expand_value_list(value_list):
                if self.config.whitelist.is_whitelisted(self._get_metric_key(value)):
                        self._aggregate_metric(value)