The ps_is_thread_instrumented function checks whether a specific thread ID is currently instrumented by the Performance Schema.
sys.ps_is_thread_instrumented(connection_id)ps_is_thread_instrumented is a available with the that returns whether or not Performance Schema instrumentation for the given connection_id is enabled.
YES - instrumentation is enabled
NO - instrumentation is not enabled
UNKNOWN - the connection ID is unknown
This page is licensed: CC BY-SA / Gnu FDL
NULL - NULL valueSELECT sys.ps_is_thread_instrumented(CONNECTION_ID());
+------------------------------------------------+
| sys.ps_is_thread_instrumented(CONNECTION_ID()) |
+------------------------------------------------+
| YES |
+------------------------------------------------+
SELECT sys.ps_is_thread_instrumented(2042);
+-------------------------------------+
| sys.ps_is_thread_instrumented(2042) |
+-------------------------------------+
| UNKNOWN |
+-------------------------------------+
SELECT sys.ps_is_thread_instrumented(NULL);
+-------------------------------------+
| sys.ps_is_thread_instrumented(NULL) |
+-------------------------------------+
| NULL |
+-------------------------------------+