From 24165a7bda1de1160c5fe6b917877135e0cb9a3c Mon Sep 17 00:00:00 2001 From: Tyron Madlener Date: Mon, 3 Dec 2012 18:14:13 +0100 Subject: [PATCH] Fixed Query Analyzer Profiling Chart not displaying + Some bad gfx glitch with listing to many values in the pie --- js/server_status_monitor.js | 20 ++++++++++++++++++-- server_status.php | 2 +- themes/pmahomme/css/common.css.php | 2 +- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/js/server_status_monitor.js b/js/server_status_monitor.js index a25c2b8945..bcdbc8e83d 100644 --- a/js/server_status_monitor.js +++ b/js/server_status_monitor.js @@ -2015,15 +2015,31 @@ AJAX.registerOnload('server_status_monitor.js', function() { var chartData = []; var numberTable = ''; var duration; + var otherTime = 0; for (var i = 0, l = data.profiling.length; i < l; i++) { duration = parseFloat(data.profiling[i].duration); - chartData.push([data.profiling[i].state, duration]); totalTime += duration; numberTable += ''; } + + // Only put those values in the pie which are > 2% + for (var i = 0, l = data.profiling.length; i < l; i++) { + duration = parseFloat(data.profiling[i].duration); + + if (duration / totalTime > 0.02) { + chartData.push([PMA_prettyProfilingNum(duration, 2) + ' ' + data.profiling[i].state, duration]); + } else { + otherTime += duration; + } + } + + if (otherTime > 0) { + chartData.push([PMA_prettyProfilingNum(otherTime, 2) + ' ' + PMA_messages['strOther'], otherTime]); + } + numberTable += ''; numberTable += '
' + PMA_messages['strStatus'] + '' + PMA_messages['strTime'] + '
' + data.profiling[i].state + ' ' + PMA_prettyProfilingNum(duration, 2) + '
' + PMA_messages['strTotalTime'] + '' + PMA_prettyProfilingNum(totalTime, 2) + '
'; @@ -2049,7 +2065,7 @@ AJAX.registerOnload('server_status_monitor.js', function() { chartData ); - $('div#queryProfiling').resizable(); + //$('div#queryProfiling').resizable(); } }); } diff --git a/server_status.php b/server_status.php index 3b0137ae50..b8d00b05fd 100644 --- a/server_status.php +++ b/server_status.php @@ -405,7 +405,7 @@ if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) { PMA_DBI_select_db($_REQUEST['database']); } - if ($profiling == PMA_Util::profilingSupported()) { + if ($profiling = PMA_Util::profilingSupported()) { PMA_DBI_query('SET PROFILING=1;'); } diff --git a/themes/pmahomme/css/common.css.php b/themes/pmahomme/css/common.css.php index 54bfbbfe46..221a37a260 100644 --- a/themes/pmahomme/css/common.css.php +++ b/themes/pmahomme/css/common.css.php @@ -1357,7 +1357,7 @@ div#queryAnalyzerDialog div.CodeMirror-scroll { } div#queryAnalyzerDialog div#queryProfiling { - height: 250px; + height: 300px; } div#queryAnalyzerDialog td.explain {