Task #5615
closedTask #5611: tracking: counters: improve efficiency of stats tracking
counters: avoid duplicate work
Description
Currently all counters always increment 2 fields: updates and value. This makes no sense for simple counters that just increment with one at a time, like the decoder.pkts counter. For those updates and value will always be the same.
Worse, the decoder.bytes counter will be updated the exact same number of types, so the updates field of this counter will be exactly the same as both fields in decoder.pkts.
Updated by Victor Julien 4 months ago
Wonder if we could introduce a higher level construct, like a derived counter. E.g.
RegisterDerivedCounter("decoder.avg_pkt_size", DERIVE_DIVIDE, "decoder.bytes", "decoder.pkts");
This could then be resolved by the stats thread that accumulates the stats.
Updated by Victor Julien 3 months ago
- Status changed from New to In Review
- Assignee changed from OISF Dev to Victor Julien
- Target version changed from TBD to 9.0.0-beta1
Updated by Philippe Antoine 9 days ago
Did https://github.com/OISF/suricata/pull/14622 finish this ticket ?
Updated by Victor Julien 9 days ago
- Status changed from In Review to Closed
I think so, ya.
Merged through https://github.com/OISF/suricata/pull/14639