mirror of
https://github.com/schoebel/mars
synced 2025-01-12 01:29:50 +00:00
infra: show cumulatives in all limiters
This commit is contained in:
parent
871e3994db
commit
65bdee3b08
@ -32,8 +32,10 @@ int mars_limit(struct mars_limiter *lim, int amount)
|
||||
/* Races are possible, but taken into account.
|
||||
* There is no real harm from rarely lost updates.
|
||||
*/
|
||||
if (likely(amount > 0))
|
||||
if (likely(amount > 0)) {
|
||||
lim->lim_accu += amount;
|
||||
lim->lim_cumul += amount;
|
||||
}
|
||||
|
||||
rate_raw = lim->lim_accu * LIMITER_TIME_RESOLUTION / elapsed;
|
||||
rate = rate_raw;
|
||||
|
@ -15,6 +15,7 @@ struct mars_limiter {
|
||||
int lim_max_rate;
|
||||
/* readable */
|
||||
int lim_rate;
|
||||
int lim_cumul;
|
||||
long long lim_stamp;
|
||||
/* internal */
|
||||
long long lim_accu;
|
||||
|
@ -170,6 +170,7 @@ EXPORT_SYMBOL_GPL(mars_max_loadavg);
|
||||
|
||||
#define LIMITER_ENTRIES(VAR, PREFIX, SUFFIX) \
|
||||
INT_ENTRY(PREFIX "_limit_" SUFFIX, (VAR)->lim_max_rate, 0600), \
|
||||
INT_ENTRY(PREFIX "_cumul_" SUFFIX, (VAR)->lim_cumul, 0600), \
|
||||
INT_ENTRY(PREFIX "_rate_" SUFFIX, (VAR)->lim_rate, 0400) \
|
||||
|
||||
#define THRESHOLD_ENTRIES(VAR, PREFIX) \
|
||||
|
Loading…
Reference in New Issue
Block a user