File: autorun.rb

package info (click to toggle)
ruby-memory-profiler 1.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 284 kB
  • sloc: ruby: 1,128; makefile: 4
file content (16 lines) | stat: -rw-r--r-- 309 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# frozen_string_literal: true

require "memory_profiler"

def deserialize_hash(data)
  Marshal.load(data.unpack1("m0")) if data
end

options = deserialize_hash(ENV["MEMORY_PROFILER_OPTIONS"]) || {}

at_exit do
  report = MemoryProfiler.stop
  report.pretty_print(**options)
end

MemoryProfiler.start(options)