Class DropwizardBundlesTracker

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<io.dropwizard.core.ConfiguredBundle>
ru.vyarus.dropwizard.guice.debug.report.start.DropwizardBundlesTracker
All Implemented Interfaces:
Serializable, Cloneable, Iterable<io.dropwizard.core.ConfiguredBundle>, Collection<io.dropwizard.core.ConfiguredBundle>, List<io.dropwizard.core.ConfiguredBundle>, RandomAccess

public class DropwizardBundlesTracker extends ArrayList<io.dropwizard.core.ConfiguredBundle>
Dropwizard bundles tracker for startup time report. Replaces bundles list inside Bootstrap object to detect bundles addition and wrap them to track run phase. Note that bundle added to collection AFTER initialization call. Also, bundle may add other bundles, which initialization would be called immediately and so it is impossible to measure initialization time of each bundle. So, instead of measuring bundle init time, bundle init done point is registered (it should be enough to highlight slow bundles).

It is not possible to measure init time for bundles, registered before the guice bundle. Warning would be shown.

Since:
09.03.2025
See Also:
  • Constructor Details

    • DropwizardBundlesTracker

      public DropwizardBundlesTracker(StatsInfo stats, StartupTimeInfo info, io.dropwizard.core.setup.Bootstrap bootstrap)
      Create bundles tracker.
      Parameters:
      stats - stat objects
      info - startup time data
      bootstrap - bootstrap instance
  • Method Details

    • getWebTimer

      public com.google.common.base.Stopwatch getWebTimer()
      Returns:
      web time tracker
    • add

      public boolean add(io.dropwizard.core.ConfiguredBundle configuredBundle)
      Specified by:
      add in interface Collection<io.dropwizard.core.ConfiguredBundle>
      Specified by:
      add in interface List<io.dropwizard.core.ConfiguredBundle>
      Overrides:
      add in class ArrayList<io.dropwizard.core.ConfiguredBundle>
    • add

      public void add(int index, io.dropwizard.core.ConfiguredBundle element)
      Specified by:
      add in interface List<io.dropwizard.core.ConfiguredBundle>
      Overrides:
      add in class ArrayList<io.dropwizard.core.ConfiguredBundle>
    • addAll

      public boolean addAll(Collection<? extends io.dropwizard.core.ConfiguredBundle> c)
      Specified by:
      addAll in interface Collection<io.dropwizard.core.ConfiguredBundle>
      Specified by:
      addAll in interface List<io.dropwizard.core.ConfiguredBundle>
      Overrides:
      addAll in class ArrayList<io.dropwizard.core.ConfiguredBundle>
    • addAll

      public boolean addAll(int index, Collection<? extends io.dropwizard.core.ConfiguredBundle> c)
      Specified by:
      addAll in interface List<io.dropwizard.core.ConfiguredBundle>
      Overrides:
      addAll in class ArrayList<io.dropwizard.core.ConfiguredBundle>
    • set

      public io.dropwizard.core.ConfiguredBundle set(int index, io.dropwizard.core.ConfiguredBundle element)
      Specified by:
      set in interface List<io.dropwizard.core.ConfiguredBundle>
      Overrides:
      set in class ArrayList<io.dropwizard.core.ConfiguredBundle>