Skip to content

Commit 012580e

Browse files
authored
Merge pull request #58 from ppavlovic/master
Added microtime as key to profiler items, g4/profiler >=1.11.0
2 parents 0bea685 + f6220a1 commit 012580e

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@
3939
"g4/code-coverage" : "1.*"
4040
},
4141
"require": {
42+
"php" : ">=5.6",
4243
"ext-curl" : "*",
4344
"ext-json" : "*",
4445
"g4/factory" : "1.*",
45-
"g4/profiler" : ">=1.10.0",
46+
"g4/profiler" : ">=1.11.0",
4647
"g4/value-object" : "*",
4748
"zf1/zend-db" : "1.12.*"
4849
},

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)