projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
perl plugin: Improve handling of DERIVE and ABSOLUTE data source types.
[collectd.git]
/
src
/
perl.c
diff --git
a/src/perl.c
b/src/perl.c
index
dd82ed9
..
50def1f
100644
(file)
--- a/
src/perl.c
+++ b/
src/perl.c
@@
-269,7
+269,10
@@
static int hv2data_source (pTHX_ HV *hash, data_source_t *ds)
if (NULL != (tmp = hv_fetch (hash, "type", 4, 0))) {
ds->type = SvIV (*tmp);
if (NULL != (tmp = hv_fetch (hash, "type", 4, 0))) {
ds->type = SvIV (*tmp);
- if ((DS_TYPE_COUNTER != ds->type) && (DS_TYPE_GAUGE != ds->type) && (DS_TYPE_DERIVE != ds->type) && (DS_TYPE_ABSOLUTE != ds->type)) {
+ if ((DS_TYPE_COUNTER != ds->type)
+ && (DS_TYPE_GAUGE != ds->type)
+ && (DS_TYPE_DERIVE != ds->type)
+ && (DS_TYPE_ABSOLUTE != ds->type)) {
log_err ("hv2data_source: Invalid DS type.");
return -1;
}
log_err ("hv2data_source: Invalid DS type.");
return -1;
}
@@
-646,9
+649,9
@@
static int value_list2hv (pTHX_ value_list_t *vl, data_set_t *ds, HV *hash)
else if (DS_TYPE_GAUGE == ds->ds[i].type)
val = newSVnv (vl->values[i].gauge);
else if (DS_TYPE_DERIVE == ds->ds[i].type)
else if (DS_TYPE_GAUGE == ds->ds[i].type)
val = newSVnv (vl->values[i].gauge);
else if (DS_TYPE_DERIVE == ds->ds[i].type)
- val = newSV
n
v (vl->values[i].derive);
+ val = newSV
i
v (vl->values[i].derive);
else if (DS_TYPE_ABSOLUTE == ds->ds[i].type)
else if (DS_TYPE_ABSOLUTE == ds->ds[i].type)
- val = newSV
n
v (vl->values[i].absolute);
+ val = newSV
i
v (vl->values[i].absolute);
if (NULL == av_store (values, i, val)) {
av_undef (values);
if (NULL == av_store (values, i, val)) {
av_undef (values);