summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0d10024)
raw | patch | inline | side by side (parent: 0d10024)
author | Florian Forster <octo@huhu.verplant.org> | |
Wed, 1 Jul 2009 14:56:33 +0000 (16:56 +0200) | ||
committer | Florian Forster <octo@noris.net> | |
Wed, 1 Jul 2009 14:56:33 +0000 (16:56 +0200) |
src/java.c | patch | blob | history |
diff --git a/src/java.c b/src/java.c
index 64e51d319a596a678e165724d638dff80595fd4f..80c17c3bf76cb2eb5ad83f175a6350bdc6f545c6 100644 (file)
--- a/src/java.c
+++ b/src/java.c
class_ptr = (*jvm_env)->GetObjectClass (jvm_env, object_ptr);
- if (ds_type == DS_TYPE_COUNTER)
+ if (ds_type == DS_TYPE_GAUGE)
{
- jlong tmp_long;
+ jdouble tmp_double;
- status = jtoc_long (jvm_env, &tmp_long,
- class_ptr, object_ptr, "longValue");
+ status = jtoc_double (jvm_env, &tmp_double,
+ class_ptr, object_ptr, "doubleValue");
if (status != 0)
{
ERROR ("java plugin: jtoc_value: "
- "jtoc_long failed.");
+ "jtoc_double failed.");
return (-1);
}
- (*ret_value).counter = (counter_t) tmp_long;
+ (*ret_value).gauge = (gauge_t) tmp_double;
}
else
{
- jdouble tmp_double;
+ jlong tmp_long;
- status = jtoc_double (jvm_env, &tmp_double,
- class_ptr, object_ptr, "doubleValue");
+ status = jtoc_long (jvm_env, &tmp_long,
+ class_ptr, object_ptr, "longValue");
if (status != 0)
{
ERROR ("java plugin: jtoc_value: "
- "jtoc_double failed.");
+ "jtoc_long failed.");
return (-1);
}
- (*ret_value).gauge = (gauge_t) tmp_double;
+
+ if (ds_type == DS_TYPE_DERIVE)
+ (*ret_value).derive = (derive_t) tmp_long;
+ else if (ds_type == DS_TYPE_ABSOLUTE)
+ (*ret_value).absolute = (absolute_t) tmp_long;
+ else
+ (*ret_value).counter = (counter_t) tmp_long;
}
return (0);