1 | <?php |
||
18 | class DatabaseDataCollector implements DataCollectorInterface |
||
19 | { |
||
20 | public $data; |
||
21 | protected $queries = array(); |
||
22 | protected $cacheFetches = array(); |
||
23 | |||
24 | /** |
||
25 | * Collects data for the given Request and Response, so that it can be |
||
26 | * serialized and stored for later retrieval |
||
27 | * |
||
28 | * @param Request $request A Request instance |
||
29 | * @param Response $response A Response instance |
||
30 | * @param \Exception $exception An Exception instance |
||
31 | */ |
||
32 | public function collect(Request $request, Response $response, \Exception $exception = null) |
||
40 | |||
41 | /** |
||
42 | * Log a database query |
||
43 | * |
||
44 | * @param DatabaseQuery $query The query |
||
45 | */ |
||
46 | public function logQuery($query) |
||
50 | |||
51 | /** |
||
52 | * Log a fetch from the Model Cache |
||
53 | * |
||
54 | * @param string $type The type of the model |
||
55 | * @param int $id The ID of the model |
||
56 | */ |
||
57 | public function logCacheFetch($type, $id) |
||
65 | |||
66 | /** |
||
67 | * Get the sorted catche fetches by Model type |
||
68 | * |
||
69 | * @return array |
||
70 | */ |
||
71 | public function getCacheFetches() |
||
76 | |||
77 | /** |
||
78 | * Get the total number of catche fetches |
||
79 | * |
||
80 | * @return int |
||
81 | */ |
||
82 | public function getTotalCacheFetches() |
||
86 | |||
87 | /** |
||
88 | * Get an estimate of the time that the model cache saved in milliseconds |
||
89 | * |
||
90 | * @return number |
||
91 | */ |
||
92 | public function estimateTimeSaved() |
||
110 | |||
111 | /** |
||
112 | * Get the number of times each query was sent to the server |
||
113 | * |
||
114 | * @return array An array with resolved queries as keys and frequencies as values |
||
115 | */ |
||
116 | public function getQueryFrequencies() |
||
132 | |||
133 | /** |
||
134 | * Get the number of duplicated queries |
||
135 | * |
||
136 | * @return int |
||
137 | */ |
||
138 | public function getDuplicatedQueryCount() |
||
144 | |||
145 | /** |
||
146 | * Get the queries made to the database |
||
147 | * |
||
148 | * @return DatabaseQuery[] |
||
149 | */ |
||
150 | public function getQueries() |
||
154 | |||
155 | /** |
||
156 | * Get the total duration of the database queries in milliseconds |
||
157 | * |
||
158 | * @return float |
||
159 | */ |
||
160 | public function getDuration() |
||
170 | |||
171 | /** |
||
172 | * Returns the name of the collector. |
||
173 | * |
||
174 | * @return string The collector name |
||
175 | */ |
||
176 | 2 | public function getName() |
|
180 | } |
||
181 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.