summaryrefslogtreecommitdiffstats
path: root/package/wprobe/src/exporter/wprobe-export.c
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-12-19 22:19:09 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-12-19 22:19:09 +0000
commitf87f98d0c5b344b0973990cc628caf4afab4f928 (patch)
tree94dda8aa1053ef8a3a7935657fbd04d50a93db0d /package/wprobe/src/exporter/wprobe-export.c
parent8b5cfa1fdeb54d644d0a67a84624a2ba93494b54 (diff)
wprobe: export raw values (n, s, ss) to ipfix collectors for improved measurement accuracy
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18852 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/wprobe/src/exporter/wprobe-export.c')
-rw-r--r--package/wprobe/src/exporter/wprobe-export.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/package/wprobe/src/exporter/wprobe-export.c b/package/wprobe/src/exporter/wprobe-export.c
index 48be5f36b..9255d76c4 100644
--- a/package/wprobe/src/exporter/wprobe-export.c
+++ b/package/wprobe/src/exporter/wprobe-export.c
@@ -25,7 +25,6 @@ static int do_close = 0;
struct wprobe_mapping {
int id;
bool counter;
- float scale;
const char *wprobe_id;
struct wprobe_value *val;
};
@@ -36,16 +35,14 @@ struct wprobe_mapping {
#define WMAP(_id, _name, ...) \
{ \
- .scale = 1.0f, \
.counter = false, \
- .id = IPFIX_FT_WPROBE_##_id##_AVG, \
+ .id = IPFIX_FT_WPROBE_##_id##_N, \
.wprobe_id = _name \
, ## __VA_ARGS__ \
}
#define WMAP_COUNTER(_id, _name, ...) \
{ \
- .scale = 1.0f, \
.counter = true, \
.id = IPFIX_FT_WPROBE_##_id, \
.wprobe_id = _name \
@@ -144,7 +141,7 @@ add_template_fields(ipfix_t *handle, ipfix_template_t *t, struct wprobe_mapping
if (map[i].counter)
g_data.addrs[f++] = &map[i].val->U32;
else
- g_data.addrs[f++] = &map[i].val->avg;
+ g_data.addrs[f++] = &map[i].val->n;
if (ipfix_add_field( handle, t, FOKUS_USERID, map[i].id + 0, 4) < 0)
exit(1);
@@ -152,11 +149,11 @@ add_template_fields(ipfix_t *handle, ipfix_template_t *t, struct wprobe_mapping
if (map[i].counter)
continue;
- g_data.addrs[f++] = &map[i].val->stdev;
- g_data.addrs[f++] = &map[i].val->n;
- if (ipfix_add_field( handle, t, FOKUS_USERID, map[i].id + 1, 4) < 0)
+ g_data.addrs[f++] = &map[i].val->s;
+ g_data.addrs[f++] = &map[i].val->ss;
+ if (ipfix_add_field( handle, t, FOKUS_USERID, map[i].id + 1, 8) < 0)
exit(1);
- if (ipfix_add_field( handle, t, FOKUS_USERID, map[i].id + 2, 4) < 0)
+ if (ipfix_add_field( handle, t, FOKUS_USERID, map[i].id + 2, 8) < 0)
exit(1);
}
g_data.maxfields = f;