downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

MongoDB::setSlaveOkay> <MongoDB::selectCollection
[edit] Last updated: Fri, 25 May 2012

view this page in

MongoDB::setProfilingLevel

(PECL mongo >=0.9.0)

MongoDB::setProfilingLevelこのデータベースのプロファイリングレベルを設定する

説明

public int MongoDB::setProfilingLevel ( int $level )

現在のデータベースのプロファイリングレベルを変更します。

この関数は、次のコードと同じ意味です。

<?php

public function setProfilingLevel($level) {
    return 
$this->command(array('profile' => $level));
}

?>

level に指定できる値は 0 (off)、1 (100ms を超えるクエリ) および 2 (すべてのクエリ) です。 別の時間を指定してそれを超える所要時間のクエリを調べるには、データベースのコマンドを使って 二番目のオプションにミリ秒数を指定します。 たとえば、所要時間が 1 秒より長いクエリをすべて調べるには次のようにします。

<?php

$result 
$this->command(array('profile' => 1'slowms' => 1000));

?>

プロファイルされたクエリは、このデータベースの system.profile コレクションに入ります。

パラメータ

level

プロファイリングレベル。

返り値

前に設定されていたプロファイリングレベルを返します。



add a note add a note User Contributed Notes MongoDB::setProfilingLevel
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites