From: Chris Lundquist Date: Fri, 20 Jan 2012 22:29:31 +0000 (-0800) Subject: We have to convert CDTime to seconds since epoch X-Git-Tag: collectd-5.1.0~40^2~5 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b9cd6ea32dd72d250727db1b76e4bc978d005574;p=collectd.git We have to convert CDTime to seconds since epoch --- diff --git a/src/write_mongodb.c b/src/write_mongodb.c index cb4161c8..f13cdc33 100644 --- a/src/write_mongodb.c +++ b/src/write_mongodb.c @@ -39,16 +39,6 @@ #endif #include -/* -struct mongo_options -{ - char *host; - int port; - int timeout; -}; -typedef struct mongo_options mongo_options; -*/ - struct wm_node_s { char name[DATA_MAX_NAME_LEN]; @@ -60,7 +50,6 @@ struct wm_node_s int connected; mongo conn[1]; -/* mongo_options opts[1]; */ pthread_mutex_t lock; }; typedef struct wm_node_s wm_node_t; @@ -81,7 +70,7 @@ static int wm_write (const data_set_t *ds, /* {{{ */ ssnprintf(collection_name, sizeof (collection_name), "collectd.%s", vl->plugin); bson_init(&record); - bson_append_time_t(&record,"ts",vl->time); + bson_append_time_t(&record,"ts",CDTIME_T_TO_TIME_T(vl->time)); bson_append_string(&record,"h",vl->host); bson_append_string(&record,"i",vl->plugin_instance); bson_append_string(&record,"t",vl->type);