29.4.2 Performance Schema Event Filtering (original) (raw)

The world's most popular open source database

29.4.2 Performance Schema Event Filtering

Events are processed in a producer/consumer fashion:

mysql> SELECT NAME, ENABLED, TIMED  
       FROM performance_schema.setup_instruments;  
+---------------------------------------------------+---------+-------+  
| NAME                                              | ENABLED | TIMED |  
+---------------------------------------------------+---------+-------+  
...  
| wait/synch/mutex/sql/LOCK_global_read_lock        | YES     | YES   |  
| wait/synch/mutex/sql/LOCK_global_system_variables | YES     | YES   |  
| wait/synch/mutex/sql/LOCK_lock_db                 | YES     | YES   |  
| wait/synch/mutex/sql/LOCK_manager                 | YES     | YES   |  
...  

The setup_instruments table provides the most basic form of control over event production. To further refine event production based on the type of object or thread being monitored, other tables may be used as described inSection 29.4.3, “Event Pre-Filtering”.

mysql> SELECT * FROM performance_schema.setup_consumers;  
+----------------------------------+---------+  
| NAME                             | ENABLED |  
+----------------------------------+---------+  
| events_stages_current            | NO      |  
| events_stages_history            | NO      |  
| events_stages_history_long       | NO      |  
| events_statements_cpu            | NO      |  
| events_statements_current        | YES     |  
| events_statements_history        | YES     |  
| events_statements_history_long   | NO      |  
| events_transactions_current      | YES     |  
| events_transactions_history      | YES     |  
| events_transactions_history_long | NO      |  
| events_waits_current             | NO      |  
| events_waits_history             | NO      |  
| events_waits_history_long        | NO      |  
| global_instrumentation           | YES     |  
| thread_instrumentation           | YES     |  
| statements_digest                | YES     |  
+----------------------------------+---------+  

Filtering can be done at different stages of performance monitoring:

The following sections provide more detail about pre-filtering and provide guidelines for naming instruments or consumers in filtering operations. For information about writing queries to retrieve information (post-filtering), seeSection 29.5, “Performance Schema Queries”.