projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
30c2d66
)
java plugin: Divide times received from Java by 1000.
author
Florian Forster
<octo@leeloo.lan.home.verplant.org>
Wed, 18 Feb 2009 22:39:57 +0000
(23:39 +0100)
committer
Florian Forster
<octo@leeloo.lan.home.verplant.org>
Wed, 18 Feb 2009 22:39:57 +0000
(23:39 +0100)
Java keeps time as milliseconds in 64bit integers. Let's keep it that
way and translate to epoch transparently.
The other way around, from C to Java, already multiplies by 1000.
src/java.c
patch
|
blob
|
history
diff --git
a/src/java.c
b/src/java.c
index
2d4974f
..
488e18b
100644
(file)
--- a/
src/java.c
+++ b/
src/java.c
@@
-1078,7
+1078,8
@@
static int jtoc_value_list (JNIEnv *jvm_env, value_list_t *vl, /* {{{ */
ERROR ("java plugin: jtoc_value_list: jtoc_long (getTime) failed.");
return (-1);
}
- vl->time = (time_t) tmp_long;
+ /* Java measures time in milliseconds. */
+ vl->time = (time_t) (tmp_long / ((jlong) 1000));
status = jtoc_long (jvm_env, &tmp_long,
class_ptr, object_ptr, "getInterval");