mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 07:12:26 +02:00
poc form SDK (symfony 6)
This commit is contained in:
@@ -514,4 +514,9 @@ class ExecutionKPI
|
|||||||
{
|
{
|
||||||
return self::$m_aExecData;
|
return self::$m_aExecData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static public function getStats()
|
||||||
|
{
|
||||||
|
return self::$m_aStats;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,13 +27,19 @@ class OQLCollector extends AbstractDataCollector
|
|||||||
public function collect(Request $request, Response $response, \Throwable $exception = null)
|
public function collect(Request $request, Response $response, \Throwable $exception = null)
|
||||||
{
|
{
|
||||||
$this->data = [
|
$this->data = [
|
||||||
'execution' => ExecutionKPI::getExecData()
|
'exec_data' => ExecutionKPI::getExecData(),
|
||||||
|
'stats' => ExecutionKPI::getStats()
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRequests()
|
public function getExecData()
|
||||||
{
|
{
|
||||||
return $this->data['execution'];
|
return $this->data['exec_data'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getStats()
|
||||||
|
{
|
||||||
|
return $this->data['stats'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getTemplate(): ?string
|
public static function getTemplate(): ?string
|
||||||
|
|||||||
@@ -30,13 +30,29 @@
|
|||||||
{% block panel %}
|
{% block panel %}
|
||||||
{# Optional, for showing the most details. #}
|
{# Optional, for showing the most details. #}
|
||||||
<h2>iTop KPI</h2>
|
<h2>iTop KPI</h2>
|
||||||
|
|
||||||
|
<h3>Exec data</h3>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
|
||||||
{% for request in collector.requests %}
|
{% for execData in collector.execData %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ dump(request) }}</td>
|
<td>{{ dump(execData) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<h3>Stats</h3>
|
||||||
|
|
||||||
|
<table>
|
||||||
|
|
||||||
|
{% for stats in collector.stats %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ dump(stats) }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
</table>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user