Class: JRubyProf

Inherits:
Object
  • Object
show all
Defined in:
lib/jruby-prof.rb,
lib/jruby-prof/method.rb,
lib/jruby-prof/invocation_set.rb,
lib/jruby-prof/abstract_printer.rb,
lib/jruby-prof/flat_text_printer.rb,
lib/jruby-prof/tree_html_printer.rb,
lib/jruby-prof/graph_html_printer.rb,
lib/jruby-prof/graph_text_printer.rb,
lib/jruby-prof/profile_invocation.rb,
lib/jruby-prof/simple_tree_printer.rb

Defined Under Namespace

Classes: AbstractPrinter, FlatTextPrinter, GraphHtmlPrinter, GraphTextPrinter, Invocation, Method, SimpleTreePrinter, ThreadSet, TreeHtmlPrinter

Class Method Summary collapse

Class Method Details



42
43
44
45
# File 'lib/jruby-prof.rb', line 42

def self.print_call_tree(result, filename)
  printer = SimpleTreePrinter.new(ThreadSet.new(result.values.to_a, JRubyProf.lastTracingDuration))
  printer.print_to_file(filename)
end


52
53
54
55
# File 'lib/jruby-prof.rb', line 52

def self.print_flat_text(result, filename)
  printer = FlatTextPrinter.new(ThreadSet.new(result.values.to_a, JRubyProf.lastTracingDuration))
  printer.print_to_file(filename)
end


62
63
64
65
# File 'lib/jruby-prof.rb', line 62

def self.print_graph_html(result, filename)
  printer = GraphHtmlPrinter.new(ThreadSet.new(result.values.to_a, JRubyProf.lastTracingDuration))
  printer.print_to_file(filename)
end


57
58
59
60
# File 'lib/jruby-prof.rb', line 57

def self.print_graph_text(result, filename)
  printer = GraphTextPrinter.new(ThreadSet.new(result.values.to_a, JRubyProf.lastTracingDuration))
  printer.print_to_file(filename)
end


47
48
49
50
# File 'lib/jruby-prof.rb', line 47

def self.print_tree_html(result, filename)
  printer = TreeHtmlPrinter.new(ThreadSet.new(result.values.to_a, JRubyProf.lastTracingDuration))
  printer.print_to_file(filename)
end

.profileObject

Raises:

  • (ArgumentError)


35
36
37
38
39
40
# File 'lib/jruby-prof.rb', line 35

def self.profile
  raise ArgumentError, "profile requires a block" unless block_given?
  start
  yield
  stop
end

.running?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/jruby-prof.rb', line 31

def self.running?
  self.is_running
end

.startObject

Raises:

  • (RuntimeError)


22
23
24
25
# File 'lib/jruby-prof.rb', line 22

def self.start
  raise RuntimeError, "JRubyProf already running" if running?
  start_tracing
end

.stopObject



27
28
29
# File 'lib/jruby-prof.rb', line 27

def self.stop
  stop_tracing
end