2012-03-13 8 views

답변

16

나는 이것을 얻기 위해 주위를 파 내야 만했다. 여기에 내가

  1. 가 spec_helper.rb에 넣고 한 일이다 : 당신의 번호를 얻기 위해 실행을

    config.before :suite do 
        PerfTools::CpuProfiler.start("/tmp/rspec_profile") 
    end 
    
    config.after :suite do 
        PerfTools::CpuProfiler.stop 
    end 
    
  2. 당신의 RSpec에

  3. 실행 pprof를

    pprof.rb --text /tmp/rspec_profile 
    
+0

당신은 또한 할 수있다 - gif 그러나 그것은 requ Graphviz 설치를 원하십니까? pprof.rb를 실행하여 사용 가능한 모든 옵션을 얻으십시오 – katzmopolitan

+1

또한 bundler의 원래 요구 사항을 ... exec pprof.rb --text/tmp/rspec_profile을 번들로 제공해야 할 수도 있습니다 – engineerDave