Commit 48c6bbea authored by 's avatar

Fixed first packet issue (gap measurement) and verbose output.


git-svn-id: file:///home/svn/mapi/trunk@1402 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent a7c28b6d
......@@ -27,7 +27,7 @@
// informations about received packets
//#define __BURST_DEBUG
// informations about manipulation with received packets
#define __BURST_VERBOSE
//#define __BURST_VERBOSE
// print lag/lead for each packets (if you need some stats...)
//#define __BURST_DEBUG_LAG_LEAD
// print maximal/minimal lag/lead (if you need some stats...)
......@@ -505,24 +505,27 @@ printf("process: save [%d / %d] += %lu B (= %lu B), += %lu pkts (= %lu pkts), +1
// NEW: store inter-burst gap size too
if(pkt_head->ts > pkt_ts_ull_exa) {
gap_len_frac = pkt_head->ts - pkt_ts_ull_exa;
ULLTOD(gap_len_frac, gap_len_s);
gap_len_b = (unsigned long long) (gap_len_s / internal_data_ptr->B_s);
}
else gap_len_b = 0;
if(internal_data_ptr->last_pkt_wlen) { // if not first packet
if(gap_len_b < internal_data_ptr->min) {
cat = 0;
} else cat = ((gap_len_b - internal_data_ptr->min) / internal_data_ptr->step) + 1; // +1: category 0 is reserved for <0, min>
if(pkt_head->ts > pkt_ts_ull_exa) {
gap_len_frac = pkt_head->ts - pkt_ts_ull_exa;
ULLTOD(gap_len_frac, gap_len_s);
gap_len_b = (unsigned long long) (gap_len_s / internal_data_ptr->B_s);
}
else gap_len_b = 0;
if(cat > internal_data_ptr->cats) {
cat = internal_data_ptr->cats;
}
if(gap_len_b < internal_data_ptr->min) {
cat = 0;
} else cat = ((gap_len_b - internal_data_ptr->min) / internal_data_ptr->step) + 1; // +1: category 0 is reserved for <0, min>
((burst_category_t *)instance->result.data)[cat].gap_bytes += gap_len_b;
if(internal_data_ptr->burst_bytes > 0) // not the very first packet
((burst_category_t *)instance->result.data)[cat].gaps++;
if(cat > internal_data_ptr->cats) {
cat = internal_data_ptr->cats;
}
((burst_category_t *)instance->result.data)[cat].gap_bytes += gap_len_b;
if(internal_data_ptr->burst_bytes > 0) // not the very first packet
((burst_category_t *)instance->result.data)[cat].gaps++;
}
}
else { // if one bursts, show goes on
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment