Show / Hide Table of Contents

Class Profiler

Provides operations for profiling the code.

Inheritance
System.Object
Profiler
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas.Diagnostics
Assembly: Kephas.Core.dll
Syntax
public static class Profiler

Methods

| Improve this Doc View Source

WithDebugStopwatch(Action, ILogger, String)

Executes the action with a stopwatch, optionally logging the elapsed time at Debug level.

Declaration
public static TimeSpan WithDebugStopwatch(Action action, ILogger logger = null, string memberName = null)
Parameters
Type Name Description
System.Action action

The action.

ILogger logger

The logger.

System.String memberName

Name of the member.

Returns
Type Description
System.TimeSpan

The elapsed time.

| Improve this Doc View Source

WithDebugStopwatchAsync(Func<Task>, ILogger, String)

Executes the action with a stopwatch for asynchronous actions, optionally logging the elapsed time at Debug level.

Declaration
public static Task<TimeSpan> WithDebugStopwatchAsync(Func<Task> action, ILogger logger = null, string memberName = null)
Parameters
Type Name Description
System.Func<System.Threading.Tasks.Task> action

The action.

ILogger logger

The logger.

System.String memberName

Name of the member.

Returns
Type Description
System.Threading.Tasks.Task<System.TimeSpan>

The elapsed time.

| Improve this Doc View Source

WithInfoStopwatch(Action, ILogger, String)

Executes the action with a stopwatch, optionally logging the elapsed time at Info level.

Declaration
public static TimeSpan WithInfoStopwatch(Action action, ILogger logger = null, string memberName = null)
Parameters
Type Name Description
System.Action action

The action.

ILogger logger

The logger.

System.String memberName

Name of the member.

Returns
Type Description
System.TimeSpan

The elapsed time.

| Improve this Doc View Source

WithInfoStopwatchAsync(Func<Task>, ILogger, String)

Executes the action with a stopwatch for asynchronous actions, optionally logging the elapsed time at Info level.

Declaration
public static Task<TimeSpan> WithInfoStopwatchAsync(Func<Task> action, ILogger logger = null, string memberName = null)
Parameters
Type Name Description
System.Func<System.Threading.Tasks.Task> action

The action.

ILogger logger

The logger.

System.String memberName

Name of the member.

Returns
Type Description
System.Threading.Tasks.Task<System.TimeSpan>

The elapsed time.

| Improve this Doc View Source

WithStopwatch(Action, ILogger, LogLevel, String)

Executes the action with a stopwatch, optionally logging the elapsed time at the indicated log level.

Declaration
public static TimeSpan WithStopwatch(Action action, ILogger logger = null, LogLevel logLevel = LogLevel.Debug, string memberName = null)
Parameters
Type Name Description
System.Action action

The action.

ILogger logger

The logger.

LogLevel logLevel

The log level.

System.String memberName

Name of the member.

Returns
Type Description
System.TimeSpan

The elapsed time.

| Improve this Doc View Source

WithStopwatchAsync(Func<Task>, ILogger, LogLevel, String)

Executes the action with a stopwatch for asynchronous actions, optionally logging the elapsed time at the indicated log level.

Declaration
public static Task<TimeSpan> WithStopwatchAsync(Func<Task> action, ILogger logger = null, LogLevel logLevel = LogLevel.Debug, string memberName = null)
Parameters
Type Name Description
System.Func<System.Threading.Tasks.Task> action

The action.

ILogger logger

The logger.

LogLevel logLevel

The log level.

System.String memberName

Name of the member.

Returns
Type Description
System.Threading.Tasks.Task<System.TimeSpan>

The elapsed time.

| Improve this Doc View Source

WithTraceStopwatch(Action, ILogger, String)

Executes the action with a stopwatch, optionally logging the elapsed time at Trace level.

Declaration
public static TimeSpan WithTraceStopwatch(Action action, ILogger logger = null, string memberName = null)
Parameters
Type Name Description
System.Action action

The action.

ILogger logger

The logger.

System.String memberName

Name of the member.

Returns
Type Description
System.TimeSpan

The elapsed time.

| Improve this Doc View Source

WithTraceStopwatchAsync(Func<Task>, ILogger, String)

Executes the action with a stopwatch for asynchronous actions, optionally logging the elapsed time at Trace level.

Declaration
public static Task<TimeSpan> WithTraceStopwatchAsync(Func<Task> action, ILogger logger = null, string memberName = null)
Parameters
Type Name Description
System.Func<System.Threading.Tasks.Task> action

The action.

ILogger logger

The logger.

System.String memberName

Name of the member.

Returns
Type Description
System.Threading.Tasks.Task<System.TimeSpan>

The elapsed time.

| Improve this Doc View Source

WithWarningStopwatch(Action, ILogger, String)

Executes the action with a stopwatch, optionally logging the elapsed time at Warning level.

Declaration
public static TimeSpan WithWarningStopwatch(Action action, ILogger logger = null, string memberName = null)
Parameters
Type Name Description
System.Action action

The action.

ILogger logger

The logger.

System.String memberName

Name of the member.

Returns
Type Description
System.TimeSpan

The elapsed time.

| Improve this Doc View Source

WithWarningStopwatchAsync(Func<Task>, ILogger, String)

Executes the action with a stopwatch for asynchronous actions, optionally logging the elapsed time at Warning level.

Declaration
public static Task<TimeSpan> WithWarningStopwatchAsync(Func<Task> action, ILogger logger = null, string memberName = null)
Parameters
Type Name Description
System.Func<System.Threading.Tasks.Task> action

The action.

ILogger logger

The logger.

System.String memberName

Name of the member.

Returns
Type Description
System.Threading.Tasks.Task<System.TimeSpan>

The elapsed time.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX