Interface IProfilingService

  • All Superinterfaces:
    IManagedService

    public interface IProfilingService
    extends IManagedService
    Profiling service interface. Initiates requests to turn profiling on/off. Clients may add IProfilingResultListeners that will be notified when new profiling results are available.
    Restriction:
    This interface is not intended to be extended by clients.
    Restriction:
    This interface is not intended to be implemented by clients.
    • Method Detail

      • toggleTargetWaitingState

        void toggleTargetWaitingState​(boolean enabled)
        Prepares profiling service to turn profiling on/off. Must be called before toggleProfiling(IProfileTarget).
        Parameters:
        enabled - true if profiling is to be enabled, false otherwise.
      • toggleProfiling

        void toggleProfiling​(IProfileTarget target)
        Switches profiling mode on if it is off and turns it off if it is on. toggleTargetWaitingState(boolean) must be called before this method.
        Parameters:
        target - Profiling target to toggle profiling on/off. Cannot be null.
      • addProfilingResultsListener

        void addProfilingResultsListener​(IProfilingResultListener listener)
        Adds IProfilingResultListener that will be notified when new profiling results are available.
        Parameters:
        listener - Profiling results listener to be added. Cannot be null.
      • removeProfilingResultsListener

        void removeProfilingResultsListener​(IProfilingResultListener listener)
        Removes IProfilingResultListener from the list of listeners to be notified when new profiling results are available.
        Parameters:
        listener - Profiling results listener to be removed. Cannot be null.
      • getResults

        List<IProfilingResult> getResults()
        Gets results from cache in IProfilingService.
        WARNING: users should not use IProfilingService.getResults().clear() as it can break the results listeners. Instead, use clear().
        Returns:
        Results contained in cache at the moment of call. Never null, but can be empty. Notice that some results can contain performance info for different profiling targets (if these targets were profiled during the same profiling session).
      • importResults

        void importResults​(List<IProfilingResult> results)
        Saves all passed results to cache and notifies IProfilingResultListeners with the last of them (assuming results are sorted according to dates of profiling sessions).
        Parameters:
        results - List with results that need to be imported. Cannot be null.
      • setResultName

        void setResultName​(IProfilingResult result,
                           String name)
        Sets profiling result name. IProfilingResultListeners will be notified about renaming result.
        Parameters:
        result - Result to rename. Cannot be null.
        name - Name to set. Can be null to reset result name.