Reorganized collector classes.
This commit is contained in:
1 parent
fb144ebe01
commit
961019ef74
16 files changed
+46
-34
No files matched your search
@@ -1,7 +1,10 @@
|
||||
<?php
|
||||
declare( strict_types=1 );
|
||||
|
||||
namespace Rarst\Laps\Record;
|
||||
namespace Rarst\Laps\Record\Collector;
|
||||
|
||||
use Rarst\Laps\Record\Record;
|
||||
use Rarst\Laps\Record\Record_Interface;
|
||||
|
||||
/**
|
||||
* Covers pre–plugin load time from available data.
|
||||
@@ -1,17 +1,18 @@
|
||||
<?php
|
||||
declare( strict_types=1 );
|
||||
|
||||
namespace Rarst\Laps\Record;
|
||||
namespace Rarst\Laps\Record\Collector;
|
||||
|
||||
use Rarst\Laps\Event\Hook_Event_Config_Interface;
|
||||
use Rarst\Laps\Formatter\Hook_Formatter;
|
||||
use Rarst\Laps\Record\Stopwatch_Record;
|
||||
use Symfony\Component\Stopwatch\Stopwatch;
|
||||
use Symfony\Component\Stopwatch\StopwatchEvent;
|
||||
|
||||
/**
|
||||
* Processes events based on hooked starts and stops.
|
||||
*/
|
||||
class Hook_Record_Collector extends Stopwatch_Record_Collector {
|
||||
class Hook_Collector extends Stopwatch_Collector {
|
||||
|
||||
/** @var Hook_Event_Config_Interface[] $event_configs */
|
||||
protected $event_configs = [];
|
||||
@@ -1,16 +1,17 @@
|
||||
<?php
|
||||
declare( strict_types=1 );
|
||||
|
||||
namespace Rarst\Laps\Record;
|
||||
namespace Rarst\Laps\Record\Collector;
|
||||
|
||||
use Rarst\Laps\Formatter\Backtrace_Formatter;
|
||||
use Rarst\Laps\Record\Stopwatch_Record;
|
||||
use Symfony\Component\Stopwatch\Stopwatch;
|
||||
use Symfony\Component\Stopwatch\StopwatchEvent;
|
||||
|
||||
/**
|
||||
* Captures time of network requests made with HTTP API.
|
||||
*/
|
||||
class Http_Record_Collector extends Stopwatch_Record_Collector {
|
||||
class Http_Collector extends Stopwatch_Collector {
|
||||
|
||||
/** @var Backtrace_Formatter */
|
||||
private $formatter;
|
||||
+3
-1
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
declare( strict_types=1 );
|
||||
|
||||
namespace Rarst\Laps\Record;
|
||||
namespace Rarst\Laps\Record\Collector;
|
||||
|
||||
use Rarst\Laps\Record\Record_Interface;
|
||||
|
||||
/**
|
||||
* Interface to retrieve a set of records form collector.
|
||||
@@ -1,14 +1,15 @@
|
||||
<?php
|
||||
declare( strict_types=1 );
|
||||
|
||||
namespace Rarst\Laps\Record;
|
||||
namespace Rarst\Laps\Record\Collector;
|
||||
|
||||
use Rarst\Laps\Formatter\Backtrace_Formatter;
|
||||
use Rarst\Laps\Record\Record;
|
||||
|
||||
/**
|
||||
* Processes SQL events from data logged by wpdb.
|
||||
*/
|
||||
class Sql_Record_Collector implements Record_Collector_Interface {
|
||||
class Sql_Collector implements Record_Collector_Interface {
|
||||
|
||||
/** @var array $query_starts Log of query start times. */
|
||||
protected $query_starts = [];
|
||||
+3
-2
@@ -1,15 +1,16 @@
|
||||
<?php
|
||||
declare( strict_types=1 );
|
||||
|
||||
namespace Rarst\Laps\Record;
|
||||
namespace Rarst\Laps\Record\Collector;
|
||||
|
||||
use Rarst\Laps\Record\Stopwatch_Record;
|
||||
use Symfony\Component\Stopwatch\Stopwatch;
|
||||
use Symfony\Component\Stopwatch\StopwatchEvent;
|
||||
|
||||
/**
|
||||
* Generic Stopwatch–based collector. Can be used by itself or extended.
|
||||
*/
|
||||
class Stopwatch_Record_Collector implements Record_Collector_Interface {
|
||||
class Stopwatch_Collector implements Record_Collector_Interface {
|
||||
|
||||
/** @var Stopwatch $stopwatch */
|
||||
protected $stopwatch;
|
||||
Reference in new issue
Block a user