diff --git a/src/elasticsearch.c b/src/elasticsearch.c index b0e32e7..2c846a6 100644 --- a/src/elasticsearch.c +++ b/src/elasticsearch.c @@ -205,10 +205,9 @@ static void format_influx(char *linep, int lastCounter) { for (int a=0; a < CLASSIFICATION_LAST; ++a) { char *out; - if (!classification_type_to_str(a, out)) continue; + if (!classification_type_to_str(a, &out)) continue; ptr += sprintf(ptr, "%s,%s", m_classifications, options.in_tags); - // TODO FIX ME IMPORTANTLY AS SOON AS IT WORKS - ptr += sprintf(ptr, ",type=%d ", out); + ptr += sprintf(ptr, ",type=%s ", out); ptr += sprintf(ptr, "read=%d,write=%d", monitor.classifications[monitor.timestep][a].classifications[1].count, monitor.classifications[monitor.timestep][a].classifications[0].count diff --git a/src/iofs-monitor.h b/src/iofs-monitor.h index 7cfff67..529c6c6 100644 --- a/src/iofs-monitor.h +++ b/src/iofs-monitor.h @@ -47,11 +47,11 @@ static int str_to_classification_type(const char *s, classification_type_t *out) // unparsable... return 0; } -static int classification_type_to_str(const classification_type_t c, char *out) { +static int classification_type_to_str(const classification_type_t c, char **out) { for (int i=0; i < sizeof(classification_lookup) / sizeof(classification_lookup[0]); ++i) { if (c == classification_lookup[i].key) { // Found it! - out = classification_lookup[i].val; + *out = classification_lookup[i].val; return 1; } }