| 1 |
use ndbinfo; |
| 2 |
Show view definitions |
| 3 |
desc cpustat_50ms; |
| 4 |
Field Type Null Key Default Extra |
| 5 |
node_id int unsigned YES NULL |
| 6 |
thr_no int unsigned YES NULL |
| 7 |
OS_user_time int unsigned YES NULL |
| 8 |
OS_system_time int unsigned YES NULL |
| 9 |
OS_idle_time int unsigned YES NULL |
| 10 |
exec_time int unsigned YES NULL |
| 11 |
sleep_time int unsigned YES NULL |
| 12 |
spin_time int unsigned YES NULL |
| 13 |
send_time int unsigned YES NULL |
| 14 |
buffer_full_time int unsigned YES NULL |
| 15 |
elapsed_time int unsigned YES NULL |
| 16 |
desc cpustat_1sec; |
| 17 |
Field Type Null Key Default Extra |
| 18 |
node_id int unsigned YES NULL |
| 19 |
thr_no int unsigned YES NULL |
| 20 |
OS_user_time int unsigned YES NULL |
| 21 |
OS_system_time int unsigned YES NULL |
| 22 |
OS_idle_time int unsigned YES NULL |
| 23 |
exec_time int unsigned YES NULL |
| 24 |
sleep_time int unsigned YES NULL |
| 25 |
spin_time int unsigned YES NULL |
| 26 |
send_time int unsigned YES NULL |
| 27 |
buffer_full_time int unsigned YES NULL |
| 28 |
elapsed_time int unsigned YES NULL |
| 29 |
desc cpustat_20sec; |
| 30 |
Field Type Null Key Default Extra |
| 31 |
node_id int unsigned YES NULL |
| 32 |
thr_no int unsigned YES NULL |
| 33 |
OS_user_time int unsigned YES NULL |
| 34 |
OS_system_time int unsigned YES NULL |
| 35 |
OS_idle_time int unsigned YES NULL |
| 36 |
exec_time int unsigned YES NULL |
| 37 |
sleep_time int unsigned YES NULL |
| 38 |
spin_time int unsigned YES NULL |
| 39 |
send_time int unsigned YES NULL |
| 40 |
buffer_full_time int unsigned YES NULL |
| 41 |
elapsed_time int unsigned YES NULL |
| 42 |
desc cpustat; |
| 43 |
Field Type Null Key Default Extra |
| 44 |
node_id int unsigned YES NULL |
| 45 |
thr_no int unsigned YES NULL |
| 46 |
OS_user int unsigned YES NULL |
| 47 |
OS_system int unsigned YES NULL |
| 48 |
OS_idle int unsigned YES NULL |
| 49 |
thread_exec int unsigned YES NULL |
| 50 |
thread_sleeping int unsigned YES NULL |
| 51 |
thread_spinning int unsigned YES NULL |
| 52 |
thread_send int unsigned YES NULL |
| 53 |
thread_buffer_full int unsigned YES NULL |
| 54 |
elapsed_time int unsigned YES NULL |
| 55 |
Create temporary table for more diagnostics on failure |
| 56 |
create temporary table cpustat_sum ( |
| 57 |
tstamp timestamp, |
| 58 |
source char(20), |
| 59 |
cnt int, |
| 60 |
OS_user_time int, |
| 61 |
OS_system_time int, |
| 62 |
OS_idle_time int, |
| 63 |
exec_time int, |
| 64 |
sleep_time int, |
| 65 |
spin_time int, |
| 66 |
send_time int, |
| 67 |
buffer_flule_time int, |
| 68 |
elapsed_time int |
| 69 |
); |
| 70 |
Check that the tables 'fill' over time if they are not |
| 71 |
already full |
| 72 |
select @node_id:=node_id, @thr_no:=thr_no from cpustat_50ms limit 1; |
| 73 |
There should be no invalid lines. |
| 74 |
That is lines width longer duration than sampling period. |
| 75 |
Expect zero as result. |
| 76 |
select count(1) as invalid_lines from cpustat_50ms |
| 77 |
where node_id=@node_id and thr_no=@thr_no and |
| 78 |
OS_user_time > (2 * 1 * 1000000); |
| 79 |
invalid_lines |
| 80 |
0 |
| 81 |
select count(1) as invalid_lines from cpustat_1sec |
| 82 |
where node_id=@node_id and thr_no=@thr_no and |
| 83 |
OS_user_time > (2 * 20 * 1 * 1000000); |
| 84 |
invalid_lines |
| 85 |
0 |
| 86 |
select count(1) as invalid_lines from cpustat_20sec |
| 87 |
where node_id=@node_id and thr_no=@thr_no and |
| 88 |
OS_user_time > (2 * 20 * 20 * 1000000); |
| 89 |
invalid_lines |
| 90 |
0 |
| 91 |
Save line counts before sleep. |
| 92 |
select count(1) into @start_lines_50ms from cpustat_50ms |
| 93 |
where node_id=@node_id and thr_no=@thr_no; |
| 94 |
select count(1) into @start_lines_1sec from cpustat_1sec |
| 95 |
where node_id=@node_id and thr_no=@thr_no; |
| 96 |
select count(1) into @start_lines_20sec from cpustat_20sec |
| 97 |
where node_id=@node_id and thr_no=@thr_no; |
| 98 |
insert into cpustat_sum |
| 99 |
select now(), 'cpustat_50ms', count(*), |
| 100 |
sum(OS_user_time), sum(OS_system_time), sum(OS_idle_time), |
| 101 |
sum(exec_time), sum(sleep_time), sum(spin_time), |
| 102 |
sum(send_time), sum(buffer_full_time), sum(elapsed_time) |
| 103 |
from cpustat_50ms where node_id=@node_id and thr_no=@thr_no; |
| 104 |
insert into cpustat_sum |
| 105 |
select now(), 'cpustat_1sec', count(*), |
| 106 |
sum(OS_user_time), sum(OS_system_time), sum(OS_idle_time), |
| 107 |
sum(exec_time), sum(sleep_time), sum(spin_time), |
| 108 |
sum(send_time), sum(buffer_full_time), sum(elapsed_time) |
| 109 |
from cpustat_1sec where node_id=@node_id and thr_no=@thr_no; |
| 110 |
insert into cpustat_sum |
| 111 |
select now(), 'cpustat_20sec', count(*), |
| 112 |
sum(OS_user_time), sum(OS_system_time), sum(OS_idle_time), |
| 113 |
sum(exec_time), sum(sleep_time), sum(spin_time), |
| 114 |
sum(send_time), sum(buffer_full_time), sum(elapsed_time) |
| 115 |
from cpustat_20sec where node_id=@node_id and thr_no=@thr_no; |
| 116 |
select now() into @sleep_start; |
| 117 |
select now() into @sleep_end; |
| 118 |
insert into cpustat_sum |
| 119 |
select now(), 'cpustat_50ms', count(*), |
| 120 |
sum(OS_user_time), sum(OS_system_time), sum(OS_idle_time), |
| 121 |
sum(exec_time), sum(sleep_time), sum(spin_time), |
| 122 |
sum(send_time), sum(buffer_full_time), sum(elapsed_time) |
| 123 |
from cpustat_50ms where node_id=@node_id and thr_no=@thr_no; |
| 124 |
insert into cpustat_sum |
| 125 |
select now(), 'cpustat_1sec', count(*), |
| 126 |
sum(OS_user_time), sum(OS_system_time), sum(OS_idle_time), |
| 127 |
sum(exec_time), sum(sleep_time), sum(spin_time), |
| 128 |
sum(send_time), sum(buffer_full_time), sum(elapsed_time) |
| 129 |
from cpustat_1sec where node_id=@node_id and thr_no=@thr_no; |
| 130 |
insert into cpustat_sum |
| 131 |
select now(), 'cpustat_20sec', count(*), |
| 132 |
sum(OS_user_time), sum(OS_system_time), sum(OS_idle_time), |
| 133 |
sum(exec_time), sum(sleep_time), sum(spin_time), |
| 134 |
sum(send_time), sum(buffer_full_time), sum(elapsed_time) |
| 135 |
from cpustat_20sec where node_id=@node_id and thr_no=@thr_no; |
| 136 |
select count(1) as invalid_lines from cpustat_50ms |
| 137 |
where node_id=@node_id and thr_no=@thr_no and |
| 138 |
OS_user_time > (2 * 1 * 1000000); |
| 139 |
invalid_lines |
| 140 |
0 |
| 141 |
select count(1) as invalid_lines from cpustat_1sec |
| 142 |
where node_id=@node_id and thr_no=@thr_no and |
| 143 |
OS_user_time > (2 * 20 * 1 * 1000000); |
| 144 |
invalid_lines |
| 145 |
0 |
| 146 |
select count(1) as invalid_lines from cpustat_20sec |
| 147 |
where node_id=@node_id and thr_no=@thr_no and |
| 148 |
OS_user_time > (2 * 20 * 20 * 1000000); |
| 149 |
invalid_lines |
| 150 |
0 |
| 151 |
Save line counts after sleep. |
| 152 |
select count(1) into @later_lines_50ms from cpustat_50ms |
| 153 |
where node_id=@node_id and thr_no=@thr_no; |
| 154 |
select count(1) into @later_lines_1sec from cpustat_1sec |
| 155 |
where node_id=@node_id and thr_no=@thr_no; |
| 156 |
select count(1) into @later_lines_20sec from cpustat_20sec |
| 157 |
where node_id=@node_id and thr_no=@thr_no; |
| 158 |
drop table cpustat_sum; |