In MySQL, we can use the sys.ps_is_thread_instrumented()
function to check whether Performance Schema instrumentation for a given connection ID is enabled.
The function returns YES
or NO
, depending on whether the instrumentation is enabled for the given connection. It can also return UNKNOWN
if the connection ID is unknown, and NULL
if the connection ID is NULL
.