Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix profiling script

  • Loading branch information...
commit 0ef329e80d6ef59201cc115020eb46cd0c8146ee 1 parent 4171f6b
@jonasschneider authored
Showing with 11 additions and 7 deletions.
  1. +11 −7 perf/profile.rb
View
18 perf/profile.rb
@@ -4,6 +4,7 @@
require File.expand_path("../../spec/support/blocking_spdy_client", __FILE__)
require "momentum"
require "em-synchrony"
+Momentum.logger.level = Logger::WARN
app = lambda { |env| [200, {"Content-Type" => "text/plain"}, ['text']] }
@@ -11,13 +12,16 @@
Momentum.start(Momentum::Backend.new(app))
c = BlockingSPDYClient.new('localhost', 5555)
- res = RubyProf.profile do
- c.request '/'
- 3.times do
- c.read_packet
- end
- end
+ RubyProf.start
+ c.request '/'
+ c.read_packet
+ c.read_packet
+ c.read_packet
+ c.close
+ res = RubyProf.stop
printer = RubyProf::GraphHtmlPrinter.new(res)
printer.print(File.open(File.expand_path("../profile.html", __FILE__), 'w'), {})
-end
+ EM.stop
+end
+puts "Profile written to perf/profile.html."
Please sign in to comment.
Something went wrong with that request. Please try again.