Class UiMonitoring

java.lang.Object
io.jmix.flowui.monitoring.UiMonitoring

public class UiMonitoring extends Object
Provides utility methods and constants to facilitate UI monitoring, including measuring and recording the durations of various UI-related operations and lifecycle events.
  • 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 provided MeterRegistry to create and return a Timer.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 specific DataLoaderLifeCycle stage for a DataLoader. Utilizes the provided Timer.Sample and records the duration into a MeterRegistry.
      Parameters:
      sample - the timer sample to stop
      meterRegistry - the meter registry to record metrics into
      lifeCycle - the life cycle stage of the DataLoader
      info - 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 specific ViewLifeCycle phase for a View. Utilizes the provided Timer.Sample and records the duration into a MeterRegistry.
      Parameters:
      sample - the timer sample to stop
      meterRegistry - the meter registry to record metrics into
      lifeCycle - the life cycle phase of the View
      viewId - the unique identifier of the View, may be null
    • 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

      protected static String handleNullTag(@Nullable String tag)
      Prevents null from being tag value. Actual sanity check should be performed before and prevent monitoring at all.