Merge pull request #774 from trenkel/master
[collectd.git] / src / write_tsdb.c
index 9dff290..aeed635 100644 (file)
@@ -47,7 +47,6 @@
 #include "configfile.h"
 
 #include "utils_cache.h"
-#include "utils_parse_option.h"
 
 #include <pthread.h>
 #include <sys/socket.h>
@@ -406,7 +405,6 @@ static int wt_send_message (const char* key, const char* value,
     char *tags = "";
     char message[1024];
     char *host_tags = cb->host_tags ? cb->host_tags : "";
-    const char *message_fmt;
     const char *meta_tsdb = "tsdb_tags";
 
     /* skip if value is NaN */
@@ -427,16 +425,15 @@ static int wt_send_message (const char* key, const char* value,
         }
     }
 
-    message_fmt = "put %s %u %s fqdn=%s %s %s\r\n";
-    message_len = ssnprintf (message, sizeof(message),
-                                      message_fmt,
-                                      key,
-                                      (unsigned int)CDTIME_T_TO_TIME_T(
-                                          time),
-                                      value,
-                                      host,
-                                      tags,
-                                      host_tags);
+    message_len = ssnprintf (message,
+                             sizeof(message),
+                             "put %s %.0f %s fqdn=%s %s %s\r\n",
+                             key,
+                             CDTIME_T_TO_DOUBLE(time),
+                             value,
+                             host,
+                             tags,
+                             host_tags);
 
     sfree(temp);