ISUCONã§ãã¶ã使ãã§ãããèªåã®ä½æ¥ã¡ã¢ã§ãã
ãµã³ãã«ã¢ããªã¨ã㦠sugamasao/Shiori · GitHub ã使ã£ã¦ã¿ããã
æ°ã«ãªã£ã人ã¯ãã®æ¬ãè²·ã£ã¦ã!!!!1
- ä½è : åç°è£ä»,ç³ç°çµ¢ä¸(uzulla),ããããã¾ãã®ã,æè¤ç¥ä¸é
- åºç社/ã¡ã¼ã«ã¼: æè¡è©è«ç¤¾
- çºå£²æ¥: 2014/03/11
- ã¡ãã£ã¢: 大åæ¬
- ãã®ååãå«ãããã° (5件) ãè¦ã
ããã§ã¯å®éã®ä½æ¥ããã¦ãããã
% git clone [email protected]:sugamasao/Shiori.git
ãã£ã¬ã¯ããªã移åãã
% cd Shiori
Gemfileã« rack-lineprof ãå ¥ããã
group :development do
+ gem 'rack-lineprof'
gem 'pry'
end
bundle installããã
% bundle install --without production
SQLite3ã«ã¹ãã¼ããä½ã
% cd db % sqlite3 sqlite.db < schema.sqlite3.sql
ä¸ä½ãã£ã¬ã¯ããªã«ç§»åãã¦bundle exec rackup
ããã
ããã§é常ã®åãã確èªã§ããã
次ã«ãrack-lineprofãå°å ¥ããã
+require 'rack-lineprof' require 'rack/protection' require './app/shiori' +use Rack::Lineprof
ãã㧠http://localhost:9292/?lineprof=shiori.rb
ã«ã¢ã¯ã»ã¹ããã¨ãã¿ã¼ããã«ã«ä»¥ä¸ã®ããã«åºåãããã
app/shiori.rb | 29 | 30 get '/' do 0.4ms 3 | 31 @bookmarks = Bookmark.order('id DESC').page(params[:page]) 5.4ms 1 | 32 erb :index | 33 end | 34 127.0.0.1 - - [28/Sep/2014 00:21:17] "GET /?lineprof=shiori.rb HTTP/1.1" 200 1079 0.0089
ãªãããã©ã¡ã¼ã¿ã§ shiori.rb ã¨æå®ãã¦ããããapp/shiori.rb ã¨ãã¦ã大ä¸å¤«ããªã®ã§ãè¤æ°ã§åãååã®ãã¡ã¤ã«åããã£ããããå ´åã¯ãã£ã¬ã¯ããªåãå«ãããã¹ãæå®ããã°è¯ãããã åãããã«ããã©ã¡ã¼ã¿é¨åãindex.erbã«ããã¨ä»¥ä¸ã®ããã«ãviewãã¡ã¤ã«ã®ãããã¡ã¤ã«ãåãã
[Rack::Lineprof] =============================================================== app/views/index.erb | 1 <h1>ç»é²ããURLä¸è¦§</h1> 1.0ms 3 | 2 <%= will_paginate @bookmarks %> | 3 <div> | 4 <a href='/new'>æ°è¦ç»é²</a> ....... | 13 </thead> | 14 <tbody> 1.1ms 4 | 15 <% @bookmarks.each do |bookmark| %> | 16 <tr> | 17 <td><%= h bookmark.id %></td> 127.0.0.1 - - [28/Sep/2014 00:21:26] "GET /?lineprof=index.erb HTTP/1.1" 200 1079 0.0084
ã¡ãªã¿ã«ãããã¯rack-lineprofã®åé¡ã§ã¯ãªãããã©ãunicornãã¤ã³ã¹ãã¼ã«ããéã«å©ç¨ããã wsylvest/kgio · GitHub ã2.2.0-preview1ã§ãã«ãã§ã¨ã©ã¼ã«ãªã£ã¦ãã¾ãâ¦â¦ã
Gem::Ext::BuildError: ERROR: Failed to build gem native extension. /Users/sugamasao/.rbenv/versions/2.2.0-preview1/bin/ruby -r ./siteconf20140928-35901-blyemq.rb extconf.rb checking for CLOCK_MONOTONIC in time.h... no checking for CLOCK_MONOTONIC() in time.h... no checking for clockid_t in time.h... no checking for clock_gettime() in -lrt... no checking for t_open() in -lnsl... no checking for socket() in -lsocket... no checking for poll() in poll.h... yes checking for getaddrinfo() in sys/types.h,sys/socket.h,netdb.h... yes checking for getnameinfo() in sys/types.h,sys/socket.h,netdb.h... yes checking for struct sockaddr_storage in sys/types.h,sys/socket.h... yes checking for accept4() in sys/socket.h... no checking for sys/select.h... yes checking for writev() in sys/uio.h... yes checking for ruby/io.h... yes checking for rb_io_t.fd in ruby.h,ruby/io.h... yes checking for rb_io_t.mode in ruby.h,ruby/io.h... yes checking for rb_io_t.pathv in ruby.h,ruby/io.h... yes checking for struct RFile in ruby.h,ruby/io.h... yes checking size of struct RFile in ruby.h,ruby/io.h... 24 checking for struct RObject... yes checking size of struct RObject... 40 checking size of int... 4 checking for rb_io_ascii8bit_binmode()... yes checking for rb_update_max_fd()... yes checking for rb_fd_fix_cloexec()... yes checking for rb_cloexec_open()... yes checking for rb_thread_blocking_region()... no checking for rb_thread_io_blocking_region()... yes checking for rb_str_set_len()... yes checking for rb_time_interval()... yes checking for rb_wait_for_single_fd()... yes checking for rb_str_subseq()... yes checking for rb_ary_subseq()... yes creating Makefile make "DESTDIR=" clean make "DESTDIR=" compiling accept.c In file included from accept.c:90: /Users/sugamasao/.rbenv/versions/2.2.0-preview1/include/ruby-2.2.0/ruby/backward/rubysig.h:14:2: warning: rubysig.h is obsolete [-W#warnings] #warning rubysig.h is obsolete ^ accept.c:101:2: error: use of undeclared identifier 'TRAP_BEG' TRAP_BEG; ^ accept.c:103:2: error: use of undeclared identifier 'TRAP_END' TRAP_END; ^ 1 warning and 2 errors generated. make: *** [accept.o] Error 1 make failed, exit code 2 Gem files will remain installed in /Users/sugamasao/.rbenv/versions/2.2.0-preview1/lib/ruby/gems/2.2.0/gems/kgio-2.8.1 for inspection. Results logged to /Users/sugamasao/.rbenv/versions/2.2.0-preview1/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-13/2.2.0-static/kgio-2.8.1/gem_make.out An error occurred while installing kgio (2.8.1), and Bundler cannot continue. Make sure that `gem install kgio -v '2.8.1'` succeeds before bundling.
åºæ¬çã«ã¯ä»¥ä¸ã®ããã°ããªããã ãã§å¤§ä¸å¤«ã§ããããããã¨ããããã¾ããã