Bånder

ThreadedLogProcessor
in package

Table of Contents

Constants

CHUNK_SIZE  = 1024 * 1024
MAX_THREADS  = 4
MIN_FILE_SIZE_FOR_THREADING  = 512 * 1024

Properties

$filePath  : string

Methods

__construct()  : mixed
countLines()  : int
getContentAfterLine()  : ContentChunk
searchInFile()  : SearchResults
calculateOptimalThreads()  : int
countLinesParallel()  : int
countLinesSequential()  : int

Constants

Properties

Methods

__construct()

public __construct(string $filePath) : mixed
Parameters
$filePath : string

searchInFile()

public searchInFile(string $pattern[, bool $caseSensitive = true ][, int|null $maxResults = null ]) : SearchResults
Parameters
$pattern : string
$caseSensitive : bool = true
$maxResults : int|null = null
Return values
SearchResults

calculateOptimalThreads()

private calculateOptimalThreads(int $fileSize) : int
Parameters
$fileSize : int
Return values
int

countLinesParallel()

private countLinesParallel(int $numThreads, int $fileSize) : int
Parameters
$numThreads : int
$fileSize : int
Return values
int

        
On this page

Search results