Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f48f1396
Commit
f48f1396
authored
Apr 05, 2021
by
Quang-Minh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add start time to Gitaly items in the performance bar
Issue
https://gitlab.com/groups/gitlab-org/-/epics/5590
parent
c9b65766
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
9 deletions
+18
-9
lib/gitlab/gitaly_client/call.rb
lib/gitlab/gitaly_client/call.rb
+10
-4
spec/lib/gitlab/gitaly_client/call_spec.rb
spec/lib/gitlab/gitaly_client/call_spec.rb
+8
-5
No files found.
lib/gitlab/gitaly_client/call.rb
View file @
f48f1396
...
...
@@ -50,11 +50,11 @@ module Gitlab
end
def
recording_request
start
=
Gitlab
::
Metrics
::
System
.
monotonic_time
@
start
=
Gitlab
::
Metrics
::
System
.
monotonic_time
yield
ensure
@duration
+=
Gitlab
::
Metrics
::
System
.
monotonic_time
-
start
@duration
+=
Gitlab
::
Metrics
::
System
.
monotonic_time
-
@
start
end
def
store_timings
...
...
@@ -64,8 +64,14 @@ module Gitlab
request_hash
=
@request
.
is_a?
(
Google
::
Protobuf
::
MessageExts
)
?
@request
.
to_h
:
{}
GitalyClient
.
add_call_details
(
feature:
"
#{
@service
}
#
#{
@rpc
}
"
,
duration:
@duration
,
request:
request_hash
,
rpc:
@rpc
,
backtrace:
Gitlab
::
BacktraceCleaner
.
clean_backtrace
(
caller
))
GitalyClient
.
add_call_details
(
start:
@start
,
feature:
"
#{
@service
}
#
#{
@rpc
}
"
,
duration:
@duration
,
request:
request_hash
,
rpc:
@rpc
,
backtrace:
Gitlab
::
BacktraceCleaner
.
clean_backtrace
(
caller
)
)
end
end
end
...
...
spec/lib/gitlab/gitaly_client/call_spec.rb
View file @
f48f1396
...
...
@@ -24,11 +24,14 @@ RSpec.describe Gitlab::GitalyClient::Call do
def
expect_call_details_to_match
(
duration_higher_than:
0
)
expect
(
client
.
list_call_details
.
size
).
to
eq
(
1
)
expect
(
client
.
list_call_details
.
first
)
.
to
match
a_hash_including
(
feature:
"
#{
service
}
#
#{
rpc
}
"
,
duration:
a_value
>
duration_higher_than
,
request:
an_instance_of
(
Hash
),
rpc:
rpc
,
backtrace:
an_instance_of
(
Array
))
.
to
match
a_hash_including
(
start:
a_value
>
0
,
feature:
"
#{
service
}
#
#{
rpc
}
"
,
duration:
a_value
>
duration_higher_than
,
request:
an_instance_of
(
Hash
),
rpc:
rpc
,
backtrace:
an_instance_of
(
Array
)
)
end
context
'when the response is not an enumerator'
do
...
...
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