/// <summary> /// Adds a setup task to the sessionpipeline /// </summary> /// <param name="session">The current session</param> /// <param name="setup">The setuptask</param> /// <returns>The current profiling session</returns> public static ProfilerSession Setup(this ProfilerSession session, Action setup) { return(session.AddMiddleware(new PreExecutionSessionHandler(setup))); }
/// <summary> /// Sets a Task that will be executed after each profiling task execution /// </summary> /// <param name="session">The current session</param> /// <param name="task">The task to execute after each profiling task</param> /// <returns>The current profiling session</returns> public static ProfilerSession PostExecute(this ProfilerSession session, Action <IExecutionContext> task) { return(session.AddMiddleware(new PostExecutionTaskHandler(task))); }
/// <summary> /// Add a delay before each task gets executed. The delay is not countet to the execution time of the task /// </summary> /// <param name="session"></param> /// <param name="duration"></param> /// <returns></returns> public static ProfilerSession AddDelay(this ProfilerSession session, TimeSpan duration) { return(session.AddMiddleware(new DelayTaskHandler(duration))); }
/// <summary> /// Sets a Task that will be executed before each profiling task execution /// </summary> /// <param name="session">The current session</param> /// <param name="task">The task to execute before each profiling task</param> /// <returns>The current profiling session</returns> public static ProfilerSession PreExecute(this ProfilerSession session, Action task) { return(session.AddMiddleware(new PreExecutionTaskHandler(task))); }