MEDIUM: freq_ctr: make read_freq_ctr_period() use freq_ctr_total()
authorWilly Tarreau <w@1wt.eu>
Sat, 10 Apr 2021 22:57:33 +0000 (00:57 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 11 Apr 2021 09:11:03 +0000 (11:11 +0200)
commita7a31b26023a428e50cf348635f08c0f7ff50d8b
treee36c111dcb46cef9c55edd0e2dd1ed985bef2ec6
parentf3a9f8dc5a88837760127947a58365d489a03d54
MEDIUM: freq_ctr: make read_freq_ctr_period() use freq_ctr_total()

This one is the easiest to implement, it just requires a call and a
divide of the result. Anti-flapping correction for low-rates was
preserved.

Now calls using a constant period will be able to use a reciprocal
multiply for the period instead of a divide.
include/haproxy/freq_ctr.h
src/freq_ctr.c