write_redis: Increase parsability of multi-valued keys by insterting delimiting chara...
authorbrianpkelly (no email) <collectd@verplant.org>
Tue, 9 Jun 2015 18:52:54 +0000 (13:52 -0500)
committerFlorian Forster <octo@collectd.org>
Thu, 11 Jun 2015 15:41:01 +0000 (16:41 +0100)
src/write_redis.c

index f209016..61893ff 100644 (file)
@@ -87,6 +87,10 @@ static int wr_write (const data_set_t *ds, /* {{{ */
   APPEND ("%.3f:", CDTIME_T_TO_DOUBLE (vl->time));
   for (i = 0; i < ds->ds_num; i++)
   {
+    // Increase parsability by delimiting the individual values
+    if (ds->ds_num > 1 && i > 0)
+      APPEND ("%s", "|");
+
     if (ds->ds[i].type == DS_TYPE_COUNTER)
       APPEND ("%llu", vl->values[i].counter);
     else if (ds->ds[i].type == DS_TYPE_GAUGE)