MySQL 9.1.0
Source Code Documentation
mysql_audit_print_service_longlong_data_source.h
Go to the documentation of this file.
1/* Copyright (c) 2022, 2024, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef MYSQL_AUDIT_PRINT_SERVICE_LONGLONG_DATA_SOURCE_H
25#define MYSQL_AUDIT_PRINT_SERVICE_LONGLONG_DATA_SOURCE_H
26
30
31/**
32 @ingroup group_components_services_inventory
33
34 Audit print service allows to obtain data of the long long type associated
35 with the THD object, which keeps various data of the user session. It also
36 allows to obtain data not necessarily bound with the user session.
37
38 Currently, following data is supported:
39
40 - Query time ("query_time") Query execution time [microseconds].
41 - Rows sent ("rows_sent") Row count sent to the client as a result.
42 - Rows examined ("rows_examined") Row count accessed during the query.
43 - Bytes received ("bytes_received") Byte count received from the client.
44 - Bytes sent ("bytes_sent") Byte count sent to the client.
45
46 @section longlong_service_init Initialization
47
48 The service can be instantiated using the registry service with the
49 "mysql_audit_print_service_double_data_source" name.
50
51 @code
52 SERVICE_TYPE(registry) *registry = mysql_plugin_registry_acquire();
53 my_service<SERVICE_TYPE(mysql_audit_print_service_long_long_data_source)>
54 svc("mysql_audit_print_service_long_long_data_source", registry);
55 if (svc.is_valid()) {
56 // The service is ready to be used
57 }
58 @endcode
59
60 @section longlong_service_query_time Query Time
61
62 Query Time represents query execution time in microseconds.
63
64 @code
65 long long value;
66
67 svc->get(m_thd, "query_time", &value);
68 @endcode
69*/
70BEGIN_SERVICE_DEFINITION(mysql_audit_print_service_longlong_data_source)
71
72/**
73 Get data value.
74
75 @param thd Session THD object.
76 @param name Name of the data value to be retrieved.
77 @param[out] out Out value pointer. Must not be nullptr.
78
79 @return
80 @retval FALSE Succeeded.
81 @retval TRUE Failed.
82*/
84
85END_SERVICE_DEFINITION(mysql_audit_print_service_longlong_data_source)
86
87#endif /* MYSQL_AUDIT_PRINT_SERVICE_LONGLONG_DATA_SOURCE_H */
#define MYSQL_THD
Definition: backup_page_tracker.h:38
static mysql_service_status_t get(THD **thd) noexcept
Definition: mysql_current_thread_reader_all_empty.cc:31
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:91
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:86
#define DECLARE_BOOL_METHOD(name, args)
Declares a method that returns bool as a part of the Service definition.
Definition: service.h:112
case opt name
Definition: sslopt-case.h:29
Definition: mysql_string_service.cc:60