ts format
This commit is contained in:
parent
b82cd97b80
commit
7c83d190a4
|
@ -103,7 +103,7 @@ int taos_collector_registry_register_collector(taos_collector_registry_t *self,
|
|||
* @param self The target taos_collector_registry_t*
|
||||
* @return The string int he default metric exposition format.
|
||||
*/
|
||||
const char *taos_collector_registry_bridge(taos_collector_registry_t *self, int64_t ts);
|
||||
const char *taos_collector_registry_bridge(taos_collector_registry_t *self, char *ts);
|
||||
|
||||
int taos_collector_registry_clear_out(taos_collector_registry_t *self);
|
||||
|
||||
|
|
|
@ -552,8 +552,9 @@ void monSendReport() {
|
|||
}
|
||||
|
||||
void monSendPromReport() {
|
||||
char *pCont = (char *)taos_collector_registry_bridge(
|
||||
TAOS_COLLECTOR_REGISTRY_DEFAULT, taosGetTimestamp(TSDB_TIME_PRECISION_MILLI));
|
||||
char ts[50];
|
||||
sprintf(ts, "%" PRId64, taosGetTimestamp(TSDB_TIME_PRECISION_MILLI));
|
||||
char *pCont = (char *)taos_collector_registry_bridge(TAOS_COLLECTOR_REGISTRY_DEFAULT, ts);
|
||||
//uInfoL("report cont:\n%s\n", pCont);
|
||||
if (pCont != NULL) {
|
||||
EHttpCompFlag flag = tsMonitor.cfg.comp ? HTTP_GZIP : HTTP_FLAT;
|
||||
|
|
|
@ -57,17 +57,17 @@ int taos_metric_formatter_load_l_value(taos_metric_formatter_t *metric_formatter
|
|||
* @brief API PRIVATE Loads the formatter with a metric sample
|
||||
*/
|
||||
int taos_metric_formatter_load_sample(
|
||||
taos_metric_formatter_t *metric_formatter, taos_metric_sample_t *sample, int64_t ts);
|
||||
taos_metric_formatter_t *metric_formatter, taos_metric_sample_t *sample, char *ts);
|
||||
|
||||
/**
|
||||
* @brief API PRIVATE Loads a metric in the string exposition format
|
||||
*/
|
||||
int taos_metric_formatter_load_metric(taos_metric_formatter_t *self, taos_metric_t *metric, int64_t ts);
|
||||
int taos_metric_formatter_load_metric(taos_metric_formatter_t *self, taos_metric_t *metric, char *ts);
|
||||
|
||||
/**
|
||||
* @brief API PRIVATE Loads the given metrics
|
||||
*/
|
||||
int taos_metric_formatter_load_metrics(taos_metric_formatter_t *self, taos_map_t *collectors, int64_t ts);
|
||||
int taos_metric_formatter_load_metrics(taos_metric_formatter_t *self, taos_map_t *collectors, char *ts);
|
||||
|
||||
/**
|
||||
* @brief API PRIVATE Clear the underlying string_builder
|
||||
|
|
|
@ -186,7 +186,7 @@ int taos_collector_registry_validate_metric_name(taos_collector_registry_t *self
|
|||
return 0;
|
||||
}
|
||||
|
||||
const char *taos_collector_registry_bridge(taos_collector_registry_t *self, int64_t ts) {
|
||||
const char *taos_collector_registry_bridge(taos_collector_registry_t *self, char *ts) {
|
||||
taos_metric_formatter_clear(self->metric_formatter);
|
||||
taos_metric_formatter_load_metrics(self->metric_formatter, self->collectors, ts);
|
||||
char *out = taos_metric_formatter_dump(self->metric_formatter);
|
||||
|
|
|
@ -158,7 +158,7 @@ int taos_metric_formatter_load_l_value(taos_metric_formatter_t *self, const char
|
|||
return 0;
|
||||
}
|
||||
|
||||
int taos_metric_formatter_load_sample(taos_metric_formatter_t *self, taos_metric_sample_t *sample, int64_t ts) {
|
||||
int taos_metric_formatter_load_sample(taos_metric_formatter_t *self, taos_metric_sample_t *sample, char *ts) {
|
||||
TAOS_ASSERT(self != NULL);
|
||||
if (self == NULL) return 1;
|
||||
|
||||
|
@ -178,8 +178,7 @@ int taos_metric_formatter_load_sample(taos_metric_formatter_t *self, taos_metric
|
|||
r = taos_string_builder_add_char(self->string_builder, ' ');
|
||||
if (r) return r;
|
||||
|
||||
sprintf(buffer, "%ld", ts);
|
||||
r = taos_string_builder_add_str(self->string_builder, buffer);
|
||||
r = taos_string_builder_add_str(self->string_builder, ts);
|
||||
if (r) return r;
|
||||
|
||||
taos_metric_sample_set(sample, 0);
|
||||
|
@ -206,7 +205,7 @@ char *taos_metric_formatter_dump(taos_metric_formatter_t *self) {
|
|||
return data;
|
||||
}
|
||||
|
||||
int taos_metric_formatter_load_metric(taos_metric_formatter_t *self, taos_metric_t *metric, int64_t ts) {
|
||||
int taos_metric_formatter_load_metric(taos_metric_formatter_t *self, taos_metric_t *metric, char *ts) {
|
||||
TAOS_ASSERT(self != NULL);
|
||||
if (self == NULL) return 1;
|
||||
|
||||
|
@ -233,7 +232,7 @@ int taos_metric_formatter_load_metric(taos_metric_formatter_t *self, taos_metric
|
|||
return taos_string_builder_add_char(self->string_builder, '\n');
|
||||
}
|
||||
|
||||
int taos_metric_formatter_load_metrics(taos_metric_formatter_t *self, taos_map_t *collectors, int64_t ts) {
|
||||
int taos_metric_formatter_load_metrics(taos_metric_formatter_t *self, taos_map_t *collectors, char *ts) {
|
||||
TAOS_ASSERT(self != NULL);
|
||||
int r = 0;
|
||||
for (taos_linked_list_node_t *current_node = collectors->keys->head; current_node != NULL;
|
||||
|
|
Loading…
Reference in New Issue