MySQL
9.1.0
Source Code Documentation
mysql_audit_print_service_double_data_source.h
Go to the documentation of this file.
1
/* Copyright (c) 2022, 2024, Oracle and/or its affiliates.
2
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License, version 2.0,
5
as published by the Free Software Foundation.
6
7
This program is designed to work with certain software (including
8
but not limited to OpenSSL) that is licensed under separate terms,
9
as designated in a particular file or component or in included license
10
documentation. The authors of MySQL hereby grant you an additional
11
permission to link the program and your derivative works with the
12
separately licensed software that they have either included with
13
the program or referenced in the documentation.
14
15
This program is distributed in the hope that it will be useful,
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
GNU General Public License, version 2.0, for more details.
19
20
You should have received a copy of the GNU General Public License
21
along with this program; if not, write to the Free Software
22
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24
#ifndef MYSQL_AUDIT_PRINT_SERVICE_DOUBLE_DATA_SOURCE_H
25
#define MYSQL_AUDIT_PRINT_SERVICE_DOUBLE_DATA_SOURCE_H
26
27
#include <
mysql/components/service.h
>
28
#include <
mysql/components/services/bits/thd.h
>
29
#include <
mysql/components/services/mysql_string.h
>
30
31
/**
32
@ingroup group_components_services_inventory
33
34
Audit print service allows to obtain data of the double type associated with
35
the THD object, which keeps various data of the user session. It also allows
36
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 [seconds].
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 double_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_double_data_source)>
54
svc("mysql_audit_print_service_double_data_source", registry);
55
if (svc.is_valid()) {
56
// The service is ready to be used
57
}
58
@endcode
59
60
@section double_service_query_time Query Time
61
62
Query Time represents query execution time in seconds.
63
64
@code
65
double value;
66
67
svc->get(m_thd, "query_time", &value);
68
@endcode
69
*/
70
BEGIN_SERVICE_DEFINITION
(mysql_audit_print_service_double_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
*/
83
DECLARE_BOOL_METHOD
(
get
, (
MYSQL_THD
thd,
my_h_string
name
,
double
*out));
84
85
END_SERVICE_DEFINITION
(mysql_audit_print_service_double_data_source)
86
87
#endif
/* MYSQL_AUDIT_PRINT_SERVICE_DOUBLE_DATA_SOURCE_H */
MYSQL_THD
#define MYSQL_THD
Definition:
backup_page_tracker.h:38
mysql_string.h
mysql_current_thread_reader_all_empty_spc::get
static mysql_service_status_t get(THD **thd) noexcept
Definition:
mysql_current_thread_reader_all_empty.cc:31
service.h
END_SERVICE_DEFINITION
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition:
service.h:91
BEGIN_SERVICE_DEFINITION
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition:
service.h:86
DECLARE_BOOL_METHOD
#define DECLARE_BOOL_METHOD(name, args)
Declares a method that returns bool as a part of the Service definition.
Definition:
service.h:112
name
case opt name
Definition:
sslopt-case.h:29
my_h_string_imp
Definition:
mysql_string_service.cc:60
thd.h
include
mysql
components
services
mysql_audit_print_service_double_data_source.h
Generated by
1.9.2