From: Florian Forster Date: Wed, 18 Feb 2009 22:39:57 +0000 (+0100) Subject: java plugin: Divide times received from Java by 1000. X-Git-Tag: collectd-4.7.0~127^2~44 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=fe7552a4e73e55655d44903ea7f9fd053029e2f9;p=collectd.git java plugin: Divide times received from Java by 1000. 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. --- diff --git a/src/java.c b/src/java.c index 2d4974f2..488e18bd 100644 --- 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");