poc form SDK (symfony 6)

This commit is contained in:
Benjamin Dalsass
2023-11-15 10:31:47 +01:00
parent 5ffd573428
commit 77cb080231
3 changed files with 32 additions and 5 deletions

View File

@@ -514,4 +514,9 @@ class ExecutionKPI
{ {
return self::$m_aExecData; return self::$m_aExecData;
} }
static public function getStats()
{
return self::$m_aStats;
}
} }

View File

@@ -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

View File

@@ -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 %}