Sha256: 22a28caa4e4a0374228a22b3afc3640f369ed2bd285f0a03c2ddeb5469d3f2eb

Contents?: true

Size: 749 Bytes

Versions: 1

Compression:

Stored size: 749 Bytes

Contents

module Stackprofiler
  class Run
    attr_accessor :url
    attr_accessor :profile
    attr_accessor :timestamp

    def initialize(url, profile, timestamp)
      @url = url
      @profile = profile
      @timestamp = timestamp
    end

    def stacks
      @stacks ||= begin
        off = 0
        stacks = []
        raw = @profile[:raw]
        while off < raw.length
          len = raw[off]
          these_frames = raw[off + 1..off + len]
          off += len + 2

          stacks.push these_frames
        end
        stacks
      end
    end

    def duration
      profile[:samples] * profile[:interval] / 1e6
    end
  end

  class RunDataSource
    class << self
      RUNS = []

      def runs
        RUNS
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stackprofiler-0.0.1 lib/stackprofiler/run_data_source.rb