mirror of
https://github.com/schoebel/mars
synced 2025-01-27 01:34:28 +00:00
infra: show ops count in limiter
This commit is contained in:
parent
af418eb9f0
commit
fd30cd6b44
@ -43,6 +43,7 @@ int mars_limit(struct mars_limiter *lim, int amount)
|
||||
if (likely(amount > 0)) {
|
||||
lim->lim_accu += amount;
|
||||
lim->lim_cumul += amount;
|
||||
lim->lim_count++;
|
||||
}
|
||||
|
||||
rate_raw = lim->lim_accu * LIMITER_TIME_RESOLUTION / window;
|
||||
|
@ -17,6 +17,7 @@ struct mars_limiter {
|
||||
/* readable */
|
||||
int lim_rate;
|
||||
int lim_cumul;
|
||||
int lim_count;
|
||||
long long lim_stamp;
|
||||
/* internal */
|
||||
long long lim_accu;
|
||||
|
@ -174,6 +174,7 @@ EXPORT_SYMBOL_GPL(mars_max_loadavg);
|
||||
INT_ENTRY(PREFIX "_minwindow_ms", (VAR)->lim_min_window,0600), \
|
||||
INT_ENTRY(PREFIX "_maxwindow_ms", (VAR)->lim_max_window,0600), \
|
||||
INT_ENTRY(PREFIX "_cumul_" SUFFIX, (VAR)->lim_cumul, 0600), \
|
||||
INT_ENTRY(PREFIX "_count_ops", (VAR)->lim_count, 0600), \
|
||||
INT_ENTRY(PREFIX "_rate_" SUFFIX, (VAR)->lim_rate, 0400) \
|
||||
|
||||
#define THRESHOLD_ENTRIES(VAR, PREFIX) \
|
||||
|
Loading…
Reference in New Issue
Block a user