debian-mirror-gitlab/app/presenters/sentry_detailed_error_presenter.rb

16 lines
372 B
Ruby
Raw Normal View History

2020-01-01 13:55:28 +05:30
# 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