Skip to main content

Timing

An individual profiling step that can contain child steps.

Assembly: ServiceStack.NetFramework.dll
View Source
Declaration
[ExcludeMetadata]
[DataContract]
public class Timing : IDisposable

Properties

Id

Unique identifer for this timing; set during construction.

View Source
Declaration
[DataMember(Order = 1, Name = "Id")]
public Guid Id { get; set; }

Name

Text displayed when this Timing is rendered.

View Source
Declaration
[DataMember(Order = 2, Name = "Name")]
public string Name { get; set; }

DurationMilliseconds

How long this Timing step took in ms; includes any ServiceStack.MiniProfiler.Timing.Children Timings' durations.

View Source
Declaration
[DataMember(Order = 3, Name = "DurationMilliseconds")]
public decimal? DurationMilliseconds { get; set; }

StartMilliseconds

The offset from the start of profiling.

View Source
Declaration
[DataMember(Order = 4, Name = "StartMilliseconds")]
public decimal StartMilliseconds { get; set; }

Children

All sub-steps that occur within this Timing step. Add new children through ServiceStack.MiniProfiler.Timing.AddChild(ServiceStack.MiniProfiler.Timing)

View Source
Declaration
[DataMember(Order = 5, Name = "Children")]
public List<Timing> Children { get; set; }

KeyValues

Stores arbitrary key/value strings on this Timing step. Add new tuples through ServiceStack.MiniProfiler.Timing.AddKeyValue(System.String%2cSystem.String).

View Source
Declaration
[DataMember(Order = 6, Name = "KeyValues")]
public Dictionary<string, string> KeyValues { get; set; }

SqlTimings

Any queries that occurred during this Timing step.

View Source
Declaration
[DataMember(Order = 7, Name = "SqlTimings")]
public List<SqlTiming> SqlTimings { get; set; }

ParentTimingId

Needed for database deserialization and JSON serialization.

View Source
Declaration
[DataMember(Order = 8, Name = "ParentTimingId")]
public Guid? ParentTimingId { get; set; }

ParentTiming

Which Timing this Timing is under - the duration that this step takes will be added to its parent's duration.

View Source
Declaration
public Timing ParentTiming { get; set; }

DurationWithoutChildrenMilliseconds

Gets the elapsed milliseconds in this step without any children's durations.

View Source
Declaration
[DataMember(Name = "DurationWithoutChildrenMilliseconds")]
public decimal DurationWithoutChildrenMilliseconds { get; }

SqlTimingsDurationMilliseconds

Gets the aggregate elapsed milliseconds of all SqlTimings executed in this Timing, excluding Children Timings.

View Source
Declaration
[DataMember(Name = "SqlTimingsDurationMilliseconds")]
public decimal SqlTimingsDurationMilliseconds { get; }

IsTrivial

Returns true when this ServiceStack.MiniProfiler.Timing.DurationWithoutChildrenMilliseconds is less than the configured ServiceStack.MiniProfiler.MiniProfiler.Settings.TrivialDurationThresholdMilliseconds, by default 2.0 ms.

View Source
Declaration
[DataMember(Name = "IsTrivial")]
public bool IsTrivial { get; }

HasChildren

Returns true when this Timing has inner Timing steps.

View Source
Declaration
[DataMember(Name = "HasChildren")]
public bool HasChildren { get; }

HasSqlTimings

Returns true if this Timing step collected sql execution timings.

View Source
Declaration
[DataMember(Name = "HasSqlTimings")]
public bool HasSqlTimings { get; }

HasDuplicateSqlTimings

Returns true if any ServiceStack.MiniProfiler.SqlTimings executed in this step are detected as duplicate statements.

View Source
Declaration
[DataMember(Name = "HasDuplicateSqlTimings")]
public bool HasDuplicateSqlTimings { get; }

IsRoot

Returns true when this Timing is the first one created in a MiniProfiler session.

View Source
Declaration
[DataMember(Name = "IsRoot")]
public bool IsRoot { get; }

Depth

How far away this Timing is from the Profiler's Root.

View Source
Declaration
[DataMember(Name = "Depth")]
public short Depth { get; }

ExecutedReaders

How many sql data readers were executed in this Timing step. Does not include queries in any child Timings.

View Source
Declaration
[DataMember(Name = "ExecutedReaders")]
public int ExecutedReaders { get; }

ExecutedScalars

How many sql scalar queries were executed in this Timing step. Does not include queries in any child Timings.

View Source
Declaration
[DataMember(Name = "ExecutedScalars")]
public int ExecutedScalars { get; }

ExecutedNonQueries

How many sql non-query statements were executed in this Timing step. Does not include queries in any child Timings.

View Source
Declaration
[DataMember(Name = "ExecutedNonQueries")]
public int ExecutedNonQueries { get; }

Methods

RebuildParentTimings()

Rebuilds all the parent timings on deserialization calls

View Source
Declaration
public void RebuildParentTimings()

ToString()

Returns this Timing's Name.

View Source
Declaration
public override string ToString()
Returns

System.String

Equals(Object)

Returns true if Ids match.

View Source
Declaration
public override bool Equals(object obj)
Returns

System.Boolean

Parameters
TypeName
System.Objectobj

GetHashCode()

Returns hashcode of Id.

View Source
Declaration
public override int GetHashCode()
Returns

System.Int32

AddKeyValue(String, String)

Adds arbitrary string 'value' under 'key', allowing custom properties to be stored in this Timing step.

View Source
Declaration
public void AddKeyValue(string key, string value)
Parameters
TypeName
System.Stringkey
System.Stringvalue

Stop()

Completes this Timing's duration and sets the MiniProfiler's Head up one level.

View Source
Declaration
public void Stop()

IDisposable.Dispose()

View Source
Declaration
void IDisposable.Dispose()

AddChild(Timing)

Add the parameter 'timing' to this Timing's Children collection.

Used outside this assembly for custom deserialization when creating an IStorage implementation.

View Source
Declaration
public void AddChild(Timing timing)
Parameters
TypeName
ServiceStack.MiniProfiler.Timingtiming

AddSqlTiming(SqlTiming)

Adds the parameter 'sqlTiming' to this Timing's SqlTimings collection.

Used outside this assembly for custom deserialization when creating an IStorage implementation.

View Source
Declaration
public void AddSqlTiming(SqlTiming sqlTiming)
Parameters
TypeNameDescription
ServiceStack.MiniProfiler.SqlTimingsqlTimingA sql statement profiling that was executed in this Timing step.

Used outside this assembly for custom deserialization when creating an IStorage implementation.

|

Implements

  • System.IDisposable