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
ac80cb08
Commit
ac80cb08
authored
6 years ago
by
Richard van der Hoff
Browse files
Options
Downloads
Patches
Plain Diff
Fix more b'abcd' noise in metrics
parent
0cb7afff
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
synapse/http/request_metrics.py
+11
-11
11 additions, 11 deletions
synapse/http/request_metrics.py
synapse/http/site.py
+1
-1
1 addition, 1 deletion
synapse/http/site.py
with
12 additions
and
12 deletions
synapse/http/request_metrics.py
+
11
−
11
View file @
ac80cb08
...
...
@@ -162,7 +162,7 @@ class RequestMetrics(object):
with
_in_flight_requests_lock
:
_in_flight_requests
.
add
(
self
)
def
stop
(
self
,
time_sec
,
re
quest
):
def
stop
(
self
,
time_sec
,
re
sponse_code
,
sent_bytes
):
with
_in_flight_requests_lock
:
_in_flight_requests
.
discard
(
self
)
...
...
@@ -179,35 +179,35 @@ class RequestMetrics(object):
)
return
response_code
=
str
(
re
quest
.
code
)
response_code
=
str
(
re
sponse_
code
)
outgoing_responses_counter
.
labels
(
request
.
method
,
response_code
).
inc
()
outgoing_responses_counter
.
labels
(
self
.
method
,
response_code
).
inc
()
response_count
.
labels
(
request
.
method
,
self
.
name
,
tag
).
inc
()
response_count
.
labels
(
self
.
method
,
self
.
name
,
tag
).
inc
()
response_timer
.
labels
(
request
.
method
,
self
.
name
,
tag
,
response_code
).
observe
(
response_timer
.
labels
(
self
.
method
,
self
.
name
,
tag
,
response_code
).
observe
(
time_sec
-
self
.
start
)
resource_usage
=
context
.
get_resource_usage
()
response_ru_utime
.
labels
(
request
.
method
,
self
.
name
,
tag
).
inc
(
response_ru_utime
.
labels
(
self
.
method
,
self
.
name
,
tag
).
inc
(
resource_usage
.
ru_utime
,
)
response_ru_stime
.
labels
(
request
.
method
,
self
.
name
,
tag
).
inc
(
response_ru_stime
.
labels
(
self
.
method
,
self
.
name
,
tag
).
inc
(
resource_usage
.
ru_stime
,
)
response_db_txn_count
.
labels
(
request
.
method
,
self
.
name
,
tag
).
inc
(
response_db_txn_count
.
labels
(
self
.
method
,
self
.
name
,
tag
).
inc
(
resource_usage
.
db_txn_count
)
response_db_txn_duration
.
labels
(
request
.
method
,
self
.
name
,
tag
).
inc
(
response_db_txn_duration
.
labels
(
self
.
method
,
self
.
name
,
tag
).
inc
(
resource_usage
.
db_txn_duration_sec
)
response_db_sched_duration
.
labels
(
request
.
method
,
self
.
name
,
tag
).
inc
(
response_db_sched_duration
.
labels
(
self
.
method
,
self
.
name
,
tag
).
inc
(
resource_usage
.
db_sched_duration_sec
)
response_size
.
labels
(
request
.
method
,
self
.
name
,
tag
).
inc
(
request
.
sentLength
)
response_size
.
labels
(
self
.
method
,
self
.
name
,
tag
).
inc
(
sent_bytes
)
# We always call this at the end to ensure that we update the metrics
# regardless of whether a call to /metrics while the request was in
...
...
This diff is collapsed.
Click to expand it.
synapse/http/site.py
+
1
−
1
View file @
ac80cb08
...
...
@@ -288,7 +288,7 @@ class SynapseRequest(Request):
)
try
:
self
.
request_metrics
.
stop
(
self
.
finish_time
,
self
)
self
.
request_metrics
.
stop
(
self
.
finish_time
,
self
.
code
,
self
.
sentLength
)
except
Exception
as
e
:
logger
.
warn
(
"
Failed to stop metrics: %r
"
,
e
)
...
...
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