AbstractTickManager   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

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