MySQL 8.4 Release Notes
Returns YES or NO to
indicate whether Performance Schema instrumentation for a
given connection ID is enabled, UNKNOWN if
the ID is unknown, or NULL if the ID is
NULL.
in_connection_id BIGINT UNSIGNED: The connection ID. This is a value of the type given in thePROCESSLIST_IDcolumn of the Performance Schemathreadstable or theIdcolumn ofSHOW PROCESSLISToutput.
mysql> SELECT sys.ps_is_thread_instrumented(43);
+-----------------------------------+
| sys.ps_is_thread_instrumented(43) |
+-----------------------------------+
| UNKNOWN |
+-----------------------------------+
mysql> SELECT sys.ps_is_thread_instrumented(CONNECTION_ID());
+------------------------------------------------+
| sys.ps_is_thread_instrumented(CONNECTION_ID()) |
+------------------------------------------------+
| YES |
+------------------------------------------------+