Class DatabaseManagementImpl
- java.lang.Object
-
- io.github.mfvanek.pg.common.management.DatabaseManagementImpl
-
- All Implemented Interfaces:
DatabaseManagement,StatisticsAware
public class DatabaseManagementImpl extends java.lang.Object implements DatabaseManagement
Implementation ofDatabaseManagement.- See Also:
IndexesMaintenanceOnHost
-
-
Constructor Summary
Constructors Constructor Description DatabaseManagementImpl(HighAvailabilityPgConnection haPgConnection, MaintenanceFactory maintenanceFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<java.time.OffsetDateTime>getLastStatsResetTimestamp()Gets time at which database statistics were last reset on the primary host.voidresetStatistics()Reset all statistics counters on all hosts in the cluster to zero.
-
-
-
Constructor Detail
-
DatabaseManagementImpl
public DatabaseManagementImpl(@Nonnull HighAvailabilityPgConnection haPgConnection, @Nonnull MaintenanceFactory maintenanceFactory)
-
-
Method Detail
-
resetStatistics
public void resetStatistics()
Reset all statistics counters on all hosts in the cluster to zero.It is safe running this method on your database. It just reset counters without any impact on performance.
- Specified by:
resetStatisticsin interfaceDatabaseManagement- Specified by:
resetStatisticsin interfaceStatisticsAware- See Also:
StatisticsMaintenanceOnHost
-
getLastStatsResetTimestamp
@Nonnull public java.util.Optional<java.time.OffsetDateTime> getLastStatsResetTimestamp()
Gets time at which database statistics were last reset on the primary host.- Specified by:
getLastStatsResetTimestampin interfaceDatabaseManagement- Specified by:
getLastStatsResetTimestampin interfaceStatisticsAware- Returns:
Optionalof null or time at which database statistics were last reset.
-
-