Timing
An individual profiling step that can contain child steps.
Assembly: ServiceStack.NetFramework.dll
View Source
[ExcludeMetadata]
[DataContract]
public class Timing : IDisposable
Properties
Id
Unique identifer for this timing; set during construction.
View Source
[DataMember(Order = 1, Name = "Id")]
public Guid Id { get; set; }
Name
Text displayed when this Timing is rendered.
View Source
[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
[DataMember(Order = 3, Name = "DurationMilliseconds")]
public decimal? DurationMilliseconds { get; set; }
StartMilliseconds
The offset from the start of profiling.
View Source
[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
[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
[DataMember(Order = 6, Name = "KeyValues")]
public Dictionary<string, string> KeyValues { get; set; }
SqlTimings
Any queries that occurred during this Timing step.
View Source
[DataMember(Order = 7, Name = "SqlTimings")]
public List<SqlTiming> SqlTimings { get; set; }
ParentTimingId
Needed for database deserialization and JSON serialization.
View Source
[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
public Timing ParentTiming { get; set; }
DurationWithoutChildrenMilliseconds
Gets the elapsed milliseconds in this step without any children's durations.
View Source
[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
[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
[DataMember(Name = "IsTrivial")]
public bool IsTrivial { get; }
HasChildren
Returns true when this Timing has inner Timing steps.
View Source
[DataMember(Name = "HasChildren")]
public bool HasChildren { get; }
HasSqlTimings
Returns true if this Timing step collected sql execution timings.
View Source
[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
[DataMember(Name = "HasDuplicateSqlTimings")]
public bool HasDuplicateSqlTimings { get; }
IsRoot
Returns true when this Timing is the first one created in a MiniProfiler session.
View Source
[DataMember(Name = "IsRoot")]
public bool IsRoot { get; }
Depth
How far away this Timing is from the Profiler's Root.
View Source
[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
[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
[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
[DataMember(Name = "ExecutedNonQueries")]
public int ExecutedNonQueries { get; }
Methods
RebuildParentTimings()
Rebuilds all the parent timings on deserialization calls
View Source
public void RebuildParentTimings()
ToString()
Returns this Timing's Name.
View Source
public override string ToString()
Returns
System.String
Equals(Object)
Returns true if Ids match.
View Source
public override bool Equals(object obj)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Object | obj |
GetHashCode()
Returns hashcode of Id.
View Source
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
public void AddKeyValue(string key, string value)
Parameters
Type | Name |
---|---|
System.String | key |
System.String | value |
Stop()
Completes this Timing's duration and sets the MiniProfiler's Head up one level.
View Source
public void Stop()
IDisposable.Dispose()
View Source
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
public void AddChild(Timing timing)
Parameters
Type | Name |
---|---|
ServiceStack.MiniProfiler.Timing | timing |
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
public void AddSqlTiming(SqlTiming sqlTiming)
Parameters
Type | Name | Description |
---|---|---|
ServiceStack.MiniProfiler.SqlTiming | sqlTiming | A 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