From fa8855440a7e57964041b00fabcc2255b58f2124 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Thu, 3 Nov 2011 12:51:57 +0000 Subject: [PATCH] fix mysql graphs git-svn-id: http://www.observium.org/svn/observer/trunk@2713 61d68cd4-352d-0410-923a-c4978735b2b8 --- .../application/mysql_connections.inc.php | 2 +- .../application/mysql_files_tables.inc.php | 2 +- .../mysql_innodb_buffer_pool_activity.inc.php | 2 +- .../mysql_innodb_insert_buffer.inc.php | 2 +- .../mysql_innodb_io_pending.inc.php | 2 +- .../mysql_innodb_row_operations.inc.php | 61 +++++++--------- .../mysql_innodb_semaphores.inc.php | 47 ++++++------ .../mysql_innodb_transactions.inc.php | 36 ++++++--- .../application/mysql_myisam_indexes.inc.php | 56 +++++++------- .../application/mysql_query_cache.inc.php | 51 ++++++------- .../mysql_query_cache_memory.inc.php | 44 ++++++----- .../application/mysql_select_types.inc.php | 73 ++++++++----------- .../application/mysql_slow_queries.inc.php | 37 +++++++--- .../graphs/application/mysql_sorts.inc.php | 57 +++++++-------- .../application/mysql_table_locks.inc.php | 43 ++++++----- .../mysql_temporary_objects.inc.php | 50 +++++++------ 16 files changed, 292 insertions(+), 273 deletions(-) diff --git a/html/includes/graphs/application/mysql_connections.inc.php b/html/includes/graphs/application/mysql_connections.inc.php index ab0baff0b..5feb7bf49 100644 --- a/html/includes/graphs/application/mysql_connections.inc.php +++ b/html/includes/graphs/application/mysql_connections.inc.php @@ -29,7 +29,7 @@ if (is_file($rrd_filename)) $colours = "mixed"; $nototal = 1; -$unit_text = "Commands"; +$unit_text = "Connections"; include("includes/graphs/generic_multi_simplex_seperated.inc.php"); diff --git a/html/includes/graphs/application/mysql_files_tables.inc.php b/html/includes/graphs/application/mysql_files_tables.inc.php index a02cdcca3..758ec51e6 100644 --- a/html/includes/graphs/application/mysql_files_tables.inc.php +++ b/html/includes/graphs/application/mysql_files_tables.inc.php @@ -25,7 +25,7 @@ if (is_file($rrd_filename)) $colours = "mixed"; $nototal = 1; -$unit_text = "Commands"; +$unit_text = ""; include("includes/graphs/generic_multi_simplex_seperated.inc.php"); diff --git a/html/includes/graphs/application/mysql_innodb_buffer_pool_activity.inc.php b/html/includes/graphs/application/mysql_innodb_buffer_pool_activity.inc.php index 30416f0d5..11f282488 100644 --- a/html/includes/graphs/application/mysql_innodb_buffer_pool_activity.inc.php +++ b/html/includes/graphs/application/mysql_innodb_buffer_pool_activity.inc.php @@ -28,7 +28,7 @@ if (is_file($rrd_filename)) $colours = "mixed"; $nototal = 1; -$unit_text = "Commands"; +$unit_text = "activity"; include("includes/graphs/generic_multi_simplex_seperated.inc.php"); diff --git a/html/includes/graphs/application/mysql_innodb_insert_buffer.inc.php b/html/includes/graphs/application/mysql_innodb_insert_buffer.inc.php index d6e46f7b0..da09b08ce 100644 --- a/html/includes/graphs/application/mysql_innodb_insert_buffer.inc.php +++ b/html/includes/graphs/application/mysql_innodb_insert_buffer.inc.php @@ -28,7 +28,7 @@ if (is_file($rrd_filename)) $colours = "mixed"; $nototal = 1; -$unit_text = "Commands"; +$unit_text = ""; include("includes/graphs/generic_multi_simplex_seperated.inc.php"); diff --git a/html/includes/graphs/application/mysql_innodb_io_pending.inc.php b/html/includes/graphs/application/mysql_innodb_io_pending.inc.php index d738cf3c5..7214675d7 100644 --- a/html/includes/graphs/application/mysql_innodb_io_pending.inc.php +++ b/html/includes/graphs/application/mysql_innodb_io_pending.inc.php @@ -32,7 +32,7 @@ if (is_file($rrd_filename)) $colours = "mixed"; $nototal = 1; -$unit_text = "Commands"; +$unit_text = ""; include("includes/graphs/generic_multi_simplex_seperated.inc.php"); diff --git a/html/includes/graphs/application/mysql_innodb_row_operations.inc.php b/html/includes/graphs/application/mysql_innodb_row_operations.inc.php index 51a3e2223..440d69ee2 100644 --- a/html/includes/graphs/application/mysql_innodb_row_operations.inc.php +++ b/html/includes/graphs/application/mysql_innodb_row_operations.inc.php @@ -2,44 +2,37 @@ include("includes/graphs/common.inc.php"); -$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd"; +$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd'; -if (is_file($mysql_rrd)) +$array = array('IDBRDd' => 'Deletes', + 'IDBRId' => 'Inserts', + 'IDBRRd' => 'Reads', + 'IDBRUd' => 'Updates', +); + +$i = 0; +if (is_file($rrd_filename)) { - $rrd_filename = $mysql_rrd; -} + foreach ($array as $ds => $vars) + { + $rrd_list[$i]['filename'] = $rrd_filename; + if (is_array($vars)) + { + $rrd_list[$i]['descr'] = $vars['descr']; + } else { + $rrd_list[$i]['descr'] = $vars; + } + $rrd_list[$i]['ds'] = $ds; + $i++; + } +} else { echo("file missing: $file"); } -$rrd_options .= ' DEF:a='.$rrd_filename.':IDBRDd:AVERAGE '; -$rrd_options .= ' DEF:b='.$rrd_filename.':IDBRId:AVERAGE '; -$rrd_options .= ' DEF:c='.$rrd_filename.':IDBRRd:AVERAGE '; -$rrd_options .= ' DEF:d='.$rrd_filename.':IDBRUd:AVERAGE '; -$rrd_options .= ' CDEF:e=a,b,c,d,+,+,+ '; +$colours = "mixed"; +$nototal = 0; +$unit_text = "Rows"; -$rrd_options .= 'COMMENT:" Current Average Maximum\n" '; +include("includes/graphs/generic_multi_simplex_seperated.inc.php"); -$rrd_options .= 'AREA:a#22FF22:"Deletes"\ \ '; -$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" '; -$rrd_options .= 'AREA:b#0022FF:"Inserts":STACK '; -$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" '; -$rrd_options .= 'AREA:c#FF0000:"Reads":STACK '; -$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" '; - -$rrd_options .= 'AREA:d#00AAAA:"Updates":STACK '; -$rrd_options .= 'GPRINT:d:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:d:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:d:MAX:"%6.2lf %s\n" '; - -$rrd_options .= 'AREA:e#000000:"Total":STACK '; -$rrd_options .= 'GPRINT:e:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:e:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:e:MAX:"%6.2lf %s\n" '; - -?> \ No newline at end of file +?> diff --git a/html/includes/graphs/application/mysql_innodb_semaphores.inc.php b/html/includes/graphs/application/mysql_innodb_semaphores.inc.php index 48b773812..3192a2ecb 100644 --- a/html/includes/graphs/application/mysql_innodb_semaphores.inc.php +++ b/html/includes/graphs/application/mysql_innodb_semaphores.inc.php @@ -2,32 +2,37 @@ include("includes/graphs/common.inc.php"); -$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd"; +$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd'; -if (is_file($mysql_rrd)) +$array = array('IBSRs' => 'Spin Rounds', + 'IBSWs' => 'Spin Waits', + 'IBOWs' => 'OS Waits', +); + +$i = 0; +if (is_file($rrd_filename)) { - $rrd_filename = $mysql_rrd; -} + foreach ($array as $ds => $vars) + { + $rrd_list[$i]['filename'] = $rrd_filename; + if (is_array($vars)) + { + $rrd_list[$i]['descr'] = $vars['descr']; + } else { + $rrd_list[$i]['descr'] = $vars; + } + $rrd_list[$i]['ds'] = $ds; + $i++; + } +} else { echo("file missing: $file"); } -$rrd_options .= ' DEF:a='.$rrd_filename.':IBSRs:AVERAGE '; -$rrd_options .= ' DEF:b='.$rrd_filename.':IBSWs:AVERAGE '; -$rrd_options .= ' DEF:c='.$rrd_filename.':IBOWs:AVERAGE '; +$colours = "mixed"; +$nototal = 1; +$unit_text = "Semaphores"; -$rrd_options .= 'COMMENT:" Current Average Maximum\n" '; +include("includes/graphs/generic_multi_simplex_seperated.inc.php"); -$rrd_options .= 'LINE2:a#22FF22:"Spin Rounds"\ \ '; -$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" '; -$rrd_options .= 'LINE2:b#0022FF:"Spin Waits"\ \ '; -$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" '; -$rrd_options .= 'LINE2:c#FF0000:"OS Waits"\ \ '; -$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" '; -?> \ No newline at end of file +?> diff --git a/html/includes/graphs/application/mysql_innodb_transactions.inc.php b/html/includes/graphs/application/mysql_innodb_transactions.inc.php index e97ee08a8..ffe77a4ab 100644 --- a/html/includes/graphs/application/mysql_innodb_transactions.inc.php +++ b/html/includes/graphs/application/mysql_innodb_transactions.inc.php @@ -2,21 +2,33 @@ include("includes/graphs/common.inc.php"); -$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd"; +$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd'; -if (is_file($mysql_rrd)) +$array = array('IBTNx' => 'Transactions created', +); + +$i = 0; +if (is_file($rrd_filename)) { - $rrd_filename = $mysql_rrd; -} + foreach ($array as $ds => $vars) + { + $rrd_list[$i]['filename'] = $rrd_filename; + if (is_array($vars)) + { + $rrd_list[$i]['descr'] = $vars['descr']; + } else { + $rrd_list[$i]['descr'] = $vars; + } + $rrd_list[$i]['ds'] = $ds; + $i++; + } +} else { echo("file missing: $file"); } -$rrd_options .= ' -b 1000 '; -$rrd_options .= ' DEF:a='.$rrd_filename.':IBTNx:AVERAGE '; +$colours = "mixed"; +$nototal = 1; +$unit_text = "transactions"; -$rrd_options .= 'COMMENT:" Current Average Maximum\n" '; +include("includes/graphs/generic_multi_simplex_seperated.inc.php"); -$rrd_options .= 'LINE1:a#22FF22:"Transactions created"\ \ '; -$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s" '; -?> \ No newline at end of file +?> diff --git a/html/includes/graphs/application/mysql_myisam_indexes.inc.php b/html/includes/graphs/application/mysql_myisam_indexes.inc.php index 19496722b..c336e814c 100644 --- a/html/includes/graphs/application/mysql_myisam_indexes.inc.php +++ b/html/includes/graphs/application/mysql_myisam_indexes.inc.php @@ -2,38 +2,36 @@ include("includes/graphs/common.inc.php"); -$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd"; +$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd'; -if (is_file($mysql_rrd)) +$array = array( 'KRRs' => 'read requests', + 'KRs' => 'reads', + 'KWR' => 'write requests', + 'KWs' => 'writes', +); + +$i = 0; +if (is_file($rrd_filename)) { - $rrd_filename = $mysql_rrd; -} + foreach ($array as $ds => $vars) + { + $rrd_list[$i]['filename'] = $rrd_filename; + if (is_array($vars)) + { + $rrd_list[$i]['descr'] = $vars['descr']; + } else { + $rrd_list[$i]['descr'] = $vars; + } + $rrd_list[$i]['ds'] = $ds; + $i++; + } +} else { echo("file missing: $file"); } -$rrd_options .= ' DEF:a='.$rrd_filename.':KRRs:AVERAGE '; -$rrd_options .= ' DEF:b='.$rrd_filename.':KRs:AVERAGE '; -$rrd_options .= ' DEF:c='.$rrd_filename.':KWR:AVERAGE '; -$rrd_options .= ' DEF:d='.$rrd_filename.':KWs:AVERAGE '; +$colours = "mixed"; +$nototal = 1; +$unit_text = "Keys"; -$rrd_options .= 'COMMENT:" Current Average Maximum\n" '; +include("includes/graphs/generic_multi_simplex_seperated.inc.php"); -$rrd_options .= 'LINE1:a#22FF22:"Key read requests"\ \ '; -$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" '; -$rrd_options .= 'LINE1:b#0022FF:"Key reads"\ \ '; -$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" '; - -$rrd_options .= 'LINE1:c#FF0000:"Key write requests"\ \ '; -$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" '; - -$rrd_options .= 'LINE1:d#00AAAA:"Key writes"\ \ '; -$rrd_options .= 'GPRINT:d:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:d:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:d:MAX:"%6.2lf %s\n" '; - -?> \ No newline at end of file +?> diff --git a/html/includes/graphs/application/mysql_query_cache.inc.php b/html/includes/graphs/application/mysql_query_cache.inc.php index df635bf71..ebb65296e 100644 --- a/html/includes/graphs/application/mysql_query_cache.inc.php +++ b/html/includes/graphs/application/mysql_query_cache.inc.php @@ -9,38 +9,33 @@ if (is_file($mysql_rrd)) $rrd_filename = $mysql_rrd; } -$rrd_options .= ' -b 1024 '; -$rrd_options .= ' DEF:a='.$rrd_filename.':QCQICe:AVERAGE '; -$rrd_options .= ' DEF:b='.$rrd_filename.':QCHs:AVERAGE '; -$rrd_options .= ' DEF:c='.$rrd_filename.':QCIs:AVERAGE '; -$rrd_options .= ' DEF:d='.$rrd_filename.':QCNCd:AVERAGE '; -$rrd_options .= ' DEF:e='.$rrd_filename.':QCLMPs:AVERAGE '; -$rrd_options .= 'COMMENT:" Current Average Maximum\n" '; +$array = array('QCQICe' => array('descr' => 'Queries in cache', 'colour' => '22FF22'), + 'QCHs' => array('descr' => 'Cache hits', 'colour' => '0022FF'), + 'QCIs' => array('descr' => 'Inserts', 'colour' => 'FF0000'), + 'QCNCd' => array('descr' => 'Not cached', 'colour' => '00AAAA'), + 'QCLMPs' => array('descr' => 'Low-memory prunes', 'colour' => 'FF00FF'), +); -$rrd_options .= 'LINE2:a#22FF22:"Queries in cache"\ \ '; -$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" '; +$i = 0; +if (is_file($rrd_filename)) +{ + foreach ($array as $ds => $vars) + { + $rrd_list[$i]['filename'] = $rrd_filename; + $rrd_list[$i]['descr'] = $vars['descr']; + $rrd_list[$i]['ds'] = $ds; +# $rrd_list[$i]['colour'] = $vars['colour']; + $i++; + } +} else { echo("file missing: $file"); } -$rrd_options .= 'LINE2:b#0022FF:"Cache hits"\ \ '; -$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" '; +$colours = "mixed"; +$nototal = 1; +$unit_text = "Commands"; -$rrd_options .= 'LINE2:c#FF0000:"Inserts"\ \ '; -$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" '; +include("includes/graphs/generic_multi_simplex_seperated.inc.php"); -$rrd_options .= 'LINE2:d#00AAAA:"Not cached"\ \ '; -$rrd_options .= 'GPRINT:d:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:d:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:d:MAX:"%6.2lf %s\n" '; -$rrd_options .= 'LINE2:e#FF00FF:"Low-memory prunes"\ \ '; -$rrd_options .= 'GPRINT:e:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:e:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:e:MAX:"%6.2lf %s\n" '; -?> \ No newline at end of file +?> diff --git a/html/includes/graphs/application/mysql_query_cache_memory.inc.php b/html/includes/graphs/application/mysql_query_cache_memory.inc.php index 413bba45f..133938c01 100644 --- a/html/includes/graphs/application/mysql_query_cache_memory.inc.php +++ b/html/includes/graphs/application/mysql_query_cache_memory.inc.php @@ -2,28 +2,34 @@ include("includes/graphs/common.inc.php"); -$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd"; +$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd'; -if (is_file($mysql_rrd)) +$array = array( 'QCs' => 'Cache size', + 'QCeFy' => 'Free mem', +); + +$i = 0; +if (is_file($rrd_filename)) { - $rrd_filename = $mysql_rrd; -} + foreach ($array as $ds => $vars) + { + $rrd_list[$i]['filename'] = $rrd_filename; + if (is_array($vars)) + { + $rrd_list[$i]['descr'] = $vars['descr']; + } else { + $rrd_list[$i]['descr'] = $vars; + } + $rrd_list[$i]['ds'] = $ds; + $i++; + } +} else { echo("file missing: $file"); } -$rrd_options .= ' -b 1024 '; -$rrd_options .= ' -l 0 '; -$rrd_options .= ' DEF:a='.$rrd_filename.':QCs:AVERAGE '; -$rrd_options .= ' DEF:b='.$rrd_filename.':QCeFy:AVERAGE '; +$colours = "mixed"; +$nototal = 1; +$unit_text = "Bytes"; -$rrd_options .= 'COMMENT:" Current Average Maximum\n" '; +include("includes/graphs/generic_multi_simplex_seperated.inc.php"); -$rrd_options .= 'AREA:a#22FF22:"Cache size"\ \ '; -$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" '; -$rrd_options .= 'AREA:b#0022FF:"Free mem"\ \ '; -$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" '; - -?> \ No newline at end of file +?> diff --git a/html/includes/graphs/application/mysql_select_types.inc.php b/html/includes/graphs/application/mysql_select_types.inc.php index 27b9ab262..e96b43c73 100644 --- a/html/includes/graphs/application/mysql_select_types.inc.php +++ b/html/includes/graphs/application/mysql_select_types.inc.php @@ -2,52 +2,37 @@ include("includes/graphs/common.inc.php"); -$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd"; -if (is_file($mysql_rrd)) +$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd'; + +$array = array( 'SFJn' => 'Full Join', + 'SFRJn' => 'Full Range', + 'SRe' => 'Range', + 'SRCk' => 'Range Check', + 'SSn' => 'Scan', +); + +$i = 0; +if (is_file($rrd_filename)) { - $rrd_filename = $mysql_rrd; -} + foreach ($array as $ds => $vars) + { + $rrd_list[$i]['filename'] = $rrd_filename; + if (is_array($vars)) + { + $rrd_list[$i]['descr'] = $vars['descr']; + } else { + $rrd_list[$i]['descr'] = $vars; + } + $rrd_list[$i]['ds'] = $ds; + $i++; + } +} else { echo("file missing: $file"); } -$rrd_options .= ' -b 1024 '; -$rrd_options .= ' -l 0 '; -$rrd_options .= ' DEF:a='.$rrd_filename.':SFJn:AVERAGE '; -$rrd_options .= ' DEF:b='.$rrd_filename.':SFRJn:AVERAGE '; -$rrd_options .= ' DEF:c='.$rrd_filename.':SRe:AVERAGE '; -$rrd_options .= ' DEF:d='.$rrd_filename.':SRCk:AVERAGE '; -$rrd_options .= ' DEF:e='.$rrd_filename.':SSn:AVERAGE '; -$rrd_options .= ' CDEF:total=a,b,c,d,e,+,+,+,+ '; +$colours = "mixed"; +$nototal = 0; +$unit_text = "Queries"; -$rrd_options .= 'COMMENT:" Current Average Maximum\n" '; +include("includes/graphs/generic_multi_simplex_seperated.inc.php"); -$rrd_options .= 'AREA:a#22FF22:"Full Join"\ \ '; -$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" '; - -$rrd_options .= 'AREA:b#0022FF:"Full Range"\ \ '; -$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" '; - -$rrd_options .= 'AREA:c#FF0000:"Range"\ \ '; -$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" '; - -$rrd_options .= 'AREA:d#00AAAA:"Range Check"\ \ '; -$rrd_options .= 'GPRINT:d:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:d:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:d:MAX:"%6.2lf %s\n" '; - -$rrd_options .= 'AREA:e#FF00FF:"Scan"\ \ '; -$rrd_options .= 'GPRINT:e:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:e:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:e:MAX:"%6.2lf %s\n" '; - -$rrd_options .= 'AREA:total#000000:"Total"\ \ '; -$rrd_options .= 'GPRINT:total:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:total:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:total:MAX:"%6.2lf %s\n" '; - -?> \ No newline at end of file +?> diff --git a/html/includes/graphs/application/mysql_slow_queries.inc.php b/html/includes/graphs/application/mysql_slow_queries.inc.php index 40b58a4a9..dfcf412ea 100644 --- a/html/includes/graphs/application/mysql_slow_queries.inc.php +++ b/html/includes/graphs/application/mysql_slow_queries.inc.php @@ -2,21 +2,34 @@ include("includes/graphs/common.inc.php"); -$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd"; +$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd'; -if (is_file($mysql_rrd)) +$array = array( + 'SQs' => 'Slow queries', +); + +$i = 0; +if (is_file($rrd_filename)) { - $rrd_filename = $mysql_rrd; -} + foreach ($array as $ds => $vars) + { + $rrd_list[$i]['filename'] = $rrd_filename; + if (is_array($vars)) + { + $rrd_list[$i]['descr'] = $vars['descr']; + } else { + $rrd_list[$i]['descr'] = $vars; + } + $rrd_list[$i]['ds'] = $ds; + $i++; + } +} else { echo("file missing: $file"); } -/* $rrd_options .= ' -b 1024 '; */ -$rrd_options .= ' DEF:a='.$rrd_filename.':SQs:AVERAGE '; +$colours = "mixed"; +$nototal = 1; +$unit_text = "Queries"; -$rrd_options .= 'COMMENT:" Current Average Maximum\n" '; +include("includes/graphs/generic_multi_simplex_seperated.inc.php"); -$rrd_options .= 'LINE2:a#22FF22:"Slow queries"\ \ '; -$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" '; -?> \ No newline at end of file +?> diff --git a/html/includes/graphs/application/mysql_sorts.inc.php b/html/includes/graphs/application/mysql_sorts.inc.php index 0c724cf5f..430758e6a 100644 --- a/html/includes/graphs/application/mysql_sorts.inc.php +++ b/html/includes/graphs/application/mysql_sorts.inc.php @@ -2,39 +2,38 @@ include("includes/graphs/common.inc.php"); -$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd"; +$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd'; -if (is_file($mysql_rrd)) +$array = array( + 'SRows' => 'Rows Sorted', + 'SRange' => 'Range', + 'SMPs' => 'Merge Passes', + 'SScan' => 'Scan', +); + +$i = 0; +if (is_file($rrd_filename)) { - $rrd_filename = $mysql_rrd; -} + foreach ($array as $ds => $vars) + { + $rrd_list[$i]['filename'] = $rrd_filename; + if (is_array($vars)) + { + $rrd_list[$i]['descr'] = $vars['descr']; + } else { + $rrd_list[$i]['descr'] = $vars; + } + $rrd_list[$i]['ds'] = $ds; + $i++; + } +} else { echo("file missing: $file"); } -$rrd_options .= ' -b 1000 '; -$rrd_options .= ' DEF:a='.$rrd_filename.':SRows:AVERAGE '; -$rrd_options .= ' DEF:b='.$rrd_filename.':SRange:AVERAGE '; -$rrd_options .= ' DEF:c='.$rrd_filename.':SMPs:AVERAGE '; -$rrd_options .= ' DEF:d='.$rrd_filename.':SScan:AVERAGE '; +$colours = "mixed"; +$nototal = 0; +$unit_text = ""; -$rrd_options .= 'COMMENT:"\t Current Average Maximum\n" '; +include("includes/graphs/generic_multi_simplex_seperated.inc.php"); -$rrd_options .= 'LINE2:a#22FF22:"Rows Sorted"\ \ '; -$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" '; -$rrd_options .= "LINE2:b#0022FF:Range\ \ "; -$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" '; -$rrd_options .= 'LINE2:c#FF0000:"Merge Passes"\ \ '; -$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" '; - -$rrd_options .= "LINE2:d#FF0000:Scan\ \ "; -$rrd_options .= 'GPRINT:d:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:d:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:d:MAX:"%6.2lf %s\n" '; - -?> \ No newline at end of file +?> diff --git a/html/includes/graphs/application/mysql_table_locks.inc.php b/html/includes/graphs/application/mysql_table_locks.inc.php index d9ce6c051..e5d91f0df 100644 --- a/html/includes/graphs/application/mysql_table_locks.inc.php +++ b/html/includes/graphs/application/mysql_table_locks.inc.php @@ -2,27 +2,36 @@ include("includes/graphs/common.inc.php"); -$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd"; +$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd'; -if (is_file($mysql_rrd)) +$array = array( + 'TLIe' => 'immed', + 'TLWd' => 'waited', +); + +$i = 0; +if (is_file($rrd_filename)) { - $rrd_filename = $mysql_rrd; -} + foreach ($array as $ds => $vars) + { + $rrd_list[$i]['filename'] = $rrd_filename; + if (is_array($vars)) + { + $rrd_list[$i]['descr'] = $vars['descr']; + } else { + $rrd_list[$i]['descr'] = $vars; + } + $rrd_list[$i]['ds'] = $ds; + $i++; + } +} else { echo("file missing: $file"); } -/* $rrd_options .= ' -b 1024 '; */ -$rrd_options .= ' DEF:a='.$rrd_filename.':TLIe:AVERAGE '; -$rrd_options .= ' DEF:b='.$rrd_filename.':TLWd:AVERAGE '; +$colours = "mixed"; +$nototal = 0; +$unit_text = "Table locks"; -$rrd_options .= 'COMMENT:" Current Average Maximum\n" '; +include("includes/graphs/generic_multi_simplex_seperated.inc.php"); -$rrd_options .= 'LINE2:a#00FF00:"Table locks immed"\ \ '; -$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" '; -$rrd_options .= 'LINE2:b#0022FF:"Table locks waited"\ \ '; -$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" '; -?> \ No newline at end of file +?> diff --git a/html/includes/graphs/application/mysql_temporary_objects.inc.php b/html/includes/graphs/application/mysql_temporary_objects.inc.php index e95b08d3a..cef2c8eb3 100644 --- a/html/includes/graphs/application/mysql_temporary_objects.inc.php +++ b/html/includes/graphs/application/mysql_temporary_objects.inc.php @@ -2,33 +2,37 @@ include("includes/graphs/common.inc.php"); -$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd"; +$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd'; -if (is_file($mysql_rrd)) +$array = array( + 'CTMPDTs' => 'disk tables', + 'CTMPTs' => 'tables', + 'CTMPFs' => 'files', +); + +$i = 0; +if (is_file($rrd_filename)) { - $rrd_filename = $mysql_rrd; -} + foreach ($array as $ds => $vars) + { + $rrd_list[$i]['filename'] = $rrd_filename; + if (is_array($vars)) + { + $rrd_list[$i]['descr'] = $vars['descr']; + } else { + $rrd_list[$i]['descr'] = $vars; + } + $rrd_list[$i]['ds'] = $ds; + $i++; + } +} else { echo("file missing: $file"); } -/* $rrd_options .= ' -b 1024 '; */ -$rrd_options .= ' DEF:a='.$rrd_filename.':CTMPDTs:AVERAGE '; -$rrd_options .= ' DEF:b='.$rrd_filename.':CTMPTs:AVERAGE '; -$rrd_options .= ' DEF:c='.$rrd_filename.':CTMPFs:AVERAGE '; +$colours = "mixed"; +$nototal = 0; +$unit_text = "Temp"; -$rrd_options .= 'COMMENT:" Current Average Maximum\n" '; +include("includes/graphs/generic_multi_simplex_seperated.inc.php"); -$rrd_options .= 'LINE2:a#22FF22:"Temp disk tables"\ \ '; -$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" '; -$rrd_options .= 'LINE2:b#0022FF:"Temp tables"\ \ '; -$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" '; -$rrd_options .= 'LINE2:c#FF0000:"Temp files"\ \ '; -$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" '; - -?> \ No newline at end of file +?>