blob: d1e9a6d68ed631ae7ba633ae3c0bf28c9e1f25b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# frozen_string_literal: true
module Peek
module Views
class Zoekt < DetailedView
DEFAULT_THRESHOLDS = {
calls: 3,
duration: 500,
individual_call: 500
}.freeze
THRESHOLDS = {
production: {
calls: 5,
duration: 1000,
individual_call: 1000
}
}.freeze
def key
'zkt'
end
def self.thresholds
@thresholds ||= THRESHOLDS.fetch(Rails.env.to_sym, DEFAULT_THRESHOLDS)
end
private
def duration
::Gitlab::Instrumentation::Zoekt.query_time * 1000
end
def calls
::Gitlab::Instrumentation::Zoekt.get_request_count
end
def call_details
::Gitlab::Instrumentation::Zoekt.detail_store
end
def format_call_details(call)
super.merge(request: "#{call[:method]} #{call[:path]}?#{(call[:params] || {}).to_query}")
end
end
end
end
|