twitter / rezolus

Systems performance telemetry
Apache License 2.0
1.56k stars 116 forks source link

Fix a bug that causes tcp/receive/duplicate|out_of_order not working #267

Closed WUMUXIAN closed 2 years ago

WUMUXIAN commented 2 years ago

Problem

tcp/receive/duplicate and tcp/receive/out_of_order metrics count are always 0. Even when there are actually duplicated or out of order packets in testing.

Solution

This is caused by comparing u32 against 0 in the code, and the conditions are never met. The fix is to compare them properly as signed integer.

Result

In testing, now tcp/receive/duplicate and tcp/receive/out_of_order work as expected.