diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
commit | ee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch) | |
tree | f8479f94a28f66654c6a4f6fb99bad6b4e86a40e /lib/gitlab/metrics | |
parent | 62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff) |
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to 'lib/gitlab/metrics')
-rw-r--r-- | lib/gitlab/metrics/global_search_slis.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/metrics/system.rb | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/gitlab/metrics/global_search_slis.rb b/lib/gitlab/metrics/global_search_slis.rb index e37129fed38..3400a6c78ef 100644 --- a/lib/gitlab/metrics/global_search_slis.rb +++ b/lib/gitlab/metrics/global_search_slis.rb @@ -13,9 +13,7 @@ module Gitlab ADVANCED_CODE_TARGET_S = 13.546 def initialize_slis! - if Feature.enabled?(:global_search_custom_slis) - Gitlab::Metrics::Sli::Apdex.initialize_sli(:global_search, possible_labels) - end + Gitlab::Metrics::Sli::Apdex.initialize_sli(:global_search, possible_labels) return unless Feature.enabled?(:global_search_error_rate_sli) @@ -23,8 +21,6 @@ module Gitlab end def record_apdex(elapsed:, search_type:, search_level:, search_scope:) - return unless Feature.enabled?(:global_search_custom_slis) - Gitlab::Metrics::Sli::Apdex[:global_search].increment( labels: labels(search_type: search_type, search_level: search_level, search_scope: search_scope), success: elapsed < duration_target(search_type, search_scope) diff --git a/lib/gitlab/metrics/system.rb b/lib/gitlab/metrics/system.rb index d7eef722d6e..affadc4274c 100644 --- a/lib/gitlab/metrics/system.rb +++ b/lib/gitlab/metrics/system.rb @@ -14,11 +14,13 @@ module Gitlab PROC_SMAPS_ROLLUP_PATH = '/proc/%s/smaps_rollup' PROC_LIMITS_PATH = '/proc/self/limits' PROC_FD_GLOB = '/proc/self/fd/*' + PROC_MEM_INFO = '/proc/meminfo' PRIVATE_PAGES_PATTERN = /^(Private_Clean|Private_Dirty|Private_Hugetlb):\s+(?<value>\d+)/.freeze PSS_PATTERN = /^Pss:\s+(?<value>\d+)/.freeze RSS_PATTERN = /VmRSS:\s+(?<value>\d+)/.freeze MAX_OPEN_FILES_PATTERN = /Max open files\s*(?<value>\d+)/.freeze + MEM_TOTAL_PATTERN = /^MemTotal:\s+(?<value>\d+) (.+)/.freeze def summary proportional_mem = memory_usage_uss_pss @@ -45,6 +47,10 @@ module Gitlab .transform_values(&:kilobytes) end + def memory_total + sum_matches(PROC_MEM_INFO, memory_total: MEM_TOTAL_PATTERN)[:memory_total].kilobytes + end + def file_descriptor_count Dir.glob(PROC_FD_GLOB).length end |