mirror of https://github.com/schoebel/mars
infra: report peak IO latencies
This commit is contained in:
parent
c35065fe97
commit
7ced30b24c
|
@ -158,6 +158,7 @@ struct threshold {
|
|||
int thr_factor; // in %
|
||||
int thr_plus; // in us
|
||||
// statistical
|
||||
int thr_max; // in ms
|
||||
int thr_triggered;
|
||||
int thr_true_hit;
|
||||
};
|
||||
|
@ -165,7 +166,10 @@ struct threshold {
|
|||
extern inline
|
||||
void threshold_check(struct threshold *thr, long long latency)
|
||||
{
|
||||
int ms = latency >> 6; // ignore small rounding error
|
||||
while (thr) {
|
||||
if (ms > thr->thr_max)
|
||||
thr->thr_max = ms;
|
||||
if (thr->thr_limit &&
|
||||
latency > (long long)thr->thr_limit * 1000) {
|
||||
thr->thr_triggered++;
|
||||
|
|
|
@ -220,6 +220,7 @@ EXPORT_SYMBOL_GPL(mars_max_loadavg);
|
|||
INT_ENTRY(PREFIX "_threshold_us", (VAR)->thr_limit, 0600), \
|
||||
INT_ENTRY(PREFIX "_factor_percent", (VAR)->thr_factor, 0600), \
|
||||
INT_ENTRY(PREFIX "_plus_us", (VAR)->thr_plus, 0600), \
|
||||
INT_ENTRY(PREFIX "_max_ms", (VAR)->thr_max, 0600), \
|
||||
INT_ENTRY(PREFIX "_triggered", (VAR)->thr_triggered,0400), \
|
||||
INT_ENTRY(PREFIX "_true_hit", (VAR)->thr_true_hit, 0400) \
|
||||
|
||||
|
|
Loading…
Reference in New Issue