summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bc474f0)
raw | patch | inline | side by side (parent: bc474f0)
author | Florian Forster <octo@huhu.verplant.org> | |
Wed, 1 Jul 2009 12:54:55 +0000 (14:54 +0200) | ||
committer | Florian Forster <octo@noris.net> | |
Wed, 1 Jul 2009 13:42:25 +0000 (15:42 +0200) |
src/couchdb.c | patch | blob | history |
diff --git a/src/couchdb.c b/src/couchdb.c
index 361e9e93c1155700c14c003ba6423e9341fdbee0..30f56da7bee0e3bbd6a0a51c3c5778a2f49f121c 100644 (file)
--- a/src/couchdb.c
+++ b/src/couchdb.c
type = couchdb_get_type (key);
if (type == DS_TYPE_COUNTER)
- vt.counter = val;
+ vt.counter = (counter_t) val;
+ else if (type == DS_TYPE_GAUGE)
+ vt.gauge = (gauge_t) val;
+ else if (type == DS_TYPE_DERIVE)
+ vt.derive = (derive_t) val;
+ else if (type == DS_TYPE_ABSOLUTE)
+ vt.absolute = (absolute_t) val;
else
- vt.gauge = (double)val;
+ return 0;
couchdb_submit (db, key, &vt);
}
int type;
type = couchdb_get_type (key);
- if (type == DS_TYPE_GAUGE)
- vt.gauge = val;
+ if (type == DS_TYPE_COUNTER)
+ vt.counter = (counter_t) val;
+ else if (type == DS_TYPE_GAUGE)
+ vt.gauge = (gauge_t) val;
+ else if (type == DS_TYPE_DERIVE)
+ vt.derive = (derive_t) val;
+ else if (type == DS_TYPE_ABSOLUTE)
+ vt.absolute = (absolute_t) val;
else
- vt.counter = val;
+ return 0;
couchdb_submit (db, key, &vt);
}