mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
WL#2360 Performance schema
Part V: performance schema implementation
This commit is contained in:
63
mysql-test/suite/perfschema/t/myisam_file_io.test
Normal file
63
mysql-test/suite/perfschema/t/myisam_file_io.test
Normal file
@@ -0,0 +1,63 @@
|
||||
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
# Tests for PERFORMANCE_SCHEMA
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_perfschema.inc
|
||||
|
||||
# Setup
|
||||
|
||||
update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
|
||||
update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
|
||||
where name like "wait/io/file/myisam/%";
|
||||
|
||||
update performance_schema.SETUP_CONSUMERS
|
||||
set enabled='YES';
|
||||
|
||||
truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG;
|
||||
|
||||
# Code to test
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists test.no_index_tab;
|
||||
--enable_warnings
|
||||
|
||||
create table test.no_index_tab ( a varchar(255), b int ) engine=myisam;
|
||||
insert into no_index_tab set a = 'foo', b = 1;
|
||||
insert into no_index_tab set a = 'foo', b = 1;
|
||||
insert into no_index_tab set a = 'foo', b = 1;
|
||||
|
||||
# Verification
|
||||
# Note that mi_create.c contains mysql_file_tell() calls in debug only,
|
||||
# so the result are filtered to remove 'tell'.
|
||||
|
||||
select event_name,
|
||||
left(source, locate(":", source)) as short_source,
|
||||
operation, number_of_bytes,
|
||||
substring(object_name, locate("no_index_tab", object_name)) as short_name
|
||||
from performance_schema.EVENTS_WAITS_HISTORY_LONG
|
||||
where operation not like "tell"
|
||||
order by thread_id, event_id;
|
||||
|
||||
# In case of failures, this will tell if file io are lost.
|
||||
show status like 'performance_schema_%';
|
||||
|
||||
# Cleanup
|
||||
|
||||
update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
|
||||
|
||||
drop table test.no_index_tab;
|
||||
|
||||
Reference in New Issue
Block a user