24use DebugBar\DataCollector\AssetProvider;
25use DebugBar\DataCollector\DataCollector;
26use DebugBar\DataCollector\Renderable;
62 $totalMemoryUsage = 0;
64 foreach ($this->db->queries as $query) {
66 'sql' => $query[
'sql'],
67 'duration' => $query[
'duration'],
68 'duration_str' => round($query[
'duration'] * 1000, 2),
69 'memory' => $query[
'memory_usage'],
70 'is_success' => $query[
'is_success'],
71 'error_code' => $query[
'error_code'],
72 'error_message' => $query[
'error_message']
74 $totalExecTime += $query[
'duration'];
75 $totalMemoryUsage += $query[
'memory_usage'];
76 if (!$query[
'is_success']) {
82 'nb_statements' => count($queries),
83 'nb_failed_statements' => $totalFailed,
84 'accumulated_duration' => $totalExecTime,
85 'memory_usage' => $totalMemoryUsage,
86 'statements' => $queries
109 $title = $langs->transnoentities(
'Database');
113 "icon" =>
"arrow-right",
114 "widget" =>
"PhpDebugBar.Widgets.SQLQueriesWidget",
118 "$title:badge" => array(
119 "map" =>
"query.nb_statements",
133 'css' =>
'widgets/sqlqueries/widget.css',
134 'js' =>
'widgets/sqlqueries/widget.js'
getWidgets()
Return widget settings.
collect()
Return collected data.
__construct()
Constructor.
getName()
Return collector name.
getAssets()
Return assets.
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.