Sha256: bb944e5647f16e496a3623c449bdf9a0a8fc0ab3e057e353bf73c46a4d69160b

Contents?: true

Size: 400 Bytes

Versions: 16

Compression:

Stored size: 400 Bytes

Contents

require 'multi_json'

module Rollbar
  module Truncation
    module Mixin
      def dump(payload)
        MultiJson.dump(payload)
      end

      def truncate?(result)
        result.bytesize > MAX_PAYLOAD_SIZE
      end

      def select_frames(frames, range = 150)
        return frames unless frames.count > range * 2

        frames[0, range] + frames[-range, range]
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
rollbar-1.5.3 lib/rollbar/truncation/mixin.rb
rollbar-1.5.2 lib/rollbar/truncation/mixin.rb
rollbar-1.5.1 lib/rollbar/truncation/mixin.rb
rollbar-1.5.0 lib/rollbar/truncation/mixin.rb
rollbar-1.4.5 lib/rollbar/truncation/mixin.rb
rollbar-1.4.4 lib/rollbar/truncation/mixin.rb
rollbar-1.4.3 lib/rollbar/truncation/mixin.rb
rollbar-1.4.2 lib/rollbar/truncation/mixin.rb
rollbar-1.4.1 lib/rollbar/truncation/mixin.rb
rollbar-1.4.0 lib/rollbar/truncation/mixin.rb
rollbar-1.3.2 lib/rollbar/truncation/mixin.rb
rollbar-1.3.1 lib/rollbar/truncation/mixin.rb
rollbar-1.3.0 lib/rollbar/truncation/mixin.rb
rollbar-1.2.13 lib/rollbar/truncation/mixin.rb
rollbar-1.2.12 lib/rollbar/truncation/mixin.rb
rollbar-1.2.11 lib/rollbar/truncation/mixin.rb