Skip to content
This repository was archived by the owner on Jan 8, 2024. It is now read-only.

Commit 374148c

Browse files
committed
Added driver config to collector
1 parent 14f2155 commit 374148c

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

DataCollector/CacheCollector.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,22 @@ public function collect(Request $request, Response $response, \Exception $except
3434
{
3535
$size = 0;
3636
$stats = [];
37+
$instances = [];
38+
3739
/** @var $cache */
38-
foreach ($this->cache->getInstances() as $name => $cache) {
40+
foreach ($this->cache->getInstances() as $instanceName => $cache) {
3941
if ($cache->getStats()->getSize()) {
4042
$size += $cache->getStats()->getSize();
4143
}
42-
$stats[$name] = $cache->getStats();
44+
$stats[$instanceName] = $cache->getStats();
45+
$instances[$instanceName] = [
46+
'driverName' => $cache->getDriverName(),
47+
'driverConfig' => $cache->getConfig()
48+
];
4349
}
4450

4551
$this->data = [
52+
'instances' => $instances,
4653
'stats' => $stats,
4754
'size' => $size
4855
];

Resources/views/data_collector/template.html.twig

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,29 @@
4949
<table class="{{ class|default('') }}">
5050
<tbody>
5151
<tr>
52-
<th>Info</th>
52+
<th>Driver Name</th>
53+
<td>{{ collector.instances[name].driverName }}</td>
54+
</tr>
55+
<tr>
56+
<th>Driver Info</th>
5357
<td>{{ stat.info }}</td>
5458
</tr>
5559
<tr>
56-
<th>Size</th>
60+
<th>Driver Size</th>
5761
<td>{{ stat.size|sizeFormat(1) }}</td>
5862
</tr>
5963
<tr>
60-
<th>Data</th>
64+
<th>Driver Data</th>
6165
<td>{{ stat.data }}</td>
6266
</tr>
6367
<tr>
64-
<th>RawData</th>
68+
<th>Driver RawData</th>
6569
<td>{{ dump(stat.rawData) }}</td>
6670
</tr>
71+
<tr>
72+
<th>Driver Config</th>
73+
<td>{{ dump(collector.instances[name].driverConfig) }}</td>
74+
</tr>
6775
</tbody>
6876
</table>
6977
</div>

0 commit comments

Comments
 (0)