MySQL
8.2.0
Source Code Documentation
mysql_audit_print_service_double_data_source.h
Go to the documentation of this file.
1
/* Copyright (c) 2022, 2023, 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 also distributed 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 included with MySQL.
13
14
This program is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
GNU General Public License, version 2.0, for more details.
18
19
You should have received a copy of the GNU General Public License
20
along with this program; if not, write to the Free Software
21
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23
#ifndef MYSQL_AUDIT_PRINT_SERVICE_DOUBLE_DATA_SOURCE_H
24
#define MYSQL_AUDIT_PRINT_SERVICE_DOUBLE_DATA_SOURCE_H
25
26
#include <
mysql/components/service.h
>
27
#include <
mysql/components/services/bits/thd.h
>
28
#include <
mysql/components/services/mysql_string.h
>
29
30
/**
31
@ingroup group_components_services_inventory
32
33
Audit print service allows to obtain data of the double type associated with
34
the THD object, which keeps various data of the user session. It also allows
35
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 [seconds].
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 double_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_double_data_source)>
53
svc("mysql_audit_print_service_double_data_source", registry);
54
if (svc.is_valid()) {
55
// The service is ready to be used
56
}
57
@endcode
58
59
@section double_service_query_time Query Time
60
61
Query Time represents query execution time in seconds.
62
63
@code
64
double value;
65
66
svc->get(m_thd, "query_time", &value);
67
@endcode
68
*/
69
BEGIN_SERVICE_DEFINITION
(mysql_audit_print_service_double_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
*/
82
DECLARE_BOOL_METHOD
(
get
, (
MYSQL_THD
thd,
my_h_string
name
,
double
*out));
83
84
END_SERVICE_DEFINITION
(mysql_audit_print_service_double_data_source)
85
86
#endif
/* MYSQL_AUDIT_PRINT_SERVICE_DOUBLE_DATA_SOURCE_H */
MYSQL_THD
#define MYSQL_THD
Definition:
backup_page_tracker.h:37
mysql_string.h
pfs_plugin_column_bigint_v1_all_empty::get
void get(PSI_field *, PSI_longlong *) noexcept
Definition:
pfs_plugin_column_bigint_v1_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:90
BEGIN_SERVICE_DEFINITION
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition:
service.h:85
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:111
name
case opt name
Definition:
sslopt-case.h:32
my_h_string_imp
Definition:
mysql_string_service.cc:59
thd.h
include
mysql
components
services
mysql_audit_print_service_double_data_source.h
Generated by
1.9.2