+ bson_append_finish_array (ret); /* }}} values */
+
+ bson_append_start_array (ret, "dstypes"); /* {{{ */
+ for (i = 0; i < ds->ds_num; i++)
+ {
+ char key[16];
+
+ ssnprintf (key, sizeof (key), "%i", i);
+
+ if (store_rates)
+ bson_append_string (ret, key, "gauge");
+ else
+ bson_append_string (ret, key, DS_TYPE_TO_STRING (ds->ds[i].type));
+ }
+ bson_append_finish_array (ret); /* }}} dstypes */
+
+ bson_append_start_array (ret, "dsnames"); /* {{{ */
+ for (i = 0; i < ds->ds_num; i++)
+ {
+ char key[16];
+
+ ssnprintf (key, sizeof (key), "%i", i);
+ bson_append_string (ret, key, ds->ds[i].name);
+ }
+ bson_append_finish_array (ret); /* }}} dsnames */
+
+ bson_finish (ret);