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

AbstractTickManager   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 14
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A logBenchmarkResult() 0 10 1
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