Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/peek/views/redis_detailed.rb')
-rw-r--r--lib/peek/views/redis_detailed.rb23
1 files changed, 2 insertions, 21 deletions
diff --git a/lib/peek/views/redis_detailed.rb b/lib/peek/views/redis_detailed.rb
index 12760c9b75e..c61a1e91282 100644
--- a/lib/peek/views/redis_detailed.rb
+++ b/lib/peek/views/redis_detailed.rb
@@ -35,36 +35,19 @@ end
module Peek
module Views
- class RedisDetailed < View
+ class RedisDetailed < DetailedView
REDACTED_MARKER = "<redacted>"
def key
'redis'
end
- def results
- {
- calls: calls,
- duration: formatted_duration,
- details: details
- }
- end
-
def detail_store
::Gitlab::SafeRequestStore['redis_call_details'] ||= []
end
private
- def formatted_duration
- ms = duration * 1000
- if ms >= 1000
- "%.2fms" % ms
- else
- "%.0fms" % ms
- end
- end
-
def duration
detail_store.map { |entry| entry[:duration] }.sum # rubocop:disable CodeReuse/ActiveRecord
end
@@ -73,10 +56,8 @@ module Peek
detail_store.count
end
- def details
+ def call_details
detail_store
- .sort { |a, b| b[:duration] <=> a[:duration] }
- .map(&method(:format_call_details))
end
def format_call_details(call)