Sha256: d431f93caba2d5b4dc595a1d937f7c2e0118c786a5e33b8c4f49743cbb3bd5d6

Contents?: true

Size: 976 Bytes

Versions: 12

Compression:

Stored size: 976 Bytes

Contents

# frozen_string_literal: true

# == Schema Information
#
# Table name: rmp_flamegraphs
#
#  id                      :integer          not null, primary key
#  rmp_profiled_request_id :bigint           not null
#  data                    :binary
#  created_at              :datetime         not null
#  updated_at              :datetime         not null
#
# Indexes
#
#  index_rmp_flamegraphs_on_rmp_profiled_request_id  (rmp_profiled_request_id)
#
module RailsMiniProfiler
  class Flamegraph < RailsMiniProfiler::ApplicationRecord
    self.table_name = RailsMiniProfiler.storage_configuration.flamegraphs_table

    belongs_to :profiled_request,
               class_name: 'RailsMiniProfiler::ProfiledRequest',
               foreign_key: :rmp_profiled_request_id

    before_save :compress

    def json_data
      @json_data = ActiveSupport::Gzip.decompress(data)
    end

    private

    def compress
      self.data = ActiveSupport::Gzip.compress(data)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rails_mini_profiler-0.7.1 app/models/rails_mini_profiler/flamegraph.rb
rails_mini_profiler-0.7.0 app/models/rails_mini_profiler/flamegraph.rb
rails_mini_profiler-0.6.0 app/models/rails_mini_profiler/flamegraph.rb
rails_mini_profiler-0.5.0 app/models/rails_mini_profiler/flamegraph.rb
rails_mini_profiler-0 app/models/rails_mini_profiler/flamegraph.rb
rails_mini_profiler-0.4.0 app/models/rails_mini_profiler/flamegraph.rb
rails_mini_profiler-0.3.0 app/models/rails_mini_profiler/flamegraph.rb
rails_mini_profiler-0.2.1 app/models/rails_mini_profiler/flamegraph.rb
rails_mini_profiler-0.2.0 app/models/rails_mini_profiler/flamegraph.rb
rails_mini_profiler-0.1.3 app/models/rails_mini_profiler/flamegraph.rb
rails_mini_profiler-0.1.2 app/models/rails_mini_profiler/flamegraph.rb
rails_mini_profiler-0.1.1 app/models/rails_mini_profiler/flamegraph.rb