debian-mirror-gitlab/lib/peek/views/gitaly.rb

34 lines
697 B
Ruby
Raw Normal View History

2018-12-13 13:39:08 +05:30
# frozen_string_literal: true
2018-03-17 18:26:18 +05:30
module Peek
module Views
2019-10-12 21:52:04 +05:30
class Gitaly < DetailedView
private
2018-03-17 18:26:18 +05:30
def duration
::Gitlab::GitalyClient.query_time
end
def calls
::Gitlab::GitalyClient.get_request_count
end
2019-10-12 21:52:04 +05:30
def call_details
2018-05-09 12:01:36 +05:30
::Gitlab::GitalyClient.list_call_details
end
def format_call_details(call)
pretty_request = call[:request]&.reject { |k, v| v.blank? }.to_h.pretty_inspect
2019-10-12 21:52:04 +05:30
super.merge(request: pretty_request || {})
2018-03-17 18:26:18 +05:30
end
def setup_subscribers
subscribe 'start_processing.action_controller' do
::Gitlab::GitalyClient.query_time = 0
end
end
end
end
end