AbstractTickManager::logBenchmarkResult()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 1
dl 0
loc 9
ccs 0
cts 7
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Module\Tick;
6
7
use Stu\Module\Logging\LoggerUtilInterface;
8
use Ubench;
9
10
abstract class AbstractTickManager
11
{
12
    abstract protected function getBenchmark(): Ubench;
13
    abstract protected function getLoggerUtil(): LoggerUtilInterface;
14
15
    protected function logBenchmarkResult(int $entityCount): void
16
    {
17
        $this->getBenchmark()->end();
18
19
        $this->getLoggerUtil()->log(sprintf(
20
            'benchmarkResult for %d entities - executionTime: %s, memoryPeakUsage: %s',
21
            $entityCount,
22
            $this->getBenchmark()->getTime(),
23
            $this->getBenchmark()->getMemoryPeak()
24
        ));
25
    }
26
}
27