Package com._1c.g5.v8.bm.common.check
Class Profiler
java.lang.Object
com._1c.g5.v8.bm.common.check.Profiler
Generic simple profiler that allows to track total times of interesting processes with some checkpoints
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceData snapshot of profiling countersstatic interfaceProfiling source collects and provides pofiling data in form of profiling reports. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddProfilingSource(Profiler.IProfilingSource profilingSource) Adds a new profiling data source.dumpProfilingReports(boolean forcedDump) Dumps profiling reportsstatic voidfinishActivity(int activityId) Finishes the previously started activity.static voidremoveProfilingSource(Profiler.IProfilingSource profilingSource) Removes a previously registered profiling sourcestatic intstartActivity(String description) Starts a new profiling activity.
-
Method Details
-
startActivity
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 benull- 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
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 benull
-
removeProfilingSource
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
Dumps profiling reports- Parameters:
Forced- dump mode enables unfinished activities intermediate dump collection- Returns:
- The report supplier. Cannot be
null
-