MySQL 8.4.3
Source Code Documentation
|
Profiling state for a single THD; contains multiple QUERY_PROFILE objects. More...
#include <sql_profile.h>
Public Member Functions | |
PROFILING () | |
~PROFILING () | |
void | set_query_source (const char *query_source_arg, size_t query_length_arg) |
At a point in execution where we know the query source, save the text of it in the query profile. More... | |
void | start_new_query (const char *initial_state="starting") |
Prepare to start processing a new query. More... | |
void | discard_current_query () |
Throw away the current profile, because it's useless or unwanted or corrupted. More... | |
void | finish_current_query () |
Try to save the current profile entry, clean up the data if it shouldn't be saved, and maintain the profile history size. More... | |
void | status_change (const char *status_arg, const char *function_arg, const char *file_arg, unsigned int line_arg) |
A new state is given, and that signals the profiler to start a new timed step for the current query's profile. More... | |
void | set_thd (THD *thd_arg) |
bool | show_profiles () |
int | fill_statistics_info (THD *thd, Table_ref *tables) |
Fill the information schema table, "query_profile", as defined in show.cc . More... | |
void | cleanup () |
Clear all the profiling information. More... | |
Private Member Functions | |
query_id_t | next_profile_id () |
Private Attributes | |
query_id_t | profile_id_counter |
THD * | thd |
bool | keeping |
bool | enabled |
QUERY_PROFILE * | current |
QUERY_PROFILE * | last |
Queue< QUERY_PROFILE > | history |
Friends | |
class | PROF_MEASUREMENT |
class | QUERY_PROFILE |
Profiling state for a single THD; contains multiple QUERY_PROFILE objects.
PROFILING::PROFILING | ( | ) |
PROFILING::~PROFILING | ( | ) |
void PROFILING::cleanup | ( | void | ) |
Clear all the profiling information.
void PROFILING::discard_current_query | ( | ) |
Throw away the current profile, because it's useless or unwanted or corrupted.
Fill the information schema table, "query_profile", as defined in show.cc .
There are two ways to get to this function: Selecting from the information schema, and a SHOW command.
void PROFILING::finish_current_query | ( | ) |
Try to save the current profile entry, clean up the data if it shouldn't be saved, and maintain the profile history size.
Naturally, this may not succeed if the profile was previously discarded, and that's expected.
|
inlineprivate |
void PROFILING::set_query_source | ( | const char * | query_source_arg, |
size_t | query_length_arg | ||
) |
At a point in execution where we know the query source, save the text of it in the query profile.
This must be called exactly once per descrete statement.
|
inline |
bool PROFILING::show_profiles | ( | ) |
void PROFILING::start_new_query | ( | const char * | initial_state = "starting" | ) |
Prepare to start processing a new query.
It is an error to do this if there's a query already in process; nesting is not supported.
initial_state | (optional) name of period before first state change |
void PROFILING::status_change | ( | const char * | status_arg, |
const char * | function_arg, | ||
const char * | file_arg, | ||
unsigned int | line_arg | ||
) |
A new state is given, and that signals the profiler to start a new timed step for the current query's profile.
status_arg | name of this step |
function_arg | calling function (usually supplied from compiler) |
file_arg | calling file (usually supplied from compiler) |
line_arg | calling line number (usually supplied from compiler) |
|
friend |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |