public static class Config.EventPersistence extends Object
Config.Property.EventPersistence configuration activates and tunes the feature that stores the
detected events into a database table over time.
Configuration and mapping events are written once, right after scanning, using JDBC batching. Runtime events are aggregated into time windows (occurrence count and, when available, total and maximum durations), so a frequently triggered issue does not generate one row per occurrence.
The events are stored using the host application's SessionFactory, so they share the
same database credentials and connection pool and no separate DataSource or JDBC URL
needs to be configured.
| Constructor and Description |
|---|
EventPersistence() |
| Modifier and Type | Method and Description |
|---|---|
EventPersistenceSettings |
buildSettings(org.hibernate.SessionFactory sessionFactory,
String fallbackApplicationName)
Build the resolved
EventPersistenceSettings for this configuration. |
String |
getApplicationName() |
boolean |
isEnabled() |
Config.EventPersistence |
setApplicationName(String applicationName) |
Config.EventPersistence |
setBatchSize(int batchSize) |
Config.EventPersistence |
setEnabled(boolean enabled) |
Config.EventPersistence |
setRuntimeMaxRollupSize(int runtimeMaxRollupSize) |
Config.EventPersistence |
setRuntimeRollupWindowMillis(long runtimeRollupWindowMillis) |
Config.EventPersistence |
setSchemaAction(SchemaAction schemaAction) |
Config.EventPersistence |
setWebAppAuth(String webAppAuthUsername,
String webAppAuthPassword)
Enable Basic authentication on the web app with the given credentials.
|
Config.EventPersistence |
setWebAppEnabled(boolean webAppEnabled)
Start the web app automatically when the Optimizer bootstraps.
|
Config.EventPersistence |
setWebAppHost(String webAppHost)
Set the host the web app binds to (default
localhost). |
Config.EventPersistence |
setWebAppPort(int webAppPort)
Set the port the web app binds to.
|
public boolean isEnabled()
public Config.EventPersistence setEnabled(boolean enabled)
public String getApplicationName()
public Config.EventPersistence setApplicationName(String applicationName)
public Config.EventPersistence setBatchSize(int batchSize)
public Config.EventPersistence setRuntimeRollupWindowMillis(long runtimeRollupWindowMillis)
public Config.EventPersistence setRuntimeMaxRollupSize(int runtimeMaxRollupSize)
public Config.EventPersistence setSchemaAction(SchemaAction schemaAction)
public Config.EventPersistence setWebAppEnabled(boolean webAppEnabled)
SessionFactory (hence the same
database credentials and connection pool) that the Optimizer is built on. By default it
binds a dynamically-allocated free port on localhost and logs the resulting URL.
When disabled (the default), the web app can still be started on demand via
HypersistenceOptimizer#startWebApp().
webAppEnabled - whether the web app is enabledConfig.Property.EventPersistencepublic Config.EventPersistence setWebAppHost(String webAppHost)
localhost).webAppHost - the web app hostConfig.Property.EventPersistencepublic Config.EventPersistence setWebAppPort(int webAppPort)
0 (the default) to have a
free port allocated dynamically; the resolved URL is then logged at startup.webAppPort - the web app port, or 0 for a dynamic oneConfig.Property.EventPersistencepublic Config.EventPersistence setWebAppAuth(String webAppAuthUsername, String webAppAuthPassword)
webAppAuthUsername - the Basic auth user namewebAppAuthPassword - the Basic auth passwordConfig.Property.EventPersistencepublic EventPersistenceSettings buildSettings(org.hibernate.SessionFactory sessionFactory, String fallbackApplicationName)
EventPersistenceSettings for this configuration.sessionFactory - the host application's SessionFactory, reused both
to generate the schema and to borrow JDBC connectionsfallbackApplicationName - the application name to use when none is configured
(e.g. the JMX Persistence Unit name)EventPersistenceSettingsCopyright © 2026. All rights reserved.