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
e363f069
Commit
e363f069
authored
Mar 28, 2019
by
mgravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
track whether we have an active writer, which can be approximated by: is the write lock unavailable
parent
ed4c9987
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
5 deletions
+8
-5
ExceptionFactory.cs
src/StackExchange.Redis/ExceptionFactory.cs
+2
-1
PhysicalBridge.cs
src/StackExchange.Redis/PhysicalBridge.cs
+2
-1
ServerEndPoint.cs
src/StackExchange.Redis/ServerEndPoint.cs
+3
-2
StackExchange.Redis.csproj
src/StackExchange.Redis/StackExchange.Redis.csproj
+1
-1
No files found.
src/StackExchange.Redis/ExceptionFactory.cs
View file @
e363f069
...
...
@@ -229,10 +229,11 @@ void add(string lk, string sk, string v)
// Add server data, if we have it
if
(
server
!=
null
)
{
server
.
GetOutstandingCount
(
message
.
Command
,
out
int
inst
,
out
int
qs
,
out
long
@in
,
out
int
qu
,
out
long
toRead
,
out
long
toWrite
);
server
.
GetOutstandingCount
(
message
.
Command
,
out
int
inst
,
out
int
qs
,
out
long
@in
,
out
int
qu
,
out
bool
aw
,
out
long
toRead
,
out
long
toWrite
);
add
(
"OpsSinceLastHeartbeat"
,
"inst"
,
inst
.
ToString
());
add
(
"Queue-Awaiting-Write"
,
"qu"
,
qu
.
ToString
());
add
(
"Queue-Awaiting-Response"
,
"qs"
,
qs
.
ToString
());
add
(
"Active-Writer"
,
"aw"
,
aw
.
ToString
());
if
(
@in
>=
0
)
add
(
"Inbound-Bytes"
,
"in"
,
@in
.
ToString
());
if
(
toRead
>=
0
)
add
(
"Inbound-Pipe-Bytes"
,
"in-pipe"
,
toRead
.
ToString
());
...
...
src/StackExchange.Redis/PhysicalBridge.cs
View file @
e363f069
...
...
@@ -289,13 +289,14 @@ private void ShutdownSubscriptionQueue()
internal
bool
TryEnqueueBackgroundSubscriptionWrite
(
in
PendingSubscriptionState
state
)
=>
isDisposed
?
false
:
(
_subscriptionBackgroundQueue
??
GetSubscriptionQueue
()).
Writer
.
TryWrite
(
state
);
internal
void
GetOutstandingCount
(
out
int
inst
,
out
int
qs
,
out
long
@in
,
out
int
qu
,
out
long
toRead
,
out
long
toWrite
)
internal
void
GetOutstandingCount
(
out
int
inst
,
out
int
qs
,
out
long
@in
,
out
int
qu
,
out
bool
aw
,
out
long
toRead
,
out
long
toWrite
)
{
inst
=
(
int
)(
Interlocked
.
Read
(
ref
operationCount
)
-
Interlocked
.
Read
(
ref
profileLastLog
));
lock
(
_backlog
)
{
qu
=
_backlog
.
Count
;
}
aw
=
!
_singleWriterMutex
.
IsAvailable
;
var
tmp
=
physical
;
if
(
tmp
==
null
)
{
...
...
src/StackExchange.Redis/ServerEndPoint.cs
View file @
e363f069
...
...
@@ -375,17 +375,18 @@ internal ServerCounters GetCounters()
return
counters
;
}
internal
void
GetOutstandingCount
(
RedisCommand
command
,
out
int
inst
,
out
int
qs
,
out
long
@in
,
out
int
qu
,
out
long
toRead
,
out
long
toWrite
)
internal
void
GetOutstandingCount
(
RedisCommand
command
,
out
int
inst
,
out
int
qs
,
out
long
@in
,
out
int
qu
,
out
bool
aw
,
out
long
toRead
,
out
long
toWrite
)
{
var
bridge
=
GetBridge
(
command
,
false
);
if
(
bridge
==
null
)
{
inst
=
qs
=
qu
=
0
;
@in
=
toRead
=
toWrite
=
0
;
aw
=
false
;
}
else
{
bridge
.
GetOutstandingCount
(
out
inst
,
out
qs
,
out
@in
,
out
qu
,
out
toRead
,
out
toWrite
);
bridge
.
GetOutstandingCount
(
out
inst
,
out
qs
,
out
@in
,
out
qu
,
out
aw
,
out
toRead
,
out
toWrite
);
}
}
...
...
src/StackExchange.Redis/StackExchange.Redis.csproj
View file @
e363f069
...
...
@@ -15,7 +15,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Pipelines.Sockets.Unofficial" Version="2.0.
9
" />
<PackageReference Include="Pipelines.Sockets.Unofficial" Version="2.0.
10
" />
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="4.5.0" />
<PackageReference Include="System.IO.Pipelines" Version="4.5.1" />
<PackageReference Include="System.Threading.Channels" Version="4.5.0" />
...
...
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