Skip to content
This repository has been archived by the owner on Dec 25, 2020. It is now read-only.

Profiler

Kerem Güneş edited this page Jan 5, 2017 · 5 revisions

Profiler tracks all processes for each query and profile them.

// get profiler
$profiler = $agent->getProfiler();

// last query
print $profiler->getLastQuery();
print $profiler->getLastQueryString();

// query count on one process
print $profiler->getQueryCount();

// connection process time
print_r($profiler->getProfile($profiler::CONNECTION));
Array
(
    [start] => 1426188283.9543
    [stop]  => 1426188283.955
    [total] => 0.0007150173
)

// last query pprocess time
print_r($profiler->getProfile($profiler::QUERY));
Array
(
    [0] => Array
        (
            [start] => 1426188283.9571
            [stop]  => 1426188283.9575
            [total] => 0.0004620552
        )
)

// get all profiles
$profiler->getProfiles();

// reset all data on profiler
$profiler->reset();
Clone this wiki locally