Passed
Push — master ( 0a21cd...0ad97c )
by Janko
05:01
created

AbstractTickManager::logBenchmarkResult()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 1
dl 0
loc 10
ccs 8
cts 8
cp 1
crap 1
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\LogTypeEnum;
8
use Stu\Module\Logging\StuLogger;
9
use Ubench;
10
11
abstract class AbstractTickManager
12
{
13
    abstract protected function getBenchmark(): Ubench;
14
15 1
    protected function logBenchmarkResult(int $entityCount): void
16
    {
17 1
        $this->getBenchmark()->end();
18
19 1
        StuLogger::log(sprintf(
20 1
            'benchmarkResult for %d entities - executionTime: %s, memoryPeakUsage: %s',
21 1
            $entityCount,
22 1
            $this->getBenchmark()->getTime(),
23 1
            $this->getBenchmark()->getMemoryPeak()
24 1
        ), LogTypeEnum::TICK);
25
    }
26
}
27