Skip to content

Commit 80d09e4

Browse files
narekpsNarek Poghosyan
andauthored
feat: added check duration to array reporter (#282)
Co-authored-by: Narek Poghosyan <[email protected]>
1 parent 35a6b37 commit 80d09e4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Helper/ArrayReporter.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class ArrayReporter implements ReporterInterface
2020

2121
private $globalStatus = self::STATUS_OK;
2222
private $results = [];
23+
private $checkRunTime = 0;
2324

2425
public function getResults(): array
2526
{
@@ -65,6 +66,7 @@ public function onAfterRun(CheckInterface $check, ResultInterface $result, $chec
6566
'status' => $status,
6667
'status_name' => $statusName,
6768
'service_id' => $checkAlias,
69+
'duration' => microtime(true) - $this->checkRunTime,
6870
];
6971
}
7072

@@ -81,7 +83,7 @@ public function onStart(\ArrayObject $checks, $runnerConfig)
8183
*/
8284
public function onBeforeRun(CheckInterface $check, $checkAlias = null)
8385
{
84-
return;
86+
$this->checkRunTime = microtime(true);
8587
}
8688

8789
/**

0 commit comments

Comments
 (0)