diff options
Diffstat (limited to 'app/presenters')
-rw-r--r-- | app/presenters/sentry_detailed_error_presenter.rb | 15 |
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 |