in spectator/stateless_meters.h [48:56]
T restrict(T amount, T min, T max) { auto r = amount; if (r > max) { r = max; } else if (r < min) { r = min; } return r; }