|
| 1 | +/* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
| 2 | +
|
| 3 | + This program is free software; you can redistribute it and/or modify |
| 4 | + it under the terms of the GNU General Public License as published by |
| 5 | + the Free Software Foundation; version 2 of the License. |
| 6 | +
|
| 7 | + This program is distributed in the hope that it will be useful, |
| 8 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | + GNU General Public License for more details. |
| 11 | +
|
| 12 | + You should have received a copy of the GNU General Public License |
| 13 | + along with this program; if not, write to the Free Software |
| 14 | + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ |
| 15 | + |
| 16 | +/* |
| 17 | + * View: host_summary_by_file_io |
| 18 | + * |
| 19 | + * Summarizes file IO totals per host. |
| 20 | + * |
| 21 | + * mysql> select * from host_summary_by_file_io; |
| 22 | + * +------------+-------+------------+ |
| 23 | + * | host | ios | io_latency | |
| 24 | + * +------------+-------+------------+ |
| 25 | + * | hal1 | 26457 | 21.58 s | |
| 26 | + * | hal2 | 1189 | 394.21 ms | |
| 27 | + * +------------+-------+------------+ |
| 28 | + * |
| 29 | + */ |
| 30 | + |
| 31 | +CREATE OR REPLACE |
| 32 | + ALGORITHM = TEMPTABLE |
| 33 | + DEFINER = 'root'@'localhost' |
| 34 | + SQL SECURITY INVOKER |
| 35 | +VIEW host_summary_by_file_io ( |
| 36 | + host, |
| 37 | + ios, |
| 38 | + io_latency |
| 39 | +) AS |
| 40 | +SELECT host, |
| 41 | + SUM(total) AS ios, |
| 42 | + sys.format_time(SUM(latency)) AS io_latency |
| 43 | + FROM x$host_summary_by_file_io_type |
| 44 | + GROUP BY host |
| 45 | + ORDER BY SUM(latency) DESC; |
| 46 | + |
| 47 | +/* |
| 48 | + * View: x$host_summary_by_file_io |
| 49 | + * |
| 50 | + * Summarizes file IO totals per host. |
| 51 | + * |
| 52 | + * |
| 53 | + * mysql> select * from x$host_summary_by_file_io; |
| 54 | + * +------------+-------+----------------+ |
| 55 | + * | host | ios | io_latency | |
| 56 | + * +------------+-------+----------------+ |
| 57 | + * | hal1 | 26457 | 21579585586390 | |
| 58 | + * | hal2 | 1189 | 394212617370 | |
| 59 | + * +------------+-------+----------------+ |
| 60 | + * |
| 61 | + */ |
| 62 | + |
| 63 | +CREATE OR REPLACE |
| 64 | + ALGORITHM = TEMPTABLE |
| 65 | + DEFINER = 'root'@'localhost' |
| 66 | + SQL SECURITY INVOKER |
| 67 | +VIEW x$host_summary_by_file_io ( |
| 68 | + host, |
| 69 | + ios, |
| 70 | + io_latency |
| 71 | +) AS |
| 72 | +SELECT host, |
| 73 | + SUM(total) AS ios, |
| 74 | + SUM(latency) AS io_latency |
| 75 | + FROM x$host_summary_by_file_io_type |
| 76 | + GROUP BY host |
| 77 | + ORDER BY SUM(latency) DESC; |
0 commit comments