先日お伝えしたとおり、Rails 2.0がリリースされましたね。

Rails 2.0: It's done!

Rails 2.0 is finally finished after about a year in the making. This is a fantastic release that’s absolutely stuffed with great new features, loads of fixes, and an incredible amount of polish. We’ve even taken a fair bit of cruft out to make the whole package more coherent and lean.

Railsを使い始めたのが2005年の12月、ちょうどRails 1.0がリリースされた ころの事。あれからちょうど2年の歳月が流れました。 感慨深いものです。

末尾が偶数バージョンがリリースされると、すぐに奇数バージョン が跡を追うのは相変わらずですね ;-)

早速ですが、このブログシステムもRails 2.0(2.0.1)に移行しました。 1.2.5から、RC1、RC2を経て、バージョンアップをしてみましたが、 特に大きな問題は発生しなかったです。

posted by Png genki on Sat 8 Dec 2007 at 09:41

新しいscriptとして、script/performance/requestというものが 新たに加わったみたいです。

   1  h% ./script/performance/request --help
   2  USAGE: ./script/performance/request [options] [session script path]
   3      -n, --times [0000]               How many requests to process. Defaults to 100.
   4      -b, --benchmark                  Benchmark instead of profiling
   5          --open [CMD]                 Command to open profile results. Defaults to "open %s &"
   6      -h, --help                       Show this help

ふむふむ。ベンチマーク系のスクリプトのようですね。 紹介してる記事を見つけました。

New in Rails: a request profiler for profiling your app

Jeremy Kemper (aka bitsweat) committed a very useful tool into the Rails trunk not too long ago: a request profiler! It’s a human-friendly wrapper script around the ruby-prof library, a nice ruby code profiler, that lets you run multiple requests against a URI in your application and get a detailed code profile report in text and HTML.

おーなるほど。前回のRails勉強会で紹介した ruby-prof を human-friendlyにしてくれるツールですか。これは面白そうですね。

試してみようと思って触ってみたら、上のサイトで紹介されてる ものと、Rails 2.0で入ったものは若干インターフェイスが違う模様。

DHHが書いてる こっちの情報 が最新のようです(以下に抜粋)

Action Pack: New request profiler

Figuring out where your bottlenecks are with real usage can be tough, but we just made it a whole lot easier with the new request profiler that can follow an entire usage script and report on the aggregate findings. You use it like this:

$ cat login_session.rb
get_with_redirect '/'
say "GET / => #{path}" 
post_with_redirect '/sessions', :username => 'john', :password => 'doe'
say "POST /sessions => #{path}" 
$ ./script/performance/request -n 10 login_session.rb

And you get a thorough breakdown in HTML and text on where time was spent and you’ll have a good idea on where to look for speeding up the application.

なにやらIntegrationTestのコードのようなものを記述したスクリプト を用意して、そのpathを渡せば良いみたいです。

posted by Png genki on Sat 8 Dec 2007 at 09:39

基本はstableで使いつつ、ちょっと使ってみたい新しい パッケージがある場合だけ、unstableから持ってくるような使い方を する場合のaptの設定メモ。

まずはsources.listにunstableを追加。

/etc/apt/sources.list

   1  deb http://cdn.debian.or.jp/debian/ etch main contrib non-free
   2  deb-src http://cdn.debian.or.jp/debian/ etch main contrib non-free
   3  
   4  deb http://security.debian.org/ etch/updates main contrib
   5  deb-src http://security.debian.org/ etch/updates main contrib
   6  
   7  deb http://cdn.debian.or.jp/debian/ unstable main contrib non-free
   8  deb-src http://cdn.debian.or.jp/debian/ unstable main contrib non-free

それがすんだら、優先度の設定を行います。

/etc/apt/preferences

   1  Package: *
   2  Pin: release a=stable
   3  Pin-Priority: 100
   4  
   5  Package: *
   6  Pin: release a=stable-proposed-updates
   7  Pin-Priority: 110
   8  
   9  Package: *
  10  Pin: release a=unstable
  11  Pin-Priority: 90

ついでに、キャッシュ容量の設定なども行っておきましょう。

/etc/apt/apt.conf

   1  APT::Cache-Limit "100000000";
   2  APT::Default-Release "stable";

上記の設定ファイルファイルが無い場合は、新しく作成します。

これで完了。あとはapt-get updateすればOK。 必要に応じて、-t unstable オプションを指定して unstableの パッケージを利用できます。

posted by Png genki on Sat 8 Dec 2007 at 07:30
Contents
Rails 2.0 リリース
Action Pack: New request profiler
debianで補助的にunstableパッケージを使えるようにする設定
Comments
瀧内元気: MacOS版は以下にあります * [genki/ViMouse](https://githu... '23-1
dsjf: https://gist.github.com/6bf1bf2c3cbb5eb6e7a7 これ... '13-1
瀧内元気: おお、チェックしてみます。thx! '11-12
overisland: Reeder for iPhone もこの UI を実装していますね。 '11-12
瀧内元気: その情報は見たのですが、以下のサイトによると、現在はまた必要になってるっぽいんですよね。 ... '11-12
Services from s21g
twpro(ツイプロ)
Twitterプロフィールを快適検索
地価2009
土地の値段を調べてみよう
MyRestaurant
自分だけのレストラン手帳
Formula
ブログに数式を埋め込める数式コミュニティ