io.quarkus.load.shedding.RequestPriority Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-load-shedding Show documentation
Show all versions of quarkus-load-shedding Show documentation
Shed excess load and keep your service available
package io.quarkus.load.shedding;
/**
* A priority that can be assigned to a request by implementing the {@link RequestPrioritizer}.
* There is 5 statically defined priority levels:
*
* - critical: this request should almost never be rejected
* - important: this request should only be rejected under high load
* - normal: this is a normal request
* - background: this is a background request, it may be rejected if needed
* - degraded: this request may be rejected freely
*
*
* @see RequestPrioritizer
*/
public enum RequestPriority {
CRITICAL(0),
IMPORTANT(1),
NORMAL(2),
BACKGROUND(3),
DEGRADED(4),
;
private final int cohortBaseline;
RequestPriority(int factor) {
this.cohortBaseline = factor * RequestClassifier.MAX_COHORT;
}
public int cohortBaseline() {
return cohortBaseline;
}
}