summaryrefslogtreecommitdiff
path: root/lib/gitlab/performance_bar/with_top_level_warnings.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/performance_bar/with_top_level_warnings.rb')
-rw-r--r--lib/gitlab/performance_bar/with_top_level_warnings.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/gitlab/performance_bar/with_top_level_warnings.rb b/lib/gitlab/performance_bar/with_top_level_warnings.rb
new file mode 100644
index 00000000000..fb5c5c5959d
--- /dev/null
+++ b/lib/gitlab/performance_bar/with_top_level_warnings.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module PerformanceBar
+ module WithTopLevelWarnings
+ def results
+ results = super
+
+ results.merge(has_warnings: has_warnings?(results))
+ end
+
+ def has_warnings?(results)
+ results[:data].any? do |_, value|
+ value[:warnings].present?
+ end
+ end
+ end
+ end
+end