Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit 6260437

Browse files
committed
Add procedures to show enabled / disabled instruments and consumers specifically (rather than all together).
1 parent 65ebed8 commit 6260437

File tree

7 files changed

+297
-0
lines changed

7 files changed

+297
-0
lines changed

README.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,6 +1807,48 @@ Empty set (0.00 sec)
18071807
Query OK, 0 rows affected (0.01 sec)
18081808
```
18091809

1810+
#### ps_setup_show_disabled_consumers
1811+
1812+
##### Description
1813+
1814+
Shows all currently disabled consumers.
1815+
1816+
##### Parameters
1817+
1818+
None
1819+
1820+
##### Example
1821+
1822+
```SQL
1823+
mysql> CALL sys.ps_setup_show_disabled_consumers();
1824+
1825+
+---------------------------+
1826+
| disabled_consumers |
1827+
+---------------------------+
1828+
| events_statements_current |
1829+
| global_instrumentation |
1830+
| thread_instrumentation |
1831+
| statements_digest |
1832+
+---------------------------+
1833+
4 rows in set (0.05 sec)
1834+
```
1835+
1836+
#### ps_setup_show_disabled_instruments
1837+
1838+
##### Description
1839+
1840+
Shows all currently disabled instruments.
1841+
1842+
##### Parameters
1843+
1844+
None
1845+
1846+
##### Example
1847+
1848+
```SQL
1849+
mysql> CALL sys.ps_setup_show_disabled_instruments();
1850+
```
1851+
18101852
#### ps_setup_show_enabled
18111853

18121854
##### Description
@@ -1881,6 +1923,48 @@ mysql> CALL sys.ps_setup_show_enabled(TRUE, TRUE);
18811923
Query OK, 0 rows affected (0.89 sec)
18821924
```
18831925

1926+
#### ps_setup_show_enabled_consumers
1927+
1928+
##### Description
1929+
1930+
Shows all currently enabled consumers.
1931+
1932+
##### Parameters
1933+
1934+
None
1935+
1936+
##### Example
1937+
1938+
```SQL
1939+
mysql> CALL sys.ps_setup_show_enabled_consumers();
1940+
1941+
+---------------------------+
1942+
| enabled_consumers |
1943+
+---------------------------+
1944+
| events_statements_current |
1945+
| global_instrumentation |
1946+
| thread_instrumentation |
1947+
| statements_digest |
1948+
+---------------------------+
1949+
4 rows in set (0.05 sec)
1950+
```
1951+
1952+
#### ps_setup_show_enabled_instruments
1953+
1954+
##### Description
1955+
1956+
Shows all currently enabled instruments.
1957+
1958+
##### Parameters
1959+
1960+
None
1961+
1962+
##### Example
1963+
1964+
```SQL
1965+
mysql> CALL sys.ps_setup_show_enabled_instruments();
1966+
```
1967+
18841968
#### ps_statement_avg_latency_histogram
18851969

18861970
##### Description
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
DROP PROCEDURE IF EXISTS ps_setup_show_disabled_consumers;
17+
18+
DELIMITER $$
19+
20+
CREATE DEFINER='root'@'localhost' PROCEDURE ps_setup_show_disabled_consumers ()
21+
COMMENT '
22+
Description
23+
-----------
24+
25+
Shows all currently disabled consumers.
26+
27+
Parameters
28+
-----------
29+
30+
None
31+
32+
Example
33+
-----------
34+
35+
mysql> CALL sys.ps_setup_show_disabled_consumers();
36+
37+
+---------------------------+
38+
| disabled_consumers |
39+
+---------------------------+
40+
| events_statements_current |
41+
| global_instrumentation |
42+
| thread_instrumentation |
43+
| statements_digest |
44+
+---------------------------+
45+
4 rows in set (0.05 sec)
46+
'
47+
SQL SECURITY INVOKER
48+
DETERMINISTIC
49+
READS SQL DATA
50+
BEGIN
51+
SELECT name AS disabled_consumers
52+
FROM performance_schema.setup_consumers
53+
WHERE enabled = 'NO';
54+
END$$
55+
56+
DELIMITER ;
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
DROP PROCEDURE IF EXISTS ps_setup_show_disabled_instruments;
17+
18+
DELIMITER $$
19+
20+
CREATE DEFINER='root'@'localhost' PROCEDURE ps_setup_show_disabled_instruments ()
21+
COMMENT '
22+
Description
23+
-----------
24+
25+
Shows all currently disabled instruments.
26+
27+
Parameters
28+
-----------
29+
30+
None
31+
32+
Example
33+
-----------
34+
35+
mysql> CALL sys.ps_setup_show_disabled_instruments();
36+
'
37+
SQL SECURITY INVOKER
38+
DETERMINISTIC
39+
READS SQL DATA
40+
BEGIN
41+
SELECT name AS disabled_instruments, timed
42+
FROM performance_schema.setup_instruments
43+
WHERE enabled = 'NO';
44+
END$$
45+
46+
DELIMITER ;
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
DROP PROCEDURE IF EXISTS ps_setup_show_enabled_consumers;
17+
18+
DELIMITER $$
19+
20+
CREATE DEFINER='root'@'localhost' PROCEDURE ps_setup_show_enabled_consumers ()
21+
COMMENT '
22+
Description
23+
-----------
24+
25+
Shows all currently enabled consumers.
26+
27+
Parameters
28+
-----------
29+
30+
None
31+
32+
Example
33+
-----------
34+
35+
mysql> CALL sys.ps_setup_show_enabled_consumers();
36+
37+
+---------------------------+
38+
| enabled_consumers |
39+
+---------------------------+
40+
| events_statements_current |
41+
| global_instrumentation |
42+
| thread_instrumentation |
43+
| statements_digest |
44+
+---------------------------+
45+
4 rows in set (0.05 sec)
46+
'
47+
SQL SECURITY INVOKER
48+
DETERMINISTIC
49+
READS SQL DATA
50+
BEGIN
51+
SELECT name AS enabled_consumers
52+
FROM performance_schema.setup_consumers
53+
WHERE enabled = 'YES';
54+
END$$
55+
56+
DELIMITER ;
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
DROP PROCEDURE IF EXISTS ps_setup_show_enabled_instruments
17+
;
18+
19+
DELIMITER $$
20+
21+
CREATE DEFINER='root'@'localhost' PROCEDURE ps_setup_show_enabled_instruments ()
22+
COMMENT '
23+
Description
24+
-----------
25+
26+
Shows all currently enabled instruments.
27+
28+
Parameters
29+
-----------
30+
31+
None
32+
33+
Example
34+
-----------
35+
36+
mysql> CALL sys.ps_setup_show_enabled_instruments();
37+
'
38+
SQL SECURITY INVOKER
39+
DETERMINISTIC
40+
READS SQL DATA
41+
BEGIN
42+
SELECT name AS enabled_instruments, timed
43+
FROM performance_schema.setup_instruments
44+
WHERE enabled = 'YES';
45+
END$$
46+
47+
DELIMITER ;

sys_56.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ SOURCE ./procedures/ps_setup_reload_saved.sql
4444
SOURCE ./procedures/ps_setup_reset_to_default.sql
4545
SOURCE ./procedures/ps_setup_save.sql
4646
SOURCE ./procedures/ps_setup_show_disabled.sql
47+
SOURCE ./procedures/ps_setup_show_disabled_consumers.sql
48+
SOURCE ./procedures/ps_setup_show_disabled_instruments.sql
4749
SOURCE ./procedures/ps_setup_show_enabled.sql
50+
SOURCE ./procedures/ps_setup_show_enabled_consumers.sql
51+
SOURCE ./procedures/ps_setup_show_enabled_instruments.sql
4852
SOURCE ./procedures/ps_truncate_all_tables.sql
4953

5054
SOURCE ./views/i_s/innodb_buffer_stats_by_schema.sql

sys_57.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ SOURCE ./procedures/ps_setup_reload_saved.sql
4444
SOURCE ./procedures/ps_setup_reset_to_default_57.sql
4545
SOURCE ./procedures/ps_setup_save.sql
4646
SOURCE ./procedures/ps_setup_show_disabled.sql
47+
SOURCE ./procedures/ps_setup_show_disabled_consumers.sql
48+
SOURCE ./procedures/ps_setup_show_disabled_instruments.sql
4749
SOURCE ./procedures/ps_setup_show_enabled.sql
50+
SOURCE ./procedures/ps_setup_show_enabled_consumers.sql
51+
SOURCE ./procedures/ps_setup_show_enabled_instruments.sql
4852
SOURCE ./procedures/ps_truncate_all_tables.sql
4953

5054
SOURCE ./views/i_s/innodb_buffer_stats_by_schema.sql

0 commit comments

Comments
 (0)