Copied!
CloneableInstantiable
Methods
public __construct(string $fileName)
 

Parse a MySQL Slow Query Log file

public getEntries(int $session = -1) : array
 

Return \PHPFUI\MySQLSlowQuery\Entry entries from file

  • param int $session return entries from the specified session
  • throws \Exception\EmptyLog
  • throws \Exception\LogLine
  • return array<int,\PHPFUI\MySQLSlowQuery\Entry>
public getSessions() : array
 
  • throws \Exception\EmptyLog
  • throws \Exception\LogLine
  • return array<int,\PHPFUI\MySQLSlowQuery\Session> sessions from file
public sortEntries(string $sortColumn = 'Query_time', string $sortOrder = 'desc') : self
 

Sort \PHPFUI\MySQLSlowQuery\Entry entries. Defaults to Query_time, desc

  • throws \Exception\EmptyLog
  • throws \Exception\LogLine
Methods
protected entrySort(PHPFUI\MySQLSlowQuery\Entry $lhs, PHPFUI\MySQLSlowQuery\Entry $rhs) : int
Constants
private PHPFUI\MySQLSlowQuery\Parser::PORT = 'TCP Port: '
private PHPFUI\MySQLSlowQuery\Parser::TIME = '# Time: '
Properties
private array $entries = []
 
  • var array<int,\PHPFUI\MySQLSlowQuery\Entry>
private array $extraLines = []
 
  • var array<int,string>
private string $fileName
private $handle = NULL
private array $sessions = []
 
  • var array<int,\PHPFUI\MySQLSlowQuery\Session>
private string $sortColumn = 'Query_time'
private string $sortOrder = 'desc'
Methods
private getNextLine() : string
private getParseMode(string $sessionHeaderFirstLine) : string
 

Derive a string value that determines how the log is parsed.

private parse() : void
private pushLine(string $line) : self
 

Push line back on to stack for further processing.

Lines will later be processed by getNextLine() in the reverse order as they are pushed.

© 2025 Bruce Wells
Search Namespaces \ Classes
Configuration