2018-10-08 10:50:39 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-10-18 07:26:00 -04:00
|
|
|
module Peek
|
|
|
|
module Views
|
2019-07-24 10:42:45 -04:00
|
|
|
class Gitaly < DetailedView
|
|
|
|
private
|
|
|
|
|
2017-10-18 07:26:00 -04:00
|
|
|
def duration
|
|
|
|
::Gitlab::GitalyClient.query_time
|
|
|
|
end
|
|
|
|
|
|
|
|
def calls
|
|
|
|
::Gitlab::GitalyClient.get_request_count
|
|
|
|
end
|
|
|
|
|
2019-07-24 10:42:45 -04:00
|
|
|
def call_details
|
2018-03-08 07:10:59 -05:00
|
|
|
::Gitlab::GitalyClient.list_call_details
|
2018-03-06 09:02:18 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def format_call_details(call)
|
2018-03-08 07:10:59 -05:00
|
|
|
pretty_request = call[:request]&.reject { |k, v| v.blank? }.to_h.pretty_inspect
|
2018-03-06 09:02:18 -05:00
|
|
|
|
2019-07-26 09:03:00 -04:00
|
|
|
super.merge(request: pretty_request || {})
|
2018-03-06 09:02:18 -05:00
|
|
|
end
|
|
|
|
|
2017-10-18 07:26:00 -04:00
|
|
|
def setup_subscribers
|
|
|
|
subscribe 'start_processing.action_controller' do
|
|
|
|
::Gitlab::GitalyClient.query_time = 0
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|