| 219 | |
| 220 | |
| 221 | static void query_response_time_audit_notify(MYSQL_THD thd, |
| 222 | unsigned int event_class, |
| 223 | const void *event) |
| 224 | { |
| 225 | const struct mysql_event_general *event_general= |
| 226 | (const struct mysql_event_general *) event; |
| 227 | DBUG_ASSERT(event_class == MYSQL_AUDIT_GENERAL_CLASS); |
| 228 | |
| 229 | if (event_general->event_subclass == MYSQL_AUDIT_GENERAL_STATUS && |
| 230 | query_response_time_should_log(thd)) |
| 231 | { |
| 232 | bool stmt_changes_data= is_update_query(thd->last_sql_command) |
| 233 | || thd->transaction->stmt.is_trx_read_write(); |
| 234 | QUERY_TYPE query_type= stmt_changes_data ? WRITE : READ; |
| 235 | #ifndef DBUG_OFF |
| 236 | if (THDVAR(thd, exec_time_debug)) |
| 237 | { |
| 238 | /* This code is only here for MTR tests */ |
| 239 | query_response_time_collect(query_type, |
| 240 | thd->lex->sql_command != SQLCOM_SET_OPTION ? |
| 241 | THDVAR(thd, exec_time_debug) : 0); |
| 242 | } |
| 243 | else |
| 244 | #endif |
| 245 | { |
| 246 | DBUG_ASSERT(thd->utime_after_query >= thd->utime_after_lock); |
| 247 | query_response_time_collect(query_type, |
| 248 | thd->utime_after_query - |
| 249 | thd->utime_after_lock); |
| 250 | } |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | |
| 255 | static struct st_mysql_audit query_response_time_audit_descriptor= |
nothing calls this directly
no test coverage detected