+static inline int format_dimension_collected_json_plaintext(BUFFER *b, const char *prefix, RRDHOST *host, const char *hostname, RRDSET *st, RRDDIM *rd, time_t after, time_t before, uint32_t options) {
+ (void)host;
+ (void)after;
+ (void)before;
+ (void)options;
+ buffer_sprintf(b, "{"
+ "\"prefix\":\"%s\","
+ "\"hostname\":\"%s\","
+ "\"id\":\"%s\","
+ "\"subid\":\"%s\","
+ "\"value\":" COLLECTED_NUMBER_FORMAT ","
+ "\"timestamp\": %u}\n", prefix, hostname, st->id, rd->id, rd->last_collected_value, (uint32_t)rd->last_collected_time.tv_sec);
+ return 1;
+}
+
+static inline int format_dimension_stored_json_plaintext(BUFFER *b, const char *prefix, RRDHOST *host, const char *hostname, RRDSET *st, RRDDIM *rd, time_t after, time_t before, uint32_t options) {
+ (void)host;
+ calculated_number value = backend_calculate_value_from_stored_data(st, rd, after, before, options);
+ if(!isnan(value)) {
+ buffer_sprintf(b, "{"
+ "\"prefix\":\"%s\","
+ "\"hostname\":\"%s\","
+ "\"id\":\"%s\","
+ "\"subid\":\"%s\","
+ "\"value\":" CALCULATED_NUMBER_FORMAT ","
+ "\"timestamp\": %u}\n", prefix, hostname, st->id, rd->id, value, (uint32_t) before);
+ return 1;
+ }
+ return 0;
+}
+