summaryrefslogtreecommitdiff
path: root/app/presenters
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-06 09:06:39 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-06 09:06:39 +0000
commitcd15d0e6c32da7f69689c7cff2e90aeda33b8318 (patch)
tree8343899f0873ab05f3eadca72c5f6e0a653a12ac /app/presenters
parentdd6afb4b4785ed1889defc6d7bb8ef114dd4eb50 (diff)
downloadgitlab-ce-cd15d0e6c32da7f69689c7cff2e90aeda33b8318.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/presenters')
-rw-r--r--app/presenters/sentry_detailed_error_presenter.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/presenters/sentry_detailed_error_presenter.rb b/app/presenters/sentry_detailed_error_presenter.rb
new file mode 100644
index 00000000000..9329f987879
--- /dev/null
+++ b/app/presenters/sentry_detailed_error_presenter.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class SentryDetailedErrorPresenter < Gitlab::View::Presenter::Delegated
+ presents :error
+
+ FrequencyStruct = Struct.new(:time, :count, keyword_init: true)
+
+ def frequency
+ utc_offset = Time.zone_offset('UTC')
+
+ error.frequency.map do |f|
+ FrequencyStruct.new(time: Time.at(f[0], in: utc_offset), count: f[1])
+ end
+ end
+end