2011年2月16日水曜日

innotopを使う

どうも、オレ@仕事中です。

オデの日記::mytopを使うに続きまして、innotopの利用です。

今回参考にさせてもらったサイトはThe Programmer’s Guide to the Parallel World::MySQL: innotopとサンプリングです。ありがとうございます。

まずinnotop(source forge)から本体をDLします。
# wget 'http://downloads.sourceforge.net/project/innotop/innotop/1.6.0/innotop-1.6.0.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Finnotop%2F&ts=1297835567&use_mirror=jaist'
解凍し、インストールします。
# unzip innotop-1.6.0.zip
 # cd innotop-1.6.0
 # perl Makefile.PL
 # make install
ちなみに、僕の環境ではここでまたperlモジュールのエラーが出ました。
なのでまたもやcpan利用します。
# cpan install Time::HiRes
 # make install
これでOK。

初回実行時に色々設定を質問されます。
# innotop
You have not defined any database connections.
Choose a name for the connection.  It cannot contain whitespace, colons or semicolons.

Enter a name:  ここは何でもOK
----------------------------------------------------------------------
Typical DSN strings look like
   DBI:mysql:;host=hostname;port=port
The db and port are optional and can usually be omitted.
If you specify 'mysql_read_default_group=mysql' many options can be read
from your mysql options files (~/.my.cnf, /etc/my.cnf).

Enter a DSN string:  DBI:mysql:database=DatabaseName;host=hostname;port=portのような形で入力
何も指定しない場合はDBI:mysql:;; かな
失敗したらユーザのホームディレクトリに~/.innotop/というディレクトリがあるので
丸ごと削除で再度設定できる&~/.innotop/innotop.iniを書き換える事で修正可能です。

# innotop -d 秒間
のようにして利用できます。
mytopよりinnotopの方が見やすいと思いました。

以上でぇぇぇえぇす。

0 件のコメント: