wprobe: export raw values (n, s, ss) to ipfix collectors for improved measurement accuracy

SVN-Revision: 18852
This commit is contained in:
Felix Fietkau 2009-12-19 22:19:09 +00:00
parent 0a46ab2f97
commit 6a2c27b4e8
3 changed files with 48 additions and 50 deletions

View File

@ -1,9 +1,9 @@
use strict; use strict;
my @fields = ( my @fields = (
[ "_avg", "FLOAT", " - Average" ], [ "_n", "UINT", " - Number of samples", 4 ],
[ "_stdev", "FLOAT", " - Standard deviation" ], [ "_s", "UINT", " - Sum of samples", 8 ],
[ "_n", "UINT", " - Number of samples" ] [ "_ss", "UINT", " - Sum of squared samples", 8 ],
); );
my $file = $ARGV[0] or die "Syntax: $0 <file>\n"; my $file = $ARGV[0] or die "Syntax: $0 <file>\n";
@ -23,7 +23,7 @@ while (<STDIN>) {
my $descr = $4; my $descr = $4;
my @f; my @f;
if ($counter) { if ($counter) {
@f = [ "", "UINT", "" ]; @f = [ "", "UINT", "", 4];
} else { } else {
@f = @fields; @f = @fields;
} }
@ -33,7 +33,8 @@ while (<STDIN>) {
my $N = uc $n; my $N = uc $n;
my $ftype = $f->[1]; my $ftype = $f->[1];
my $fdesc = $f->[2]; my $fdesc = $f->[2];
print "$nr, IPFIX_FT_WPROBE_$rfield$N, 4, IPFIX_CODING_$ftype, \"$nfield$n\", \"$descr$fdesc\"\n"; my $size = $f->[3];
print "$nr, IPFIX_FT_WPROBE_$rfield$N, $size, IPFIX_CODING_$ftype, \"$nfield$n\", \"$descr$fdesc\"\n";
} }
}; };
} }

View File

@ -4,41 +4,41 @@
313, IPFIX_FT_OWDVARMIN_NSEC, 4, IPFIX_CODING_INT, "owdvarmin_nsec", "FOKUS minimum owd variance in ns" 313, IPFIX_FT_OWDVARMIN_NSEC, 4, IPFIX_CODING_INT, "owdvarmin_nsec", "FOKUS minimum owd variance in ns"
314, IPFIX_FT_OWDVARMAX_NSEC, 4, IPFIX_CODING_INT, "owdvarmax_nsec", "FOKUS maximum ow variance in ns" 314, IPFIX_FT_OWDVARMAX_NSEC, 4, IPFIX_CODING_INT, "owdvarmax_nsec", "FOKUS maximum ow variance in ns"
+315, IPFIX_FT_WPROBE_NOISE_AVG, 4, IPFIX_CODING_FLOAT, "global_noise_avg", "wprobe global noice floor - Average" +315, IPFIX_FT_WPROBE_NOISE_N, 4, IPFIX_CODING_UINT, "global_noise_n", "wprobe global noice floor - Number of samples"
+316, IPFIX_FT_WPROBE_NOISE_STDEV, 4, IPFIX_CODING_FLOAT, "global_noise_stdev", "wprobe global noice floor - Standard deviation" +316, IPFIX_FT_WPROBE_NOISE_S, 8, IPFIX_CODING_UINT, "global_noise_s", "wprobe global noice floor - Sum of samples"
+317, IPFIX_FT_WPROBE_NOISE_N, 4, IPFIX_CODING_UINT, "global_noise_n", "wprobe global noice floor - Number of samples" +317, IPFIX_FT_WPROBE_NOISE_SS, 8, IPFIX_CODING_UINT, "global_noise_ss", "wprobe global noice floor - Sum of squared samples"
+318, IPFIX_FT_WPROBE_PHY_BUSY_AVG, 4, IPFIX_CODING_FLOAT, "global_phy_busy_avg", "wprobe global airtime total - Average" +318, IPFIX_FT_WPROBE_PHY_BUSY_N, 4, IPFIX_CODING_UINT, "global_phy_busy_n", "wprobe global airtime total - Number of samples"
+319, IPFIX_FT_WPROBE_PHY_BUSY_STDEV, 4, IPFIX_CODING_FLOAT, "global_phy_busy_stdev", "wprobe global airtime total - Standard deviation" +319, IPFIX_FT_WPROBE_PHY_BUSY_S, 8, IPFIX_CODING_UINT, "global_phy_busy_s", "wprobe global airtime total - Sum of samples"
+320, IPFIX_FT_WPROBE_PHY_BUSY_N, 4, IPFIX_CODING_UINT, "global_phy_busy_n", "wprobe global airtime total - Number of samples" +320, IPFIX_FT_WPROBE_PHY_BUSY_SS, 8, IPFIX_CODING_UINT, "global_phy_busy_ss", "wprobe global airtime total - Sum of squared samples"
+321, IPFIX_FT_WPROBE_PHY_RX_AVG, 4, IPFIX_CODING_FLOAT, "global_phy_rx_avg", "wprobe global airtime total from rx-frame - Average" +321, IPFIX_FT_WPROBE_PHY_RX_N, 4, IPFIX_CODING_UINT, "global_phy_rx_n", "wprobe global airtime total from rx-frame - Number of samples"
+322, IPFIX_FT_WPROBE_PHY_RX_STDEV, 4, IPFIX_CODING_FLOAT, "global_phy_rx_stdev", "wprobe global airtime total from rx-frame - Standard deviation" +322, IPFIX_FT_WPROBE_PHY_RX_S, 8, IPFIX_CODING_UINT, "global_phy_rx_s", "wprobe global airtime total from rx-frame - Sum of samples"
+323, IPFIX_FT_WPROBE_PHY_RX_N, 4, IPFIX_CODING_UINT, "global_phy_rx_n", "wprobe global airtime total from rx-frame - Number of samples" +323, IPFIX_FT_WPROBE_PHY_RX_SS, 8, IPFIX_CODING_UINT, "global_phy_rx_ss", "wprobe global airtime total from rx-frame - Sum of squared samples"
+324, IPFIX_FT_WPROBE_PHY_TX_AVG, 4, IPFIX_CODING_FLOAT, "global_phy_tx_avg", "wprobe global airtime total from tx-frame - Average" +324, IPFIX_FT_WPROBE_PHY_TX_N, 4, IPFIX_CODING_UINT, "global_phy_tx_n", "wprobe global airtime total from tx-frame - Number of samples"
+325, IPFIX_FT_WPROBE_PHY_TX_STDEV, 4, IPFIX_CODING_FLOAT, "global_phy_tx_stdev", "wprobe global airtime total from tx-frame - Standard deviation" +325, IPFIX_FT_WPROBE_PHY_TX_S, 8, IPFIX_CODING_UINT, "global_phy_tx_s", "wprobe global airtime total from tx-frame - Sum of samples"
+326, IPFIX_FT_WPROBE_PHY_TX_N, 4, IPFIX_CODING_UINT, "global_phy_tx_n", "wprobe global airtime total from tx-frame - Number of samples" +326, IPFIX_FT_WPROBE_PHY_TX_SS, 8, IPFIX_CODING_UINT, "global_phy_tx_ss", "wprobe global airtime total from tx-frame - Sum of squared samples"
+327, IPFIX_FT_WPROBE_RSSI_AVG, 4, IPFIX_CODING_FLOAT, "link_rssi_avg", "wprobe link received signal strength indication - Average" +327, IPFIX_FT_WPROBE_RSSI_N, 4, IPFIX_CODING_UINT, "link_rssi_n", "wprobe link received signal strength indication - Number of samples"
+328, IPFIX_FT_WPROBE_RSSI_STDEV, 4, IPFIX_CODING_FLOAT, "link_rssi_stdev", "wprobe link received signal strength indication - Standard deviation" +328, IPFIX_FT_WPROBE_RSSI_S, 8, IPFIX_CODING_UINT, "link_rssi_s", "wprobe link received signal strength indication - Sum of samples"
+329, IPFIX_FT_WPROBE_RSSI_N, 4, IPFIX_CODING_UINT, "link_rssi_n", "wprobe link received signal strength indication - Number of samples" +329, IPFIX_FT_WPROBE_RSSI_SS, 8, IPFIX_CODING_UINT, "link_rssi_ss", "wprobe link received signal strength indication - Sum of squared samples"
+330, IPFIX_FT_WPROBE_SIGNAL_AVG, 4, IPFIX_CODING_FLOAT, "link_signal_avg", "wprobe link signal strength in dB - Average" +330, IPFIX_FT_WPROBE_SIGNAL_N, 4, IPFIX_CODING_UINT, "link_signal_n", "wprobe link signal strength in dB - Number of samples"
+331, IPFIX_FT_WPROBE_SIGNAL_STDEV, 4, IPFIX_CODING_FLOAT, "link_signal_stdev", "wprobe link signal strength in dB - Standard deviation" +331, IPFIX_FT_WPROBE_SIGNAL_S, 8, IPFIX_CODING_UINT, "link_signal_s", "wprobe link signal strength in dB - Sum of samples"
+332, IPFIX_FT_WPROBE_SIGNAL_N, 4, IPFIX_CODING_UINT, "link_signal_n", "wprobe link signal strength in dB - Number of samples" +332, IPFIX_FT_WPROBE_SIGNAL_SS, 8, IPFIX_CODING_UINT, "link_signal_ss", "wprobe link signal strength in dB - Sum of squared samples"
+333, IPFIX_FT_WPROBE_IEEE_RX_RATE_AVG, 4, IPFIX_CODING_FLOAT, "link_ieee_rx_rate_avg", "wprobe link IEEE 802.11 RX data rate - Average" +333, IPFIX_FT_WPROBE_IEEE_RX_RATE_N, 4, IPFIX_CODING_UINT, "link_ieee_rx_rate_n", "wprobe link IEEE 802.11 RX data rate - Number of samples"
+334, IPFIX_FT_WPROBE_IEEE_RX_RATE_STDEV, 4, IPFIX_CODING_FLOAT, "link_ieee_rx_rate_stdev", "wprobe link IEEE 802.11 RX data rate - Standard deviation" +334, IPFIX_FT_WPROBE_IEEE_RX_RATE_S, 8, IPFIX_CODING_UINT, "link_ieee_rx_rate_s", "wprobe link IEEE 802.11 RX data rate - Sum of samples"
+335, IPFIX_FT_WPROBE_IEEE_RX_RATE_N, 4, IPFIX_CODING_UINT, "link_ieee_rx_rate_n", "wprobe link IEEE 802.11 RX data rate - Number of samples" +335, IPFIX_FT_WPROBE_IEEE_RX_RATE_SS, 8, IPFIX_CODING_UINT, "link_ieee_rx_rate_ss", "wprobe link IEEE 802.11 RX data rate - Sum of squared samples"
+336, IPFIX_FT_WPROBE_IEEE_TX_RATE_AVG, 4, IPFIX_CODING_FLOAT, "link_ieee_tx_rate_avg", "wprobe link IEEE 802.11 TX data rate - Average" +336, IPFIX_FT_WPROBE_IEEE_TX_RATE_N, 4, IPFIX_CODING_UINT, "link_ieee_tx_rate_n", "wprobe link IEEE 802.11 TX data rate - Number of samples"
+337, IPFIX_FT_WPROBE_IEEE_TX_RATE_STDEV, 4, IPFIX_CODING_FLOAT, "link_ieee_tx_rate_stdev", "wprobe link IEEE 802.11 TX data rate - Standard deviation" +337, IPFIX_FT_WPROBE_IEEE_TX_RATE_S, 8, IPFIX_CODING_UINT, "link_ieee_tx_rate_s", "wprobe link IEEE 802.11 TX data rate - Sum of samples"
+338, IPFIX_FT_WPROBE_IEEE_TX_RATE_N, 4, IPFIX_CODING_UINT, "link_ieee_tx_rate_n", "wprobe link IEEE 802.11 TX data rate - Number of samples" +338, IPFIX_FT_WPROBE_IEEE_TX_RATE_SS, 8, IPFIX_CODING_UINT, "link_ieee_tx_rate_ss", "wprobe link IEEE 802.11 TX data rate - Sum of squared samples"
+339, IPFIX_FT_WPROBE_RETRANSMIT_200_AVG, 4, IPFIX_CODING_FLOAT, "link_retransmit_200_avg", "wprobe link total retransmissions per packet - <200 bytes - Average" +339, IPFIX_FT_WPROBE_RETRANSMIT_200_N, 4, IPFIX_CODING_UINT, "link_retransmit_200_n", "wprobe link total retransmissions per packet - <200 bytes - Number of samples"
+340, IPFIX_FT_WPROBE_RETRANSMIT_200_STDEV, 4, IPFIX_CODING_FLOAT, "link_retransmit_200_stdev", "wprobe link total retransmissions per packet - <200 bytes - Standard deviation" +340, IPFIX_FT_WPROBE_RETRANSMIT_200_S, 8, IPFIX_CODING_UINT, "link_retransmit_200_s", "wprobe link total retransmissions per packet - <200 bytes - Sum of samples"
+341, IPFIX_FT_WPROBE_RETRANSMIT_200_N, 4, IPFIX_CODING_UINT, "link_retransmit_200_n", "wprobe link total retransmissions per packet - <200 bytes - Number of samples" +341, IPFIX_FT_WPROBE_RETRANSMIT_200_SS, 8, IPFIX_CODING_UINT, "link_retransmit_200_ss", "wprobe link total retransmissions per packet - <200 bytes - Sum of squared samples"
+342, IPFIX_FT_WPROBE_RETRANSMIT_400_AVG, 4, IPFIX_CODING_FLOAT, "link_retransmit_400_avg", "wprobe link total retransmissions per packet - <400 bytes - Average" +342, IPFIX_FT_WPROBE_RETRANSMIT_400_N, 4, IPFIX_CODING_UINT, "link_retransmit_400_n", "wprobe link total retransmissions per packet - <400 bytes - Number of samples"
+343, IPFIX_FT_WPROBE_RETRANSMIT_400_STDEV, 4, IPFIX_CODING_FLOAT, "link_retransmit_400_stdev", "wprobe link total retransmissions per packet - <400 bytes - Standard deviation" +343, IPFIX_FT_WPROBE_RETRANSMIT_400_S, 8, IPFIX_CODING_UINT, "link_retransmit_400_s", "wprobe link total retransmissions per packet - <400 bytes - Sum of samples"
+344, IPFIX_FT_WPROBE_RETRANSMIT_400_N, 4, IPFIX_CODING_UINT, "link_retransmit_400_n", "wprobe link total retransmissions per packet - <400 bytes - Number of samples" +344, IPFIX_FT_WPROBE_RETRANSMIT_400_SS, 8, IPFIX_CODING_UINT, "link_retransmit_400_ss", "wprobe link total retransmissions per packet - <400 bytes - Sum of squared samples"
+345, IPFIX_FT_WPROBE_RETRANSMIT_800_AVG, 4, IPFIX_CODING_FLOAT, "link_retransmit_800_avg", "wprobe link total retransmissions per packet - <800 bytes - Average" +345, IPFIX_FT_WPROBE_RETRANSMIT_800_N, 4, IPFIX_CODING_UINT, "link_retransmit_800_n", "wprobe link total retransmissions per packet - <800 bytes - Number of samples"
+346, IPFIX_FT_WPROBE_RETRANSMIT_800_STDEV, 4, IPFIX_CODING_FLOAT, "link_retransmit_800_stdev", "wprobe link total retransmissions per packet - <800 bytes - Standard deviation" +346, IPFIX_FT_WPROBE_RETRANSMIT_800_S, 8, IPFIX_CODING_UINT, "link_retransmit_800_s", "wprobe link total retransmissions per packet - <800 bytes - Sum of samples"
+347, IPFIX_FT_WPROBE_RETRANSMIT_800_N, 4, IPFIX_CODING_UINT, "link_retransmit_800_n", "wprobe link total retransmissions per packet - <800 bytes - Number of samples" +347, IPFIX_FT_WPROBE_RETRANSMIT_800_SS, 8, IPFIX_CODING_UINT, "link_retransmit_800_ss", "wprobe link total retransmissions per packet - <800 bytes - Sum of squared samples"
+348, IPFIX_FT_WPROBE_RETRANSMIT_1600_AVG, 4, IPFIX_CODING_FLOAT, "link_retransmit_1600_avg", "wprobe link total retransmissions per packet - >800 bytes - Average" +348, IPFIX_FT_WPROBE_RETRANSMIT_1600_N, 4, IPFIX_CODING_UINT, "link_retransmit_1600_n", "wprobe link total retransmissions per packet - >800 bytes - Number of samples"
+349, IPFIX_FT_WPROBE_RETRANSMIT_1600_STDEV, 4, IPFIX_CODING_FLOAT, "link_retransmit_1600_stdev", "wprobe link total retransmissions per packet - >800 bytes - Standard deviation" +349, IPFIX_FT_WPROBE_RETRANSMIT_1600_S, 8, IPFIX_CODING_UINT, "link_retransmit_1600_s", "wprobe link total retransmissions per packet - >800 bytes - Sum of samples"
+350, IPFIX_FT_WPROBE_RETRANSMIT_1600_N, 4, IPFIX_CODING_UINT, "link_retransmit_1600_n", "wprobe link total retransmissions per packet - >800 bytes - Number of samples" +350, IPFIX_FT_WPROBE_RETRANSMIT_1600_SS, 8, IPFIX_CODING_UINT, "link_retransmit_1600_ss", "wprobe link total retransmissions per packet - >800 bytes - Sum of squared samples"
+351, IPFIX_FT_WPROBE_FRAMES, 4, IPFIX_CODING_UINT, "global_frames", "wprobe global number of 802.11 frames seen" +351, IPFIX_FT_WPROBE_FRAMES, 4, IPFIX_CODING_UINT, "global_frames", "wprobe global number of 802.11 frames seen"
+352, IPFIX_FT_WPROBE_PROBEREQ, 4, IPFIX_CODING_UINT, "global_probereq", "wprobe global number of 802.11 probe requests seen" +352, IPFIX_FT_WPROBE_PROBEREQ, 4, IPFIX_CODING_UINT, "global_probereq", "wprobe global number of 802.11 probe requests seen"

View File

@ -25,7 +25,6 @@ static int do_close = 0;
struct wprobe_mapping { struct wprobe_mapping {
int id; int id;
bool counter; bool counter;
float scale;
const char *wprobe_id; const char *wprobe_id;
struct wprobe_value *val; struct wprobe_value *val;
}; };
@ -36,16 +35,14 @@ struct wprobe_mapping {
#define WMAP(_id, _name, ...) \ #define WMAP(_id, _name, ...) \
{ \ { \
.scale = 1.0f, \
.counter = false, \ .counter = false, \
.id = IPFIX_FT_WPROBE_##_id##_AVG, \ .id = IPFIX_FT_WPROBE_##_id##_N, \
.wprobe_id = _name \ .wprobe_id = _name \
, ## __VA_ARGS__ \ , ## __VA_ARGS__ \
} }
#define WMAP_COUNTER(_id, _name, ...) \ #define WMAP_COUNTER(_id, _name, ...) \
{ \ { \
.scale = 1.0f, \
.counter = true, \ .counter = true, \
.id = IPFIX_FT_WPROBE_##_id, \ .id = IPFIX_FT_WPROBE_##_id, \
.wprobe_id = _name \ .wprobe_id = _name \
@ -144,7 +141,7 @@ add_template_fields(ipfix_t *handle, ipfix_template_t *t, struct wprobe_mapping
if (map[i].counter) if (map[i].counter)
g_data.addrs[f++] = &map[i].val->U32; g_data.addrs[f++] = &map[i].val->U32;
else 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) if (ipfix_add_field( handle, t, FOKUS_USERID, map[i].id + 0, 4) < 0)
exit(1); exit(1);
@ -152,11 +149,11 @@ add_template_fields(ipfix_t *handle, ipfix_template_t *t, struct wprobe_mapping
if (map[i].counter) if (map[i].counter)
continue; continue;
g_data.addrs[f++] = &map[i].val->stdev; g_data.addrs[f++] = &map[i].val->s;
g_data.addrs[f++] = &map[i].val->n; g_data.addrs[f++] = &map[i].val->ss;
if (ipfix_add_field( handle, t, FOKUS_USERID, map[i].id + 1, 4) < 0) if (ipfix_add_field( handle, t, FOKUS_USERID, map[i].id + 1, 8) < 0)
exit(1); 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); exit(1);
} }
g_data.maxfields = f; g_data.maxfields = f;