Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
99b77aa8
Unverified
Commit
99b77aa8
authored
6 years ago
by
Amber Brown
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix tcp protocol metrics naming (#3410)
parent
aff3d769
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/replication/tcp/protocol.py
+35
-18
35 additions, 18 deletions
synapse/replication/tcp/protocol.py
with
35 additions
and
18 deletions
synapse/replication/tcp/protocol.py
+
35
−
18
View file @
99b77aa8
...
...
@@ -564,11 +564,13 @@ class ClientReplicationStreamProtocol(BaseReplicationStreamProtocol):
# The following simply registers metrics for the replication connections
pending_commands
=
LaterGauge
(
"
pending_commands
"
,
""
,
[
"
name
"
,
"
conn_id
"
],
"
synapse_replication_tcp_protocol_pending_commands
"
,
""
,
[
"
name
"
,
"
conn_id
"
],
lambda
:
{
(
p
.
name
,
p
.
conn_id
):
len
(
p
.
pending_commands
)
for
p
in
connected_connections
}
)
(
p
.
name
,
p
.
conn_id
):
len
(
p
.
pending_commands
)
for
p
in
connected_connections
},
)
def
transport_buffer_size
(
protocol
):
...
...
@@ -579,11 +581,13 @@ def transport_buffer_size(protocol):
transport_send_buffer
=
LaterGauge
(
"
synapse_replication_tcp_transport_send_buffer
"
,
""
,
[
"
name
"
,
"
conn_id
"
],
"
synapse_replication_tcp_protocol_transport_send_buffer
"
,
""
,
[
"
name
"
,
"
conn_id
"
],
lambda
:
{
(
p
.
name
,
p
.
conn_id
):
transport_buffer_size
(
p
)
for
p
in
connected_connections
}
)
(
p
.
name
,
p
.
conn_id
):
transport_buffer_size
(
p
)
for
p
in
connected_connections
},
)
def
transport_kernel_read_buffer_size
(
protocol
,
read
=
True
):
...
...
@@ -602,37 +606,50 @@ def transport_kernel_read_buffer_size(protocol, read=True):
tcp_transport_kernel_send_buffer
=
LaterGauge
(
"
synapse_replication_tcp_transport_kernel_send_buffer
"
,
""
,
[
"
name
"
,
"
conn_id
"
],
"
synapse_replication_tcp_protocol_transport_kernel_send_buffer
"
,
""
,
[
"
name
"
,
"
conn_id
"
],
lambda
:
{
(
p
.
name
,
p
.
conn_id
):
transport_kernel_read_buffer_size
(
p
,
False
)
for
p
in
connected_connections
})
},
)
tcp_transport_kernel_read_buffer
=
LaterGauge
(
"
synapse_replication_tcp_transport_kernel_read_buffer
"
,
""
,
[
"
name
"
,
"
conn_id
"
],
"
synapse_replication_tcp_protocol_transport_kernel_read_buffer
"
,
""
,
[
"
name
"
,
"
conn_id
"
],
lambda
:
{
(
p
.
name
,
p
.
conn_id
):
transport_kernel_read_buffer_size
(
p
,
True
)
for
p
in
connected_connections
})
},
)
tcp_inbound_commands
=
LaterGauge
(
"
synapse_replication_tcp_inbound_commands
"
,
""
,
[
"
command
"
,
"
name
"
,
"
conn_id
"
],
"
synapse_replication_tcp_protocol_inbound_commands
"
,
""
,
[
"
command
"
,
"
name
"
,
"
conn_id
"
],
lambda
:
{
(
k
[
0
],
p
.
name
,
p
.
conn_id
):
count
for
p
in
connected_connections
for
k
,
count
in
iteritems
(
p
.
inbound_commands_counter
)
})
},
)
tcp_outbound_commands
=
LaterGauge
(
"
synapse_replication_tcp_outbound_commands
"
,
""
,
[
"
command
"
,
"
name
"
,
"
conn_id
"
],
"
synapse_replication_tcp_protocol_outbound_commands
"
,
""
,
[
"
command
"
,
"
name
"
,
"
conn_id
"
],
lambda
:
{
(
k
[
0
],
p
.
name
,
p
.
conn_id
):
count
for
p
in
connected_connections
for
k
,
count
in
iteritems
(
p
.
outbound_commands_counter
)
})
},
)
# number of updates received for each RDATA stream
inbound_rdata_count
=
Counter
(
"
synapse_replication_tcp_inbound_rdata_count
"
,
""
,
[
"
stream_name
"
])
inbound_rdata_count
=
Counter
(
"
synapse_replication_tcp_protocol_inbound_rdata_count
"
,
""
,
[
"
stream_name
"
]
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment