1 | <?php |
||
7 | class ServerTiming |
||
8 | { |
||
9 | /** @var Stopwatch */ |
||
10 | protected $stopwatch; |
||
11 | |||
12 | /** @var array */ |
||
13 | protected $finishedEvents = []; |
||
14 | |||
15 | /** @var array */ |
||
16 | protected $startedEvents = []; |
||
17 | |||
18 | public function __construct(Stopwatch $stopwatch) |
||
22 | |||
23 | public function addMetric(string $metric) |
||
29 | |||
30 | public function hasStartedEvent(string $key): bool |
||
34 | |||
35 | public function measure(string $key) |
||
43 | |||
44 | public function start(string $key) |
||
52 | |||
53 | public function stop(string $key) |
||
65 | |||
66 | public function stopAllUnfinishedEvents() |
||
72 | |||
73 | public function setDuration(string $key, $duration) |
||
87 | |||
88 | public function getDuration(string $key) |
||
92 | |||
93 | public function addMessage(string $key) |
||
97 | |||
98 | public function events(): array |
||
102 | |||
103 | } |
||
104 |