Class DropwizardBundlesTracker

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<io.dropwizard.core.ConfiguredBundle>, java.util.Collection<io.dropwizard.core.ConfiguredBundle>, java.util.List<io.dropwizard.core.ConfiguredBundle>, java.util.RandomAccess

    public class DropwizardBundlesTracker
    extends java.util.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:
    Serialized Form
    • Field Summary

      • Fields inherited from class java.util.AbstractList

        modCount
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int index, io.dropwizard.core.ConfiguredBundle element)  
      boolean add​(io.dropwizard.core.ConfiguredBundle configuredBundle)  
      boolean addAll​(int index, java.util.Collection<? extends io.dropwizard.core.ConfiguredBundle> c)  
      boolean addAll​(java.util.Collection<? extends io.dropwizard.core.ConfiguredBundle> c)  
      com.google.common.base.Stopwatch getWebTimer()  
      io.dropwizard.core.ConfiguredBundle set​(int index, io.dropwizard.core.ConfiguredBundle element)  
      • Methods inherited from class java.util.ArrayList

        clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, size, sort, spliterator, subList, toArray, toArray, trimToSize
      • Methods inherited from class java.util.AbstractCollection

        containsAll, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, stream, toArray
      • Methods inherited from interface java.util.List

        containsAll
    • Constructor Detail

      • 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 Detail

      • 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 java.util.Collection<io.dropwizard.core.ConfiguredBundle>
        Specified by:
        add in interface java.util.List<io.dropwizard.core.ConfiguredBundle>
        Overrides:
        add in class java.util.ArrayList<io.dropwizard.core.ConfiguredBundle>
      • add

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

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

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

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