Class Profiler

java.lang.Object
com._1c.g5.v8.bm.common.check.Profiler

public final class Profiler extends Object
Generic simple profiler that allows to track total times of interesting processes with some checkpoints
  • Method Details

    • startActivity

      public static int startActivity(String description)
      Starts a new profiling activity. Profiling activity defines boundaries of a profiled process. At the beginning of a profiling activity the profiler makes a snapshot of all profiling source data.
      Parameters:
      description - The human-readable description of the activity. Cannot be null
      Returns:
      The unique identifier of the activity
    • finishActivity

      public static void finishActivity(int activityId)
      Finishes the previously started activity. Makes a snapshot of all profiling source data and makes a computation of profiled counters in a scope of a finished activity, adding the computed results report to an internal report accumulator
      Parameters:
      activityId - The identifier of an activity to finish. Does nothing if activity with a given identifier is absent
    • addProfilingSource

      public static void addProfilingSource(Profiler.IProfilingSource profilingSource)
      Adds a new profiling data source. All started activities are extended with the source's data as well
      Parameters:
      profilingSource - The source to add. Cannot be null
    • removeProfilingSource

      public static void removeProfilingSource(Profiler.IProfilingSource profilingSource)
      Removes a previously registered profiling source
      Parameters:
      profilingSource - The source to remove. Does nothing in case of an attempt to remove a source that wasn't registered in the profiler
    • dumpProfilingReports

      public static Supplier<String> dumpProfilingReports(boolean forcedDump)
      Dumps profiling reports
      Parameters:
      Forced - dump mode enables unfinished activities intermediate dump collection
      Returns:
      The report supplier. Cannot be null