예제 #1
0
 def compute_value(self):
     value = self.aggregation_func(self.values)
     timestamp = time.time() - self.aggregation_frequency
     datapoint = (timestamp, value)
     self.values = []
     send_metric(self.metric_path, datapoint)
     increment('aggregateDatapointsSent')
예제 #2
0
파일: buffers.py 프로젝트: katzj/graphite
 def compute_value(self):
   value = self.aggregation_func(self.values)
   timestamp = time.time() - self.aggregation_frequency
   datapoint = (timestamp, value)
   self.values = []
   send_metric(self.metric_path, datapoint)
   increment('aggregateDatapointsSent')
예제 #3
0
파일: buffers.py 프로젝트: mtodd/graphite
    def compute_value(self):
        now = int(time.time())
        current_interval = now - (now % self.aggregation_frequency)
        age_threshold = current_interval - (settings["MAX_AGGREGATION_INTERVALS"] * self.aggregation_frequency)

        for buffer in self.interval_buffers.values():
            if buffer.active:
                value = self.aggregation_func(buffer.values)
                datapoint = (buffer.interval, value)
                send_metric(self.metric_path, datapoint)
                increment("aggregateDatapointsSent")
                buffer.mark_inactive()

            if buffer.interval < age_threshold:
                del self.interval_buffers[buffer.interval]
예제 #4
0
파일: receiver.py 프로젝트: mtodd/graphite
def process(metric, datapoint):
  increment('datapointsReceived')

  for rule in RewriteRuleManager.preRules:
    metric = rule.apply(metric)

  for rule in RuleManager.rules:
    aggregate_metric = rule.get_aggregate_metric(metric)

    if aggregate_metric is None:
      continue

    buffer = BufferManager.get_buffer(aggregate_metric)

    if not buffer.configured:
      buffer.configure_aggregation(rule.frequency, rule.aggregation_func)

    buffer.input(datapoint)

  for rule in RewriteRuleManager.postRules:
    metric = rule.apply(metric)

  send_metric(metric, datapoint)
예제 #5
0
def process(metric, datapoint):
    increment('datapointsReceived')

    for rule in RewriteRuleManager.preRules:
        metric = rule.apply(metric)

    for rule in RuleManager.rules:
        aggregate_metric = rule.get_aggregate_metric(metric)

        if aggregate_metric is None:
            continue

        buffer = BufferManager.get_buffer(aggregate_metric)

        if not buffer.configured:
            buffer.configure_aggregation(rule.frequency, rule.aggregation_func)

        buffer.input(datapoint)

    for rule in RewriteRuleManager.postRules:
        metric = rule.apply(metric)

    send_metric(metric, datapoint)
예제 #6
0
def aggregator_record(metric, value):
    fullMetric = 'carbon.aggregator.%s.%s' % (HOSTNAME, metric)
    datapoint = (time.time(), value)
    send_metric(fullMetric, datapoint)
예제 #7
0
def aggregator_record(metric, value):
  fullMetric = 'carbon.aggregator.%s.%s' % (HOSTNAME, metric)
  datapoint = (time.time(), value)
  send_metric(fullMetric, datapoint)