Fix debug queries console broken query time and group count

There was no number displayed, I fixed the jquery expression and then fixed the formatting method to make the value appear in each display case

Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2022-08-15 12:28:14 +02:00
parent a9356e4d16
commit 2365ec78e2
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889
2 changed files with 9 additions and 8 deletions

View File

@ -1354,10 +1354,10 @@ var ConsoleDebug = {
.data('queryInfo', queryInfo)
.data('totalTime', totalTime);
if (grouped) {
$query.find('.text.count').removeClass('hide');
$query.find('.text.count span').text(count);
$query.find('span.text.count').removeClass('hide');
$query.find('span.text.count span').text(count);
}
$query.find('.text.time span').text(queryTime + 's (' + ((queryTime * 100) / totalTime).toFixed(3) + '%)');
$query.find('span.text.time span').text(ConsoleDebug.getQueryTimeTaken(queryTime, totalTime));
return $query;
},
@ -1369,6 +1369,9 @@ var ConsoleDebug = {
}
$elem.append(this.formatBackTrace(query.trace));
},
getQueryTimeTaken: function (queryTime, totalTime) {
return queryTime + 's (' + ((queryTime * 100) / totalTime).toFixed(3) + '%)';
},
getQueryDetails: function (queryInfo, totalTime, $query) {
if (Array.isArray(queryInfo)) {
var $singleQuery;
@ -1377,9 +1380,7 @@ var ConsoleDebug = {
.text((parseInt(i) + 1) + '.')
.append(
$('<span class="time">').text(
Messages.strConsoleDebugTimeTaken +
' ' + queryInfo[i].time + 's' +
' (' + ((queryInfo[i].time * 100) / totalTime).toFixed(3) + '%)'
Messages.strConsoleDebugTimeTaken + ' ' + ConsoleDebug.getQueryTimeTaken(queryInfo[i].time, totalTime)
)
);
this.appendQueryExtraInfo(queryInfo[i], $singleQuery);

View File

@ -88,8 +88,8 @@
['action expand', 'Expand'|trans],
['action dbg_show_trace', 'Show trace'|trans],
['action dbg_hide_trace', 'Hide trace'|trans],
['text count hide', 'Count'|trans],
['text time', 'Time taken'|trans]
{0: 'text count hide', 1: 'Count'|trans, 'extraSpan': ''},
{0: 'text time', 1: 'Time taken'|trans, 'extraSpan': ''},
]
} only %}
</div> <!-- Template -->