Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
StackExchange.Redis
Commits
cf238f30
Commit
cf238f30
authored
Oct 14, 2019
by
Nick Craver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Accurate timespan if the stopwatch is high resolution (#1230)"
This reverts commit
a683d9c8
.
parent
5914a91f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
26 deletions
+5
-26
ProfiledCommand.cs
src/StackExchange.Redis/Profiling/ProfiledCommand.cs
+5
-5
TimeSpanHelper.cs
src/StackExchange.Redis/Profiling/TimeSpanHelper.cs
+0
-21
No files found.
src/StackExchange.Redis/Profiling/ProfiledCommand.cs
View file @
cf238f30
...
...
@@ -19,15 +19,15 @@ internal sealed class ProfiledCommand : IProfiledCommand
public
DateTime
CommandCreated
=>
MessageCreatedDateTime
;
public
TimeSpan
CreationToEnqueued
=>
TimeSpan
Helper
.
FromStopwatch
Ticks
(
EnqueuedTimeStamp
-
MessageCreatedTimeStamp
);
public
TimeSpan
CreationToEnqueued
=>
TimeSpan
.
From
Ticks
(
EnqueuedTimeStamp
-
MessageCreatedTimeStamp
);
public
TimeSpan
EnqueuedToSending
=>
TimeSpan
Helper
.
FromStopwatch
Ticks
(
RequestSentTimeStamp
-
EnqueuedTimeStamp
);
public
TimeSpan
EnqueuedToSending
=>
TimeSpan
.
From
Ticks
(
RequestSentTimeStamp
-
EnqueuedTimeStamp
);
public
TimeSpan
SentToResponse
=>
TimeSpan
Helper
.
FromStopwatch
Ticks
(
ResponseReceivedTimeStamp
-
RequestSentTimeStamp
);
public
TimeSpan
SentToResponse
=>
TimeSpan
.
From
Ticks
(
ResponseReceivedTimeStamp
-
RequestSentTimeStamp
);
public
TimeSpan
ResponseToCompletion
=>
TimeSpan
Helper
.
FromStopwatch
Ticks
(
CompletedTimeStamp
-
ResponseReceivedTimeStamp
);
public
TimeSpan
ResponseToCompletion
=>
TimeSpan
.
From
Ticks
(
CompletedTimeStamp
-
ResponseReceivedTimeStamp
);
public
TimeSpan
ElapsedTime
=>
TimeSpan
Helper
.
FromStopwatch
Ticks
(
CompletedTimeStamp
-
MessageCreatedTimeStamp
);
public
TimeSpan
ElapsedTime
=>
TimeSpan
.
From
Ticks
(
CompletedTimeStamp
-
MessageCreatedTimeStamp
);
public
IProfiledCommand
RetransmissionOf
=>
OriginalProfiling
;
...
...
src/StackExchange.Redis/Profiling/TimeSpanHelper.cs
deleted
100644 → 0
View file @
5914a91f
using
System
;
using
System.Diagnostics
;
namespace
StackExchange.Redis.Profiling
{
/// <summary>
/// A helper class for dealing with Low/High Resolution Stopwatches and their ticks
/// </summary>
internal
static
class
TimeSpanHelper
{
/// <summary>
/// Used to construct a timespan from ticks obtained using Stopwatch.GetTimestamp()
/// </summary>
/// <param name="ticks"></param>
/// <returns>A TimeSpan constructed from the ticks</returns>
internal
static
TimeSpan
FromStopwatchTicks
(
long
ticks
)
{
return
Stopwatch
.
IsHighResolution
?
TimeSpan
.
FromMilliseconds
(
ticks
/
((
double
)
Stopwatch
.
Frequency
/
1000
))
:
TimeSpan
.
FromTicks
(
ticks
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment