Class BusinessScoreImpl
java.lang.Object
io.quarkiverse.businessscore.runtime.BusinessScoreImpl
- All Implemented Interfaces:
BusinessScore
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.quarkiverse.businessscore.BusinessScore
BusinessScore.Score, BusinessScore.ZombieStatus -
Method Summary
Modifier and TypeMethodDescriptionlongThe amount of time a score record is kept alive.longThe point at which the application is considered a zombie.voidreset()Reset the score, i.e.voidIncrease the business score.voidsetTimeWindow(Duration value) voidsetZombieThreshold(long value) test()Check the "zombie" status of the current application.
-
Method Details
-
score
Description copied from interface:BusinessScoreIncrease the business score.- Specified by:
scorein interfaceBusinessScore- See Also:
-
reset
public void reset()Description copied from interface:BusinessScoreReset the score, i.e. remove all score records.- Specified by:
resetin interfaceBusinessScore- See Also:
-
getCurrent
public long getCurrent()- Specified by:
getCurrentin interfaceBusinessScore- Returns:
- the sum of all score records in the current time window
- See Also:
-
getZombieThreshold
public long getZombieThreshold()Description copied from interface:BusinessScoreThe point at which the application is considered a zombie.- Specified by:
getZombieThresholdin interfaceBusinessScore- Returns:
- the threshold
-
test
Description copied from interface:BusinessScoreCheck the "zombie" status of the current application. An application is considered a zombie if the current score is below the current zombie threshold in the current time window. Note thatBusinessScore.ZombieStatus.isZombiereturnsfalseif the application did not run for at least a duration of the current time window.- Specified by:
testin interfaceBusinessScore- Returns:
- the zombie status
- See Also:
-
setZombieThreshold
public void setZombieThreshold(long value) - Specified by:
setZombieThresholdin interfaceBusinessScore
-
getTimeWindow
Description copied from interface:BusinessScoreThe amount of time a score record is kept alive.- Specified by:
getTimeWindowin interfaceBusinessScore- Returns:
- the time window
-
setTimeWindow
- Specified by:
setTimeWindowin interfaceBusinessScore
-
getCurrentRecords
- Specified by:
getCurrentRecordsin interfaceBusinessScore- Returns:
- the list of records in the current time window
-