Package io.jmix.flowui.monitoring
Class UiMonitoring
java.lang.Object
io.jmix.flowui.monitoring.UiMonitoring
Provides utility methods and constants to facilitate UI monitoring, including measuring and recording the
durations of various UI-related operations and lifecycle events.
-
Method Summary
Modifier and TypeMethodDescriptionprotected static booleancanDataLoaderBeMonitored(DataLoaderLifeCycle lifeCycle, DataLoaderMonitoringInfo monitoringInfo) protected static booleancanViewBeMonitored(ViewLifeCycle lifeCycle, String viewId) protected static io.micrometer.core.instrument.TimercreateDataLoaderTimer(io.micrometer.core.instrument.MeterRegistry meterRegistry, DataLoaderLifeCycle lifeCycle, String viewId, String loaderId) protected static io.micrometer.core.instrument.TimercreateViewTimer(io.micrometer.core.instrument.MeterRegistry meterRegistry, ViewLifeCycle lifeCycle, String viewId) protected static StringhandleNullTag(String tag) Prevents null from being tag value.static io.micrometer.core.instrument.Timer.SamplestartTimerSample(io.micrometer.core.instrument.MeterRegistry meterRegistry) Starts a timer sample for measuring durations of specific operations or lifecycles.static voidstopDataLoaderTimerSample(io.micrometer.core.instrument.Timer.Sample sample, io.micrometer.core.instrument.MeterRegistry meterRegistry, DataLoaderLifeCycle lifeCycle, DataLoaderMonitoringInfo info) Stops the timer sample that measures the duration of a specificDataLoaderLifeCyclestage for aDataLoader.static voidstopViewTimerSample(io.micrometer.core.instrument.Timer.Sample sample, io.micrometer.core.instrument.MeterRegistry meterRegistry, ViewLifeCycle lifeCycle, String viewId) Stops the timer sample that measures the duration of a specificViewLifeCyclephase for aView.
-
Method Details
-
startTimerSample
public static io.micrometer.core.instrument.Timer.Sample startTimerSample(io.micrometer.core.instrument.MeterRegistry meterRegistry) Starts a timer sample for measuring durations of specific operations or lifecycles. This method utilizes the providedMeterRegistryto create and return aTimer.Sample.- Parameters:
meterRegistry- the meter registry used to initialize the timer sample- Returns:
- Returns the newly created timer sample
-
stopDataLoaderTimerSample
public static void stopDataLoaderTimerSample(io.micrometer.core.instrument.Timer.Sample sample, io.micrometer.core.instrument.MeterRegistry meterRegistry, DataLoaderLifeCycle lifeCycle, DataLoaderMonitoringInfo info) Stops the timer sample that measures the duration of a specificDataLoaderLifeCyclestage for aDataLoader. Utilizes the providedTimer.Sampleand records the duration into aMeterRegistry.- Parameters:
sample- the timer sample to stopmeterRegistry- the meter registry to record metrics intolifeCycle- the life cycle stage of theDataLoaderinfo- monitoring information, including the view ID and loader ID.
-
stopViewTimerSample
public static void stopViewTimerSample(io.micrometer.core.instrument.Timer.Sample sample, io.micrometer.core.instrument.MeterRegistry meterRegistry, ViewLifeCycle lifeCycle, @Nullable String viewId) Stops the timer sample that measures the duration of a specificViewLifeCyclephase for aView. Utilizes the providedTimer.Sampleand records the duration into aMeterRegistry. -
createViewTimer
protected static io.micrometer.core.instrument.Timer createViewTimer(io.micrometer.core.instrument.MeterRegistry meterRegistry, ViewLifeCycle lifeCycle, String viewId) -
createDataLoaderTimer
protected static io.micrometer.core.instrument.Timer createDataLoaderTimer(io.micrometer.core.instrument.MeterRegistry meterRegistry, DataLoaderLifeCycle lifeCycle, String viewId, String loaderId) -
canDataLoaderBeMonitored
protected static boolean canDataLoaderBeMonitored(@Nullable DataLoaderLifeCycle lifeCycle, @Nullable DataLoaderMonitoringInfo monitoringInfo) -
canViewBeMonitored
protected static boolean canViewBeMonitored(@Nullable ViewLifeCycle lifeCycle, @Nullable String viewId) -
handleNullTag
Prevents null from being tag value. Actual sanity check should be performed before and prevent monitoring at all.
-