1+ @startuml
2+ package com . iluwatar . health . check {
3+ class App {
4+ + App ()
5+ + main(args : String[]) {static}
6+ }
7+ class AsynchronousHealthChecker {
8+ - HEALTH_CHECK_FAILED_MESSAGE : String {static}
9+ - HEALTH_CHECK_TIMEOUT_MESSAGE : String {static}
10+ - LOGGER : Logger {static}
11+ - healthCheckExecutor : ScheduledExecutorService
12+ + AsynchronousHealthChecker ()
13+ - awaitTerminationWithTimeout () : boolean
14+ + performCheck(healthCheck : Supplier<Health>, timeoutInSeconds : long) : CompletableFuture<Health>
15+ + shutdown ()
16+ }
17+ class CpuHealthIndicator {
18+ - ERROR_MESSAGE : String {static}
19+ - HIGH_LOAD_AVERAGE_MESSAGE : String {static}
20+ - HIGH_LOAD_AVERAGE_MESSAGE_WITHOUT_PARAM : String {static}
21+ - HIGH_PROCESS_CPU_LOAD_MESSAGE : String {static}
22+ - HIGH_PROCESS_CPU_LOAD_MESSAGE_WITHOUT_PARAM : String {static}
23+ - HIGH_SYSTEM_CPU_LOAD_MESSAGE : String {static}
24+ - HIGH_SYSTEM_CPU_LOAD_MESSAGE_WITHOUT_PARAM : String {static}
25+ - LOGGER : Logger {static}
26+ - defaultWarningMessage : String
27+ - loadAverageThreshold : double
28+ - osBean : OperatingSystemMXBean
29+ - processCpuLoadThreshold : double
30+ - systemCpuLoadThreshold : double
31+ + CpuHealthIndicator ()
32+ + getDefaultWarningMessage () : String
33+ + getLoadAverageThreshold () : double
34+ + getOsBean () : OperatingSystemMXBean
35+ + getProcessCpuLoadThreshold () : double
36+ + getSystemCpuLoadThreshold () : double
37+ + health () : Health
38+ + init ()
39+ + setDefaultWarningMessage(defaultWarningMessage : String)
40+ + setLoadAverageThreshold(loadAverageThreshold : double)
41+ + setOsBean(osBean : OperatingSystemMXBean)
42+ + setProcessCpuLoadThreshold(processCpuLoadThreshold : double)
43+ + setSystemCpuLoadThreshold(systemCpuLoadThreshold : double)
44+ }
45+ class CustomHealthIndicator {
46+ - LOGGER : Logger {static}
47+ - cacheManager : CacheManager
48+ - healthCheckRepository : HealthCheckRepository
49+ - healthChecker : AsynchronousHealthChecker
50+ - timeoutInSeconds : long
51+ + CustomHealthIndicator(healthChecker : AsynchronousHealthChecker, cacheManager : CacheManager, healthCheckRepository : HealthCheckRepository)
52+ - check () : Health
53+ + evictHealthCache ()
54+ + health () : Health
55+ }
56+ class DatabaseTransactionHealthIndicator {
57+ - LOGGER : Logger {static}
58+ - asynchronousHealthChecker : AsynchronousHealthChecker
59+ - healthCheckRepository : HealthCheckRepository
60+ - retryTemplate : RetryTemplate
61+ - timeoutInSeconds : long
62+ + DatabaseTransactionHealthIndicator(healthCheckRepository : HealthCheckRepository, asynchronousHealthChecker : AsynchronousHealthChecker, retryTemplate : RetryTemplate)
63+ + getAsynchronousHealthChecker () : AsynchronousHealthChecker
64+ + getHealthCheckRepository () : HealthCheckRepository
65+ + getRetryTemplate () : RetryTemplate
66+ + getTimeoutInSeconds () : long
67+ + health () : Health
68+ + setTimeoutInSeconds(timeoutInSeconds : long)
69+ }
70+ class GarbageCollectionHealthIndicator {
71+ - LOGGER : Logger {static}
72+ - memoryUsageThreshold : double
73+ + GarbageCollectionHealthIndicator ()
74+ - addMemoryPoolDetails(collectorDetails : Map<String, String>, memoryPoolMxBeans : List<MemoryPoolMXBean>, memoryPoolNamesList : List<String>)
75+ - createCollectorDetails(gcBean : GarbageCollectorMXBean, memoryPoolMxBeans : List<MemoryPoolMXBean>) : Map<String, String>
76+ # getGarbageCollectorMxBeans() : List<GarbageCollectorMXBean>
77+ # getMemoryPoolMxBeans() : List<MemoryPoolMXBean>
78+ + getMemoryUsageThreshold () : double
79+ + health () : Health
80+ + setMemoryUsageThreshold(memoryUsageThreshold : double)
81+ }
82+ class HealthCheck {
83+ - id : Integer
84+ - status : String
85+ + HealthCheck ()
86+ # canEqual(other : Object) : boolean
87+ + equals(o : Object) : boolean
88+ + getId () : Integer
89+ + getStatus () : String
90+ + hashCode () : int
91+ + setId(id : Integer)
92+ + setStatus(status : String)
93+ + toString () : String
94+ }
95+ class HealthCheckRepository {
96+ - HEALTH_CHECK_OK : String {static}
97+ - LOGGER : Logger {static}
98+ - entityManager : EntityManager
99+ + HealthCheckRepository ()
100+ + checkHealth () : Integer
101+ + performTestTransaction ()
102+ }
103+ class MemoryHealthIndicator {
104+ - LOGGER : Logger {static}
105+ - asynchronousHealthChecker : AsynchronousHealthChecker
106+ - memoryThreshold : double
107+ - timeoutInSeconds : long
108+ + MemoryHealthIndicator(asynchronousHealthChecker : AsynchronousHealthChecker)
109+ + checkMemory () : Health
110+ + health () : Health
111+ }
112+ class RetryConfig {
113+ - backOffPeriod : long
114+ - maxAttempts : int
115+ + RetryConfig ()
116+ + retryTemplate () : RetryTemplate
117+ }
118+ }
119+ DatabaseTransactionHealthIndicator --> "- asynchronousHealthChecker " AsynchronousHealthChecker
120+ DatabaseTransactionHealthIndicator --> "- healthCheckRepository " HealthCheckRepository
121+ CustomHealthIndicator --> "- healthCheckRepository " HealthCheckRepository
122+ CustomHealthIndicator --> "- healthChecker " AsynchronousHealthChecker
123+ MemoryHealthIndicator --> "- asynchronousHealthChecker " AsynchronousHealthChecker
124+ @enduml
0 commit comments