diff --git a/js/functions.js b/js/functions.js index 9163d1bba3..2e761bc57c 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1414,10 +1414,13 @@ function PMA_createChart(passedSettings) { var lastValue = null, curValue = null; var numLoadedPoints = 0, otherSum = 0; var diff; - // No realtime updates for graphs that are being exported, and disabled when no callback is set + + // No realtime updates for graphs that are being exported, and disabled when realtime is not set + // Also don't do live charting if we don't have the server time if(thisChart.options.chart.forExport == true || ! passedSettings.realtime || - ! passedSettings.realtime.callback) return; + ! passedSettings.realtime.callback || + ! server_time_diff) return; thisChart.options.realtime.timeoutCallBack = function() { $.post(passedSettings.realtime.url, @@ -1449,7 +1452,7 @@ function PMA_createChart(passedSettings) { }); } - chart_activeTimeouts[container] = setTimeout(thisChart.options.realtime.timeoutCallBack, 0); + chart_activeTimeouts[container] = setTimeout(thisChart.options.realtime.timeoutCallBack, 5); } } }, @@ -1498,8 +1501,10 @@ function PMA_createChart(passedSettings) { if(!passedSettings.realtime.numMaxPoints) passedSettings.realtime.numMaxPoints = 30; - settings.xAxis.min = new Date().getTime() - passedSettings.realtime.numMaxPoints * passedSettings.realtime.refreshRate; - settings.xAxis.max = new Date().getTime(); + if(server_time_diff) { + settings.xAxis.min = new Date().getTime() - server_time_diff - passedSettings.realtime.numMaxPoints * passedSettings.realtime.refreshRate; + settings.xAxis.max = new Date().getTime() - server_time_diff; + } } // Overwrite/Merge default settings with passedsettings diff --git a/js/messages.php b/js/messages.php index 7ec366f9cb..f7c7322682 100644 --- a/js/messages.php +++ b/js/messages.php @@ -83,8 +83,10 @@ $js_messages['strChartServerTraffic'] = __('Server traffic (in kB)'); $js_messages['strChartConnections'] = __('Connections since last refresh'); $js_messages['strChartProcesses'] = __('Processes'); $js_messages['strChartConnectionsTitle'] = __('Connections / Processes'); -$js_messages['strChartIssuedQueries'] = __('Issued queries since last refresh'); -$js_messages['strChartIssuedQueriesTitle'] = __('Issued queries'); +/* l10n: Questions is the name of a MySQL Status variable */ +$js_messages['strChartIssuedQueries'] = __('Questions since last refresh'); +/* l10n: Questions is the name of a MySQL Status variable */ +$js_messages['strChartIssuedQueriesTitle'] = __('Questions (executed statements by the server)'); $js_messages['strChartQueryPie'] = __('Query statistics'); diff --git a/js/server_status.js b/js/server_status.js index af8f93cbc6..50eaaa8c83 100644 --- a/js/server_status.js +++ b/js/server_status.js @@ -56,6 +56,14 @@ $(function() { var tabStatus = new Object(); // Holds the current chart instances for each tab var tabChart = new Object(); + + // Tell highcarts not to use UTC dates (global setting) + Highcharts.setOptions({ + global: { + useUTC: false + } + }); + $.ajaxSetup({ cache:false @@ -84,8 +92,8 @@ $(function() { chart.options.realtime.refreshRate = 1000*parseInt(this.value); chart.xAxis[0].setExtremes( - new Date().getTime() - chart.options.realtime.numMaxPoints * chart.options.realtime.refreshRate, - new Date().getTime() + chart.options.realtime.refreshRate / 4, + new Date().getTime() - server_time_diff - chart.options.realtime.numMaxPoints * chart.options.realtime.refreshRate, + new Date().getTime() - server_time_diff, true ); diff --git a/server_status.php b/server_status.php index 3c2e714ca5..48b026d9b6 100644 --- a/server_status.php +++ b/server_status.php @@ -44,15 +44,17 @@ if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) { exit(json_encode($ret)); case 'queries': - $queries = PMA_DBI_fetch_result('SHOW GLOBAL STATUS WHERE Variable_name LIKE "Com_%" AND Value>0', 0, 1); + $queries = PMA_DBI_fetch_result('SHOW GLOBAL STATUS WHERE Variable_name LIKE "Com_%" OR Variable_name="Questions" AND Value>0', 0, 1); cleanDeprecated($queries); // admin commands are not queries unset($queries['Com_admin_commands']); + $questions = $queries['Questions']; + unset($queries['Questions']); - $sum=array_sum($queries); + //$sum=array_sum($queries); $ret = array( 'x' => microtime(true)*1000, - 'y' => $sum, + 'y' => $questions, 'pointInfo' => $queries ); @@ -367,6 +369,7 @@ require './libraries/server_links.inc.php'; pma_token = ''; url_query = ''; pma_theme_image = ''; +server_time_diff = new Date().getTime() - ;


@@ -537,11 +542,11 @@ function printQueryStatistics() { if($total_queries / $server_status['Uptime'] >= 1) { echo 'ø'.__('per second').':'; echo PMA_formatNumber( $total_queries / $server_status['Uptime'], 0); + } ?> -
+

- + 6) $other_sum += $value; else $chart_json[$name] = $value; ?> diff --git a/server_variables.php b/server_variables.php index 792bb99dae..d269852b8a 100644 --- a/server_variables.php +++ b/server_variables.php @@ -44,7 +44,7 @@ if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) { $value = $_REQUEST['varValue']; if(!is_numeric($value)) $value="'".$value."'"; - if(PMA_DBI_query('SET GLOBAL '.PMA_backquote($_REQUEST['varName']).' = '.$value)) + if(PMA_DBI_query('SET GLOBAL '.$_REQUEST['varName'].' = '.$value)) // Some values are rounded down etc. $varValue = PMA_DBI_fetch_single_row('SHOW GLOBAL VARIABLES WHERE Variable_name="'.$_REQUEST['varName'].'";','NUM'); diff --git a/themes/pmahomme/css/theme_right.css.php b/themes/pmahomme/css/theme_right.css.php index ffcc96336b..21457bceed 100644 --- a/themes/pmahomme/css/theme_right.css.php +++ b/themes/pmahomme/css/theme_right.css.php @@ -1207,10 +1207,14 @@ div#serverstatusquerieschart { padding-: 30px; } -div#serverstatus table#serverstatusqueriesdetails { +table#serverstatusqueriesdetails, table#serverstatustraffic { float: ; } +table#serverstatusqueriesdetails th { + min-width: 35px; +} + .clearfloat { clear: both; } @@ -1225,9 +1229,6 @@ table#serverstatusvariables .name { table#serverstatusvariables .value { width: 6em; } -table#serverstatustraffic { - float: ; -} table#serverstatusconnections { float: ; margin-: 30px;