class Dump
Attributes
flamegraph_json[RW]
graph_data[RW]
path[R]
Public Class Methods
new(path)
click to toggle source
# File lib/stackprof-webnav/dump.rb, line 4 def initialize(path) @path = path end
Public Instance Methods
check_checksum!()
click to toggle source
# File lib/stackprof-webnav/dump.rb, line 21 def check_checksum! return unless @checksum if Digest::SHA1.file(@path) != checksum puts "\n\nFile reloaded" @checksum, @content = nil, nil end end
checksum()
click to toggle source
# File lib/stackprof-webnav/dump.rb, line 8 def checksum @checksum ||= Digest::SHA1.file(@path) end
content()
click to toggle source
# File lib/stackprof-webnav/dump.rb, line 12 def content @content ||= File.open(@path).read end
flame_graph_path()
click to toggle source
# File lib/stackprof-webnav/dump.rb, line 30 def flame_graph_path @path + ".#{checksum}.flames.json" end
graph_image_path()
click to toggle source
# File lib/stackprof-webnav/dump.rb, line 38 def graph_image_path @path + ".#{checksum}.graph.svg" end
graph_path()
click to toggle source
# File lib/stackprof-webnav/dump.rb, line 34 def graph_path @path + ".#{checksum}.digraph.dot" end
path=(new_path)
click to toggle source
# File lib/stackprof-webnav/dump.rb, line 16 def path=(new_path) @path = new_path check_checksum! end