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
1e5afd46
Unverified
Commit
1e5afd46
authored
Apr 15, 2020
by
彭伟
Committed by
GitHub
Apr 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix more than 99 times of elapsed time on Linux (#1433)
parent
69cbf695
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
ProfiledCommand.cs
src/StackExchange.Redis/Profiling/ProfiledCommand.cs
+13
-5
No files found.
src/StackExchange.Redis/Profiling/ProfiledCommand.cs
View file @
1e5afd46
...
@@ -8,6 +8,8 @@ namespace StackExchange.Redis.Profiling
...
@@ -8,6 +8,8 @@ namespace StackExchange.Redis.Profiling
{
{
internal
sealed
class
ProfiledCommand
:
IProfiledCommand
internal
sealed
class
ProfiledCommand
:
IProfiledCommand
{
{
private
static
readonly
double
TimestampToTicks
=
TimeSpan
.
TicksPerSecond
/
(
double
)
Stopwatch
.
Frequency
;
#
region
IProfiledCommand
Impl
#
region
IProfiledCommand
Impl
public
EndPoint
EndPoint
=>
Server
.
EndPoint
;
public
EndPoint
EndPoint
=>
Server
.
EndPoint
;
...
@@ -19,15 +21,21 @@ internal sealed class ProfiledCommand : IProfiledCommand
...
@@ -19,15 +21,21 @@ internal sealed class ProfiledCommand : IProfiledCommand
public
DateTime
CommandCreated
=>
MessageCreatedDateTime
;
public
DateTime
CommandCreated
=>
MessageCreatedDateTime
;
public
TimeSpan
CreationToEnqueued
=>
TimeSpan
.
FromTicks
(
EnqueuedTimeStamp
-
MessageCreatedTimeStamp
);
public
TimeSpan
CreationToEnqueued
=>
GetElapsedTime
(
EnqueuedTimeStamp
-
MessageCreatedTimeStamp
);
public
TimeSpan
EnqueuedToSending
=>
GetElapsedTime
(
RequestSentTimeStamp
-
EnqueuedTimeStamp
);
public
TimeSpan
EnqueuedToSending
=>
TimeSpan
.
FromTicks
(
RequestSentTimeStamp
-
Enqueued
TimeStamp
);
public
TimeSpan
SentToResponse
=>
GetElapsedTime
(
ResponseReceivedTimeStamp
-
RequestSent
TimeStamp
);
public
TimeSpan
SentToResponse
=>
TimeSpan
.
FromTicks
(
ResponseReceivedTimeStamp
-
RequestSent
TimeStamp
);
public
TimeSpan
ResponseToCompletion
=>
GetElapsedTime
(
CompletedTimeStamp
-
ResponseReceived
TimeStamp
);
public
TimeSpan
ResponseToCompletion
=>
TimeSpan
.
FromTicks
(
CompletedTimeStamp
-
ResponseReceiv
edTimeStamp
);
public
TimeSpan
ElapsedTime
=>
GetElapsedTime
(
CompletedTimeStamp
-
MessageCreat
edTimeStamp
);
public
TimeSpan
ElapsedTime
=>
TimeSpan
.
FromTicks
(
CompletedTimeStamp
-
MessageCreatedTimeStamp
);
[
MethodImpl
(
MethodImplOptions
.
AggressiveInlining
)]
private
static
TimeSpan
GetElapsedTime
(
long
timestampDelta
)
{
return
new
TimeSpan
((
long
)(
TimestampToTicks
*
timestampDelta
));
}
public
IProfiledCommand
RetransmissionOf
=>
OriginalProfiling
;
public
IProfiledCommand
RetransmissionOf
=>
OriginalProfiling
;
...
...
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