MySQL 9.1.0
Source Code Documentation
|
#include "server_logs_component.h"
#include <mysql/psi/mysql_telemetry_logs_client.h>
#include <chrono>
#include <map>
#include "mysqld_error.h"
#include "server_logs_helpers.h"
Functions | |
REQUIRES_SERVICE_PLACEHOLDER (log_builtins) | |
REQUIRES_SERVICE_PLACEHOLDER (log_builtins_string) | |
REQUIRES_SERVICE_PLACEHOLDER_AS (udf_registration, udf_registration_srv) | |
REQUIRES_SERVICE_PLACEHOLDER (mysql_server_telemetry_logs_client) | |
static int | register_loggers () |
static void | unregister_loggers () |
static bool | log_service_init () |
logger services initialization method for Component used when loading the Component. More... | |
static bool | log_service_deinit () |
logger services de-initialization method for Component used when unloading the Component. More... | |
static long long | test_emit_log (UDF_INIT *init, UDF_ARGS *args, unsigned char *null_value, unsigned char *error) |
Implements test_emit_log UDF. More... | |
static long long | test_emit_log_with_attributes (UDF_INIT *init, UDF_ARGS *args, unsigned char *null_value, unsigned char *error) |
Implements test_emit_log_with_attributes UDF. More... | |
static long long | test_log_registration (UDF_INIT *init, UDF_ARGS *args, unsigned char *null_value, unsigned char *error) |
Register/unregister loggers multiple times leaving "holes" in array of logger instruments, so we can test if performance_schema.setup_loggers table correctly handles such case. More... | |
static long long | test_log_wrappers (UDF_INIT *init, UDF_ARGS *args, unsigned char *null_value, unsigned char *error) |
Test C++ wrappers around telemetry logging API. More... | |
static long long | test_invalid_operations (UDF_INIT *init, UDF_ARGS *args, unsigned char *null_value, unsigned char *error) |
Test error handling by triggering some invalid API calls. More... | |
static long long | test_error_log (UDF_INIT *init, UDF_ARGS *args, unsigned char *null_value, unsigned char *error) |
Test that MySQL error log entries are also emitted as telemetry logs. More... | |
static void | unregister_udf () |
static bool | register_udf () |
mysql_service_status_t | test_server_telemetry_logs_component_init () |
Initialize the test_server_telemetry_logs component at server start or component installation: More... | |
mysql_service_status_t | test_server_telemetry_logs_component_deinit () |
Terminate the test_server_telemetry_logs_component at server shutdown or component deinstallation: More... | |
END_COMPONENT_PROVIDES () | |
REQUIRES_SERVICE (log_builtins) | |
REQUIRES_SERVICE (log_builtins_string) | |
REQUIRES_SERVICE (mysql_server_telemetry_logs_client) | |
REQUIRES_SERVICE_AS (udf_registration, udf_registration_srv) | |
END_COMPONENT_REQUIRES () | |
METADATA ("mysql.author", "Oracle Corporation") | |
METADATA ("mysql.license", "GPL") | |
METADATA ("test_property", "1") | |
END_COMPONENT_METADATA () | |
Variables | |
static FileLogger | g_log ("test_server_telemetry_logs_component.log") |
PSI_logger_key | test1_logger_key = 0 |
PSI_logger_key | test2_logger_key = 0 |
PSI_logger_key | test3_logger_key = 0 |
PSI_logger_key | test4_logger_key = 0 |
PSI_logger_info_v1 | g_loggers [] |
PSI_logger_info_v1 | g_loggers1 [] |
const mysql_service_log_builtins_t * | log_bi |
accessor built-ins More... | |
const mysql_service_log_builtins_string_t * | log_bs |
string built-ins More... | |
mysql_component_t | mysql_component_test_server_telemetry_logs_client |
END_COMPONENT_METADATA | ( | ) |
END_COMPONENT_PROVIDES | ( | ) |
END_COMPONENT_REQUIRES | ( | ) |
|
static |
logger services de-initialization method for Component used when unloading the Component.
false | success |
true | failure |
|
static |
logger services initialization method for Component used when loading the Component.
false | success |
true | failure |
METADATA | ( | "mysql.author" | , |
"Oracle Corporation" | |||
) |
METADATA | ( | "mysql.license" | , |
"GPL" | |||
) |
METADATA | ( | "test_property" | , |
"1" | |||
) |
|
static |
|
static |
REQUIRES_SERVICE | ( | log_builtins | ) |
REQUIRES_SERVICE | ( | log_builtins_string | ) |
REQUIRES_SERVICE | ( | mysql_server_telemetry_logs_client | ) |
REQUIRES_SERVICE_AS | ( | udf_registration | , |
udf_registration_srv | |||
) |
REQUIRES_SERVICE_PLACEHOLDER | ( | log_builtins | ) |
REQUIRES_SERVICE_PLACEHOLDER | ( | log_builtins_string | ) |
REQUIRES_SERVICE_PLACEHOLDER | ( | mysql_server_telemetry_logs_client | ) |
REQUIRES_SERVICE_PLACEHOLDER_AS | ( | udf_registration | , |
udf_registration_srv | |||
) |
|
static |
Implements test_emit_log UDF.
This function generates and emits a single test log record.
init | Unused. |
args | Unused. |
null_value | Unused. |
error | Unused. |
0 | This function always returns 0. |
|
static |
Implements test_emit_log_with_attributes UDF.
This function generates and emits a single test log record with some test attributes.
init | Unused. |
args | Unused. |
null_value | Unused. |
error | Unused. |
0 | This function always returns 0. |
|
static |
Test that MySQL error log entries are also emitted as telemetry logs.
init | Unused. |
args | Unused. |
null_value | Unused. |
error | Unused. |
0 | This function always returns 0. |
|
static |
Test error handling by triggering some invalid API calls.
The call of this function also increases code coverage.
init | Unused. |
args | Unused. |
null_value | Unused. |
error | Unused. |
0 | This function always returns 0. |
|
static |
Register/unregister loggers multiple times leaving "holes" in array of logger instruments, so we can test if performance_schema.setup_loggers table correctly handles such case.
init | Unused. |
args | Unused. |
null_value | Unused. |
error | Unused. |
0 | This function always returns 0. |
|
static |
Test C++ wrappers around telemetry logging API.
init | Unused. |
args | Unused. |
null_value | Unused. |
error | Unused. |
0 | This function always returns 0. |
mysql_service_status_t test_server_telemetry_logs_component_deinit | ( | ) |
Terminate the test_server_telemetry_logs_component at server shutdown or component deinstallation:
0 | success |
non-zero | failure |
mysql_service_status_t test_server_telemetry_logs_component_init | ( | ) |
Initialize the test_server_telemetry_logs component at server start or component installation:
0 | success |
non-zero | failure |
|
static |
|
static |
|
static |
PSI_logger_info_v1 g_loggers[] |
PSI_logger_info_v1 g_loggers1[] |
const mysql_service_log_builtins_t* log_bi |
accessor built-ins
accessor built-ins
const mysql_service_log_builtins_string_t* log_bs |
string built-ins
mysql_component_t mysql_component_test_server_telemetry_logs_client |
PSI_logger_key test1_logger_key = 0 |
PSI_logger_key test2_logger_key = 0 |
PSI_logger_key test3_logger_key = 0 |
PSI_logger_key test4_logger_key = 0 |