Skip to content

Commit 7a7f7b9

Browse files
committed
Added microtime as key to profiler items
1 parent 0bea685 commit 7a7f7b9

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"g4/code-coverage" : "1.*"
4040
},
4141
"require": {
42+
"php" : ">=5.6",
4243
"ext-curl" : "*",
4344
"ext-json" : "*",
4445
"g4/factory" : "1.*",

src/Profiler/Mysql/Ticker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ public function getQueries()
6363
{
6464
if ($this->getDbProfiler()->getTotalNumQueries() && $this->getDbProfiler()->getQueryProfiles()) {
6565
foreach ($this->getDbProfiler()->getQueryProfiles() as $queryProfile) {
66-
$queries[] = [
66+
$queries[(string) $queryProfile->getStartedMicrotime()] = [
6767
'elapsed_time' =>
6868
$this->getDataFormatterInstance()->getFormattedTime($queryProfile->getElapsedSecs()),
69-
'query' => $queryProfile->getQuery()
69+
'query' => $queryProfile->getQuery()
7070
];
7171
}
7272
}

src/Profiler/Ticker/ProfilerTickerMysql.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ public function getQueries()
6565
{
6666
if ($this->getDbProfiler()->getTotalNumQueries() && $this->getDbProfiler()->getQueryProfiles()) {
6767
foreach ($this->getDbProfiler()->getQueryProfiles() as $queryProfile) {
68-
$queries[] = [
68+
$queries[(string) $queryProfile->getStartedMicrotime()] = [
6969
'elapsed_time' => $this->getDataFormatterInstance()
7070
->getFormattedTime($queryProfile->getElapsedSecs()),
71-
'query' => $queryProfile->getQuery()
71+
'query' => $queryProfile->getQuery()
7272
];
7373
}
7474
}

0 commit comments

Comments
 (0)