infra: show ops count in limiter

This commit is contained in:
Thomas Schoebel-Theuer 2013-11-20 15:46:16 +01:00
parent af418eb9f0
commit fd30cd6b44
3 changed files with 3 additions and 0 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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) \