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
37fb348e
Commit
37fb348e
authored
Aug 13, 2018
by
Nick Craver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move Profiling.ManyThreads to FactLongRunning
parent
827fa704
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
Profiling.cs
StackExchange.Redis.Tests/Profiling.cs
+6
-4
No files found.
StackExchange.Redis.Tests/Profiling.cs
View file @
37fb348e
...
@@ -12,7 +12,7 @@ namespace StackExchange.Redis.Tests
...
@@ -12,7 +12,7 @@ namespace StackExchange.Redis.Tests
{
{
public
class
Profiling
:
TestBase
public
class
Profiling
:
TestBase
{
{
public
Profiling
(
ITestOutputHelper
output
)
:
base
(
output
)
{
}
public
Profiling
(
ITestOutputHelper
output
)
:
base
(
output
)
{
}
[
Fact
]
[
Fact
]
public
void
Simple
()
public
void
Simple
()
...
@@ -86,7 +86,7 @@ private static void AssertProfiledCommandValues(IProfiledCommand command, Connec
...
@@ -86,7 +86,7 @@ private static void AssertProfiledCommandValues(IProfiledCommand command, Connec
Assert
.
True
(
command
.
RetransmissionReason
==
null
,
nameof
(
command
.
RetransmissionReason
));
Assert
.
True
(
command
.
RetransmissionReason
==
null
,
nameof
(
command
.
RetransmissionReason
));
}
}
[
Fact
]
[
Fact
LongRunning
]
public
void
ManyThreads
()
public
void
ManyThreads
()
{
{
using
(
var
conn
=
Create
())
using
(
var
conn
=
Create
())
...
@@ -201,6 +201,7 @@ internal class PerThreadProfiler
...
@@ -201,6 +201,7 @@ internal class PerThreadProfiler
public
ProfilingSession
GetSession
()
=>
perThreadSession
.
Value
;
public
ProfilingSession
GetSession
()
=>
perThreadSession
.
Value
;
}
}
internal
class
AsyncLocalProfiler
internal
class
AsyncLocalProfiler
{
{
private
readonly
AsyncLocal
<
ProfilingSession
>
perThreadSession
=
new
AsyncLocal
<
ProfilingSession
>();
private
readonly
AsyncLocal
<
ProfilingSession
>
perThreadSession
=
new
AsyncLocal
<
ProfilingSession
>();
...
@@ -208,7 +209,7 @@ internal class AsyncLocalProfiler
...
@@ -208,7 +209,7 @@ internal class AsyncLocalProfiler
public
ProfilingSession
GetSession
()
public
ProfilingSession
GetSession
()
{
{
var
val
=
perThreadSession
.
Value
;
var
val
=
perThreadSession
.
Value
;
if
(
val
==
null
)
if
(
val
==
null
)
{
{
perThreadSession
.
Value
=
val
=
new
ProfilingSession
();
perThreadSession
.
Value
=
val
=
new
ProfilingSession
();
}
}
...
@@ -354,6 +355,7 @@ public void ProfilingMD_Ex2()
...
@@ -354,6 +355,7 @@ public void ProfilingMD_Ex2()
Assert
.
True
(
perThreadTimings
.
All
(
kv
=>
kv
.
Value
.
Count
==
1000
));
Assert
.
True
(
perThreadTimings
.
All
(
kv
=>
kv
.
Value
.
Count
==
1000
));
}
}
}
}
[
FactLongRunning
]
[
FactLongRunning
]
public
async
Task
ProfilingMD_Ex2_Async
()
public
async
Task
ProfilingMD_Ex2_Async
()
{
{
...
@@ -394,7 +396,7 @@ public async Task ProfilingMD_Ex2_Async()
...
@@ -394,7 +396,7 @@ public async Task ProfilingMD_Ex2_Async()
}
}
Assert
.
Equal
(
16
,
perThreadTimings
.
Count
);
Assert
.
Equal
(
16
,
perThreadTimings
.
Count
);
foreach
(
var
item
in
perThreadTimings
)
foreach
(
var
item
in
perThreadTimings
)
{
{
Assert
.
Equal
(
100
,
item
.
Count
);
Assert
.
Equal
(
100
,
item
.
Count
);
}
}
...
...
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