~ubuntu-branches/ubuntu/trusty/mariadb-5.5/trusty-proposed

« back to all changes in this revision

Viewing changes to mysql-test/suite/perfschema/t/relaylog.test

  • Committer: Package Import Robot
  • Author(s): Otto Kekäläinen
  • Date: 2013-12-22 10:27:05 UTC
  • Revision ID: package-import@ubuntu.com-20131222102705-mndw7s12mz0szrcn
Tags: upstream-5.5.32
Import upstream version 5.5.32

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Tests for PERFORMANCE_SCHEMA
 
2
 
 
3
--source include/have_log_bin.inc
 
4
--source include/not_embedded.inc
 
5
--source include/have_perfschema.inc
 
6
--source include/master-slave.inc
 
7
 
 
8
--disable_warnings
 
9
drop table if exists test.t1;
 
10
--sync_slave_with_master
 
11
reset master;
 
12
--enable_warnings
 
13
 
 
14
create table test.t1(a int);
 
15
drop table test.t1;
 
16
 
 
17
--source include/show_binlog_events.inc
 
18
 
 
19
# Notes
 
20
#
 
21
# The point of this test is to make sure code is properly instrumented,
 
22
# where instruments have the proper key (binlog or relaylog),
 
23
# it is not to dive into statistics for each instruments.
 
24
# Different test execution sequence in different platforms do make the
 
25
# results vary, making the test results very sensitive to changes.
 
26
# To ensure robustness:
 
27
# - log file rotation is limited to file .000001 and .000002
 
28
# - statistics are normalized to "NONE" or "MANY"
 
29
# - statistics on ::update_cond conditions are not collected,
 
30
#   since this is too much dependent on execution.
 
31
#
 
32
 
 
33
connection master;
 
34
-- echo "============ Performance schema on master ============"
 
35
 
 
36
select
 
37
  substring(file_name, locate("master-", file_name)) as FILE_NAME,
 
38
  EVENT_NAME,
 
39
  if (count_read > 0, "MANY", "NONE") as COUNT_READ,
 
40
  if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
 
41
  if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
 
42
  if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
 
43
  from performance_schema.file_summary_by_instance
 
44
  where file_name like "%master-%" order by file_name;
 
45
 
 
46
select * from performance_schema.file_summary_by_instance
 
47
  where file_name like "%slave-%" order by file_name;
 
48
 
 
49
-- echo "Expect a master binlog + binlog_index"
 
50
 
 
51
select
 
52
  substring(file_name, locate("master-", file_name)) as FILE_NAME,
 
53
  EVENT_NAME,
 
54
  if (count_read > 0, "MANY", "NONE") as COUNT_READ,
 
55
  if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
 
56
  if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
 
57
  if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
 
58
  from performance_schema.file_summary_by_instance
 
59
  where event_name like "%binlog%" order by file_name;
 
60
 
 
61
select
 
62
  EVENT_NAME,
 
63
  if (count_read > 0, "MANY", "NONE") as COUNT_READ,
 
64
  if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
 
65
  if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
 
66
  if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
 
67
  from performance_schema.file_summary_by_event_name
 
68
  where event_name like "%binlog%" order by event_name;
 
69
 
 
70
select
 
71
  EVENT_NAME,
 
72
  if (count_star > 0, "MANY", "NONE") as COUNT_STAR
 
73
  from performance_schema.events_waits_summary_global_by_event_name
 
74
  where event_name like "%MYSQL_BIN_LOG%"
 
75
  and event_name not like "%MYSQL_BIN_LOG::update_cond"
 
76
  order by event_name;
 
77
 
 
78
-- echo "Expect no slave relay log"
 
79
 
 
80
select * from performance_schema.file_summary_by_instance
 
81
  where event_name like "%relaylog%" order by file_name;
 
82
 
 
83
select * from performance_schema.file_summary_by_event_name
 
84
  where event_name like "%relaylog%" order by event_name;
 
85
 
 
86
select * from performance_schema.events_waits_summary_global_by_event_name
 
87
  where event_name like "%MYSQL_RELAY_LOG%"
 
88
  and event_name not like "%MYSQL_RELAY_LOG::update_cond"
 
89
  order by event_name;
 
90
 
 
91
sync_slave_with_master;
 
92
-- echo "============ Performance schema on slave ============"
 
93
 
 
94
select * from performance_schema.file_summary_by_instance
 
95
  where file_name like "%master-%" order by file_name;
 
96
 
 
97
select
 
98
  substring(file_name, locate("slave-", file_name)) as FILE_NAME,
 
99
  EVENT_NAME,
 
100
  if (count_read > 0, "MANY", "NONE") as COUNT_READ,
 
101
  if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
 
102
  if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
 
103
  if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
 
104
  from performance_schema.file_summary_by_instance
 
105
  where file_name like "%slave-%"
 
106
  and (file_name not like "%slave-relay-bin.0%"
 
107
       or file_name like "%slave-relay-bin.000001"
 
108
       or file_name like "%slave-relay-bin.000002")
 
109
  order by file_name;
 
110
 
 
111
-- echo "Expect a slave binlog + binlog_index"
 
112
 
 
113
select
 
114
  substring(file_name, locate("slave-", file_name)) as FILE_NAME,
 
115
  EVENT_NAME,
 
116
  if (count_read > 0, "MANY", "NONE") as COUNT_READ,
 
117
  if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
 
118
  if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
 
119
  if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
 
120
  from performance_schema.file_summary_by_instance
 
121
  where event_name like "%binlog%" order by file_name;
 
122
 
 
123
select
 
124
  EVENT_NAME,
 
125
  if (count_read > 0, "MANY", "NONE") as COUNT_READ,
 
126
  if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
 
127
  if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
 
128
  if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
 
129
  from performance_schema.file_summary_by_event_name
 
130
  where event_name like "%binlog%" order by event_name;
 
131
 
 
132
select
 
133
  EVENT_NAME,
 
134
  if (count_star > 0, "MANY", "NONE") as COUNT_STAR
 
135
  from performance_schema.events_waits_summary_global_by_event_name
 
136
  where event_name like "%MYSQL_BIN_LOG%"
 
137
  and event_name not like "%MYSQL_BIN_LOG::update_cond"
 
138
  order by event_name;
 
139
 
 
140
-- echo "Expect a slave relay log"
 
141
 
 
142
select
 
143
  substring(file_name, locate("slave-", file_name)) as FILE_NAME,
 
144
  EVENT_NAME,
 
145
  if (count_read > 0, "MANY", "NONE") as COUNT_READ,
 
146
  if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
 
147
  if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
 
148
  if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
 
149
  from performance_schema.file_summary_by_instance
 
150
  where event_name like "%relaylog%"
 
151
  and (file_name not like "%slave-relay-bin.0%"
 
152
       or file_name like "%slave-relay-bin.000001"
 
153
       or file_name like "%slave-relay-bin.000002")
 
154
  order by file_name;
 
155
 
 
156
select
 
157
  EVENT_NAME,
 
158
  if (count_read > 0, "MANY", "NONE") as COUNT_READ,
 
159
  if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
 
160
  if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
 
161
  if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
 
162
  from performance_schema.file_summary_by_event_name
 
163
  where event_name like "%relaylog%" order by event_name;
 
164
 
 
165
select
 
166
  EVENT_NAME,
 
167
  if (count_star > 0, "MANY", "NONE") as COUNT_STAR
 
168
  from performance_schema.events_waits_summary_global_by_event_name
 
169
  where event_name like "%MYSQL_RELAY_LOG%"
 
170
  and event_name not like "%MYSQL_RELAY_LOG::update_cond"
 
171
  order by event_name;
 
172
 
 
173
--source include/stop_slave.inc
 
174