Class DefaultDatabaseLatencyMeter
- java.lang.Object
-
- com.atlassian.confluence.internal.diagnostics.ipd.db.DefaultDatabaseLatencyMeter
-
- All Implemented Interfaces:
DatabaseLatencyMeter
public class DefaultDatabaseLatencyMeter extends Object implements DatabaseLatencyMeter
Measures database latency by measuring time of a simple sql query. Measuring latency value will make a new database connection, frequent measures may impact performance. If you don't need most recent latency value, seeDefaultDatabaseConnectionStateService
which caches latency values for a short time.- Since:
- 8.1.0
-
-
Method Detail
-
measure
public Optional<Duration> measure()
Description copied from interface:DatabaseLatencyMeter
Returns database latency.- Specified by:
measure
in interfaceDatabaseLatencyMeter
- Returns:
- database latency when database is connected, empty optional otherwise
-
-