Sha256: b80a2effad4eb18f03bb800c1f4c73d450cdd8974b87171e766c20eb0cb2f9b2
Contents?: true
Size: 1.02 KB
Versions: 3
Compression:
Stored size: 1.02 KB
Contents
module Pilfer class Profile include Enumerable attr_accessor :data, :start def initialize(data, start) @data = data @start = start end def each(&block) files.each(&block) end def files data.each_with_object({}) do |(file, lines), files| profile_lines = lines[1..-1]. each_with_index. each_with_object({}) do |(data, number), lines| next unless data.any? {|datum| datum > 0 } wall_time, cpu_time, calls = data lines[number] = { 'wall_time' => wall_time, 'cpu_time' => cpu_time, 'calls' => calls } end total_wall, child_wall, exclusive_wall, total_cpu, child_cpu, exclusive_cpu = lines[0] wall = total_wall cpu = total_cpu files[file] = { 'wall_time' => wall, 'cpu_time' => cpu, 'lines' => profile_lines } end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
pilfer-0.0.1.pre3 | lib/pilfer/profile.rb |
pilfer-0.0.1.pre2 | lib/pilfer/profile.rb |
pilfer-0.0.1.pre | lib/pilfer/profile.rb |