Commit e96f11f2 authored by Alex Kalderimis's avatar Alex Kalderimis

Merge branch 'jp-stats-change' into 'master'

Minor cleanup in processing performance stats

See merge request gitlab-org/gitlab!71938
parents 5032c8ec 9aca70bd
...@@ -37,9 +37,7 @@ module Gitlab ...@@ -37,9 +37,7 @@ module Gitlab
end end
def log_queries(id, data, type) def log_queries(id, data, type)
json_path = ['data', type, 'details'] queries_by_location(data, type).each do |location, queries|
queries_by_location(data, json_path).each do |location, queries|
next unless location next unless location
duration = queries.sum { |query| query['duration'].to_f } duration = queries.sum { |query| query['duration'].to_f }
...@@ -56,8 +54,8 @@ module Gitlab ...@@ -56,8 +54,8 @@ module Gitlab
end end
end end
def queries_by_location(data, path) def queries_by_location(data, type)
return [] unless queries = data.dig(*path) return [] unless queries = data.dig('data', type, 'details')
queries.group_by do |query| queries.group_by do |query|
parse_backtrace(query['backtrace']) parse_backtrace(query['backtrace'])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment