Class AtlassianInstrumentation

java.lang.Object
com.atlassian.confluence.util.profiling.AtlassianInstrumentation

public class AtlassianInstrumentation extends Object
A mechanism to allow Hibernate instrumentation data to be recorded using the host Atlassian products infrastructure. By default no data is recorded. The host product needs to call registerFactory(AtlasSplitFactory) to register a factory that will create AtlassianInstrumentation.AtlasSplit instances. Factory can be unregistered with a call to unregisterFactory(AtlasSplitFactory). Multiple factories are supported.
  • Constructor Details

    • AtlassianInstrumentation

      public AtlassianInstrumentation()
  • Method Details

    • registerFactory

      public static void registerFactory(AtlassianInstrumentation.AtlasSplitFactory factory)
      Register a factory for use.
      Parameters:
      factory - the factory for use. If null, then no factory is registered.
    • unregisterFactory

      public static void unregisterFactory(AtlassianInstrumentation.AtlasSplitFactory factory)
      Unregister a factory.
      Parameters:
      factory - the factory to unregister. If null, then no factory is unregistered.
    • startSplit

      public static AtlassianInstrumentation.AtlasSplit startSplit(String name)
      Create a started split, using the registered factory. If no factory is registered, then a NOP instance is returned instead.
      Parameters:
      name - the name of the timer to associate the split time with.
      Returns:
      an instance for use. Will never be null.