DBStats
class DBStats
This class keeps track of performance metrics for the database.
Such metrics include read/write query count, and read/write time.
Properties
| private | $reads | ||
| private | $writes | ||
| private | $start_time | ||
| private | $query_start | ||
| private | $read_time | ||
| private | $write_time | ||
| private | $queries |
Methods
__construct()
Constructs a new stats context and logs the current time
void
startQuery()
Begins tracking a query by logging the current time
void
endQuery(string $sql, int $type, bool $count = true)
Ends tracking a query and updates the relevant stats
array
getQueries()
Returns the array of queries issued to the database
array
getStats()
Returns an array of statistics collected
Details
at line 19
__construct()
Constructs a new stats context and logs the current time
at line 22
void
startQuery()
Begins tracking a query by logging the current time
at line 30
void
endQuery(string $sql, int $type, bool $count = true)
Ends tracking a query and updates the relevant stats
at line 49
array
getQueries()
Returns the array of queries issued to the database
at line 55
array
getStats()
Returns an array of statistics collected
at line 70
void
Add(DBStats $stats)
Adds another DBStats' stats to this one