Skip to content

Commit

Permalink
Merge pull request #11 from abacaphiliac/fixes-5
Browse files Browse the repository at this point in the history
fixes(#5): duration is expressed in seconds, not microseconds
  • Loading branch information
abacaphiliac authored Jan 18, 2020
2 parents f057a2d + a3fbc3c commit 386c675
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/PsrSqlLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function stopQuery()
'query_id' => $this->queryId,
'start' => $this->start,
'stop' => $stop,
'duration_μs' => $stop - $this->start,
'duration_s' => $stop - $this->start,
]);
}
}
2 changes: 1 addition & 1 deletion test/PsrSqlLoggerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function testLogsDuration()
self::assertNotEmpty($log->context->get('query_id'));
self::assertInternalType('float', $log->context->get('start'));
self::assertInternalType('float', $log->context->get('stop'));
self::assertInternalType('float', $log->context->get('duration_μs'));
self::assertInternalType('float', $log->context->get('duration_s'));
}

public function testSharedQueryId()
Expand Down
2 changes: 1 addition & 1 deletion test/PsrSqlParamsLoggerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function testLogsDuration()
self::assertNotEmpty($log->context->get('query_id'));
self::assertInternalType('float', $log->context->get('start'));
self::assertInternalType('float', $log->context->get('stop'));
self::assertInternalType('float', $log->context->get('duration_μs'));
self::assertInternalType('float', $log->context->get('duration_s'));
}

public function testSharedQueryId()
Expand Down

0 comments on commit 386c675

Please sign in to comment.