MySQL 8.3.0
Source Code Documentation
mysql_audit_print_service_longlong_data_source.h
Go to the documentation of this file.
1/* Copyright (c) 2022, 2023, 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 also distributed 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 included with MySQL.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License, version 2.0, for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef MYSQL_AUDIT_PRINT_SERVICE_LONGLONG_DATA_SOURCE_H
24#define MYSQL_AUDIT_PRINT_SERVICE_LONGLONG_DATA_SOURCE_H
25
29
30/**
31 @ingroup group_components_services_inventory
32
33 Audit print service allows to obtain data of the long long type associated
34 with the THD object, which keeps various data of the user session. It also
35 allows to obtain data not necessarily bound with the user session.
36
37 Currently, following data is supported:
38
39 - Query time ("query_time") Query execution time [microseconds].
40 - Rows sent ("rows_sent") Row count sent to the client as a result.
41 - Rows examined ("rows_examined") Row count accessed during the query.
42 - Bytes received ("bytes_received") Byte count received from the client.
43 - Bytes sent ("bytes_sent") Byte count sent to the client.
44
45 @section longlong_service_init Initialization
46
47 The service can be instantiated using the registry service with the
48 "mysql_audit_print_service_double_data_source" name.
49
50 @code
51 SERVICE_TYPE(registry) *registry = mysql_plugin_registry_acquire();
52 my_service<SERVICE_TYPE(mysql_audit_print_service_long_long_data_source)>
53 svc("mysql_audit_print_service_long_long_data_source", registry);
54 if (svc.is_valid()) {
55 // The service is ready to be used
56 }
57 @endcode
58
59 @section longlong_service_query_time Query Time
60
61 Query Time represents query execution time in microseconds.
62
63 @code
64 long long value;
65
66 svc->get(m_thd, "query_time", &value);
67 @endcode
68*/
69BEGIN_SERVICE_DEFINITION(mysql_audit_print_service_longlong_data_source)
70
71/**
72 Get data value.
73
74 @param thd Session THD object.
75 @param name Name of the data value to be retrieved.
76 @param[out] out Out value pointer. Must not be nullptr.
77
78 @return
79 @retval FALSE Succeeded.
80 @retval TRUE Failed.
81*/
83
84END_SERVICE_DEFINITION(mysql_audit_print_service_longlong_data_source)
85
86#endif /* MYSQL_AUDIT_PRINT_SERVICE_LONGLONG_DATA_SOURCE_H */
#define MYSQL_THD
Definition: backup_page_tracker.h:37
void get(PSI_field *, PSI_longlong *) noexcept
Definition: pfs_plugin_column_bigint_v1_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:90
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:85
#define DECLARE_BOOL_METHOD(name, args)
Declares a method that returns bool as a part of the Service definition.
Definition: service.h:111
case opt name
Definition: sslopt-case.h:32
Definition: mysql_string_service.cc:59