Merge remote-tracking branch 'github-octo/pyr/riemann' into pyr/riemann
authorFlorian Forster <octo@collectd.org>
Mon, 14 Jan 2013 08:49:17 +0000 (09:49 +0100)
committerFlorian Forster <octo@collectd.org>
Mon, 14 Jan 2013 08:49:17 +0000 (09:49 +0100)
1  2 
src/riemann.c

diff --cc src/riemann.c
@@@ -293,18 -316,18 +303,18 @@@ static Event *riemann_value_to_protobu
        riemann_event_add_tag (event, "ds_name:%s", ds->ds[index].name);
        riemann_event_add_tag (event, "ds_index:%zu", index);
  
 -      for (i = 0; i < riemann_tagcount; i++)
 +      for (i = 0; i < riemann_tags_num; i++)
                riemann_event_add_tag (event, "%s", riemann_tags[i]);
  
-       if (rates != NULL)
+       if (ds->ds[index].type == DS_TYPE_GAUGE)
        {
                event->has_metric_d = 1;
-               event->metric_d = (double) rates[index];
+               event->metric_d = (double) vl->values[index].gauge;
        }
-       else if (ds->ds[index].type == DS_TYPE_GAUGE)
+       else if (rates != NULL)
        {
                event->has_metric_d = 1;
-               event->metric_d = (double) vl->values[index].gauge;
+               event->metric_d = (double) rates[index];
        }
        else
        {