Class: Gitlab::Instrumentation::GlobalSearchApi
- Inherits:
-
Object
- Object
- Gitlab::Instrumentation::GlobalSearchApi
- Defined in:
- lib/gitlab/instrumentation/global_search_api.rb
Constant Summary collapse
- TYPE =
'meta.search.type'
- LEVEL =
'meta.search.level'
- SCOPE =
'meta.search.scope'
- SEARCH_DURATION_S =
:global_search_duration_s
Class Method Summary collapse
- .get_level ⇒ Object
- .get_scope ⇒ Object
- .get_search_duration_s ⇒ Object
- .get_type ⇒ Object
- .payload ⇒ Object
- .set_information(type:, level:, scope:, search_duration_s:) ⇒ Object
Class Method Details
.get_level ⇒ Object
15 16 17 |
# File 'lib/gitlab/instrumentation/global_search_api.rb', line 15 def self.get_level ::Gitlab::SafeRequestStore[LEVEL] end |
.get_scope ⇒ Object
19 20 21 |
# File 'lib/gitlab/instrumentation/global_search_api.rb', line 19 def self.get_scope ::Gitlab::SafeRequestStore[SCOPE] end |
.get_search_duration_s ⇒ Object
23 24 25 |
# File 'lib/gitlab/instrumentation/global_search_api.rb', line 23 def self.get_search_duration_s ::Gitlab::SafeRequestStore[SEARCH_DURATION_S] end |
.get_type ⇒ Object
11 12 13 |
# File 'lib/gitlab/instrumentation/global_search_api.rb', line 11 def self.get_type ::Gitlab::SafeRequestStore[TYPE] end |
.payload ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/gitlab/instrumentation/global_search_api.rb', line 27 def self.payload { TYPE => get_type, LEVEL => get_level, SCOPE => get_scope, SEARCH_DURATION_S => get_search_duration_s }.compact end |
.set_information(type:, level:, scope:, search_duration_s:) ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/gitlab/instrumentation/global_search_api.rb', line 36 def self.set_information(type:, level:, scope:, search_duration_s:) if ::Gitlab::SafeRequestStore.active? ::Gitlab::SafeRequestStore[TYPE] = type ::Gitlab::SafeRequestStore[LEVEL] = level ::Gitlab::SafeRequestStore[SCOPE] = scope ::Gitlab::SafeRequestStore[SEARCH_DURATION_S] = search_duration_s end end |