Package io.quarkiverse.businessscore
Interface BusinessScore
- All Known Implementing Classes:
BusinessScoreImpl
public interface BusinessScore
The business score of the current application.
Quarkus provides a CDI bean with the Singleton scope that implements this interface.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordA score record.static final recordA zombie status. -
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
Increase the business score.- Parameters:
value-labels-- See Also:
-
reset
void reset()Reset the score, i.e. remove all score records.- See Also:
-
getCurrent
long getCurrent()- Returns:
- the sum of all score records in the current time window
- See Also:
-
test
BusinessScore.ZombieStatus test()Check 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.- Returns:
- the zombie status
- See Also:
-
getZombieThreshold
long getZombieThreshold()The point at which the application is considered a zombie.- Returns:
- the threshold
-
setZombieThreshold
void setZombieThreshold(long value) - Parameters:
value-
-
getTimeWindow
Duration getTimeWindow()The amount of time a score record is kept alive.- Returns:
- the time window
-
setTimeWindow
- Parameters:
value-
-
getCurrentRecords
List<BusinessScore.Score> getCurrentRecords()- Returns:
- the list of records in the current time window
-