Class ScriptStatsServiceImpl
Object
ScriptStatsServiceImpl
- All Implemented Interfaces:
ScriptStatsService
@Service("vScriptStatsService")
public class ScriptStatsServiceImpl
extends Object
implements ScriptStatsService
-
Nested Class Summary
Nested classes/interfaces inherited from interface ScriptStatsService
ScriptStatsService.GenericScriptEvalExecution -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidConsolidates in-memory slow script records with those persisted in the database, retaining only the top N slowest scripts as configured, and synchronizes changes.getRunningScripts(int forMoreThanSeconds) voidinit()voidsetExecutionMonitoringConfig(ExecutionMonitoringConfig executionConfig) <T> TwrapInStatsProxy(Class<T> type, String scriptSource, T interpretedScript) wrapRawScriptExecution(String scriptSource, ScriptStatsService.GenericScriptEvalExecution execution) wrapRawScriptExecution(String scriptSource, String methodName, ScriptStatsService.GenericScriptEvalExecution execution)
-
Constructor Details
-
ScriptStatsServiceImpl
public ScriptStatsServiceImpl()
-
-
Method Details
-
init
@PostConstruct public void init() -
getExecutionMonitoringConfig
- Specified by:
getExecutionMonitoringConfigin interfaceScriptStatsService
-
setExecutionMonitoringConfig
- Specified by:
setExecutionMonitoringConfigin interfaceScriptStatsService
-
wrapInStatsProxy
- Specified by:
wrapInStatsProxyin interfaceScriptStatsService
-
wrapRawScriptExecution
public Object wrapRawScriptExecution(String scriptSource, ScriptStatsService.GenericScriptEvalExecution execution) throws Exception - Specified by:
wrapRawScriptExecutionin interfaceScriptStatsService- Throws:
Exception
-
wrapRawScriptExecution
public Object wrapRawScriptExecution(String scriptSource, String methodName, ScriptStatsService.GenericScriptEvalExecution execution) throws Exception - Specified by:
wrapRawScriptExecutionin interfaceScriptStatsService- Throws:
Exception
-
flushSlowScriptList
@PreDestroy public void flushSlowScriptList()Consolidates in-memory slow script records with those persisted in the database, retaining only the top N slowest scripts as configured, and synchronizes changes.Steps: 1. Atomically snapshot and clear the in-memory list of new slow-script records. 2. Load all currently persisted records. 3. Merge, sort by duration descending, and trim to the configured limit. 4. Compute differences to determine which records to delete or insert. 5. Execute bulk delete and insert operations.
- Specified by:
flushSlowScriptListin interfaceScriptStatsService- See Also:
-
getRunningScripts
- Specified by:
getRunningScriptsin interfaceScriptStatsService
-
getRunningScripts
- Specified by:
getRunningScriptsin interfaceScriptStatsService
-