Class ErrorCounter
java.lang.Object
services.moleculer.breaker.ErrorCounter
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final long[]protected final intprotected final longprotected ErrorCounter.Statusprotected final long -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedErrorCounter(long windowLength, long lockTimeout, int maxErrors) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancanRemove(long now) protected intgetErrorCounter(long now) protected longprotected ErrorCounter.StatusgetStatus(long now) protected booleanisAvailable(long now) protected voidonError(long now) protected void
-
Field Details
-
windowLength
protected final long windowLength -
lockTimeout
protected final long lockTimeout -
lastPos
protected final int lastPos -
prevStatus
-
errors
protected final long[] errors
-
-
Constructor Details
-
ErrorCounter
protected ErrorCounter(long windowLength, long lockTimeout, int maxErrors)
-
-
Method Details
-
onError
protected void onError(long now) -
onSuccess
protected void onSuccess() -
canRemove
protected boolean canRemove(long now) -
getStatus
-
isAvailable
protected boolean isAvailable(long now) -
getErrorCounter
protected int getErrorCounter(long now) -
getLastError
protected long getLastError()
-