Class CoreEvents
java.lang.Object
org.frontcache.plugin.host.CoreEvents
The core's emit points, one method per event: each checks
FcEventBus.wants(long) before building anything, so
a node nobody observes pays one volatile read per point and allocates nothing. Never throws into its caller.-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcacheInvalidated(String scope, String filter) static voidchallengeIssued(RequestContext context, String rule, String provider, String plugin) A challenge rule sent a visitor to a provider's page - after the redirect is written.static voidcircuitStateChanged(String commandKey, String from, String to, float failureRate) static voidconfigReloaded(String file, boolean ok, int entries, List<String> reasons) static StringfailureName(Enum<?> failure) A resilience event type as an event spells it:TIMEOUT->timeout.static voidfallbackServed(RequestContext context, String command, String failure, String uri, Throwable cause) A fallback was served instead of the origin.static voidguardMatched(RequestContext context, String rule, String disposition, int status) A guard rule acted on a request (rejected / redirected) or matched it as a dry run (status 0).static voidoriginError(RequestContext context, String command, String failure, int status, String uri, Throwable cause, long latencyMillis) A resilience command's origin call failed.static voidrateLimitExceeded(RequestContext context, String bucket, String rule, int limit, long windowMillis, String clientKey) A client crossed a bucket's limit - called once per client per window, by the rate-limit predicate.static voidrequestCompleted(RequestContext context, boolean cacheable, String cache, long runtimeMillis, long lengthBytes) A request was logged.static Stringuri(RequestContext context) host + path + query, as the guard log line writes it, truncated.
-
Method Details
-
guardMatched
public static void guardMatched(RequestContext context, String rule, String disposition, int status) A guard rule acted on a request (rejected / redirected) or matched it as a dry run (status 0). -
challengeIssued
public static void challengeIssued(RequestContext context, String rule, String provider, String plugin) A challenge rule sent a visitor to a provider's page - after the redirect is written. -
rateLimitExceeded
public static void rateLimitExceeded(RequestContext context, String bucket, String rule, int limit, long windowMillis, String clientKey) A client crossed a bucket's limit - called once per client per window, by the rate-limit predicate. -
circuitStateChanged
-
configReloaded
-
originError
public static void originError(RequestContext context, String command, String failure, int status, String uri, Throwable cause, long latencyMillis) A resilience command's origin call failed.- Parameters:
context- null for a call made outside a request (a management lookup)failure- the command's failure event, asfailureName(Enum)spells itstatus- the origin's status when it answered one outside 2xx-4xx; 0 otherwisecause- what the call threw; null for a refusal (circuit, bulkhead, pool)
-
fallbackServed
public static void fallbackServed(RequestContext context, String command, String failure, String uri, Throwable cause) A fallback was served instead of the origin.- Parameters:
context- null for a call made outside a requestcause- what the command threw; null for a refusal
-
cacheInvalidated
-
requestCompleted
public static void requestCompleted(RequestContext context, boolean cacheable, String cache, long runtimeMillis, long lengthBytes) A request was logged. Only a top-level one is an event, and only when the draw falls in a subscriber's sample - so a node that is observed but not for requests pays one volatile read here, and one that is pays a random draw per request and builds the event for the sampled share only.- Parameters:
cache-from-cache,dynamic,dynamic-softorplugin:<id>, as the request log writes it
-
failureName
-
uri
host + path + query, as the guard log line writes it, truncated.
-