MySQL
9.7.0
Source Code Documentation
tm_slot.h
Go to the documentation of this file.
1
/*
2
Copyright (c) 2022, 2026, Oracle and/or its affiliates.
3
4
This program is free software; you can redistribute it and/or modify
5
it under the terms of the GNU General Public License, version 2.0,
6
as published by the Free Software Foundation.
7
8
This program is designed to work with certain software (including
9
but not limited to OpenSSL) that is licensed under separate terms,
10
as designated in a particular file or component or in included license
11
documentation. The authors of MySQL hereby grant you an additional
12
permission to link the program and your derivative works with the
13
separately licensed software that they have either included with
14
the program or referenced in the documentation.
15
16
This program is distributed in the hope that it will be useful,
17
but WITHOUT ANY WARRANTY; without even the implied warranty of
18
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
GNU General Public License, version 2.0, for more details.
20
21
You should have received a copy of the GNU General Public License
22
along with this program; if not, write to the Free Software
23
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
*/
25
26
#ifndef TELEMETRY_SLOT_H_INCLUDED
27
#define TELEMETRY_SLOT_H_INCLUDED
28
29
#include <opentelemetry/nostd/shared_ptr.h>
30
#include <opentelemetry/trace/tracer.h>
31
#include <opentelemetry/trace/tracer_provider.h>
32
33
#include "
mysql/components/services/mysql_thd_store_service.h
"
34
35
#include <vector>
36
37
namespace
telemetry
{
38
39
int
register_telemetry_slot
();
40
void
unregister_telemetry_slot
();
41
42
class
Session_data
{
43
public
:
44
static
Session_data
*
get
(
MYSQL_THD
thd);
45
static
void
set
(
MYSQL_THD
thd,
Session_data
*data);
46
47
static
Session_data
*
create
(
MYSQL_THD
thd,
bool
trace);
48
static
void
destroy
(
Session_data
*data);
49
50
explicit
Session_data
(
MYSQL_THD
thd,
bool
trace);
51
~Session_data
() =
default
;
52
53
void
close
();
54
55
opentelemetry::nostd::shared_ptr<opentelemetry::trace::Tracer>
56
m_session_tracer
;
57
opentelemetry::nostd::shared_ptr<opentelemetry::trace::Span>
m_session_span
;
58
std::vector<opentelemetry::nostd::shared_ptr<opentelemetry::trace::Span>>
59
m_stmt_stack
;
60
MYSQL_THD
m_thd
;
61
size_t
m_depth
;
62
bool
m_query_attributes_seen
;
63
bool
m_closed
;
64
bool
m_used_in_telemetry
;
65
bool
m_trace
;
66
};
67
68
}
// namespace telemetry
69
70
#endif
/* TELEMETRY_SLOT_H_INCLUDED */
MYSQL_THD
#define MYSQL_THD
Definition:
backup_page_tracker.h:38
telemetry::Session_data
Definition:
tm_slot.h:42
telemetry::Session_data::m_used_in_telemetry
bool m_used_in_telemetry
Definition:
tm_slot.h:64
telemetry::Session_data::destroy
static void destroy(Session_data *data)
Definition:
tm_slot.cc:82
telemetry::Session_data::m_closed
bool m_closed
Definition:
tm_slot.h:63
telemetry::Session_data::m_session_span
opentelemetry::nostd::shared_ptr< opentelemetry::trace::Span > m_session_span
Definition:
tm_slot.h:57
telemetry::Session_data::get
static Session_data * get(MYSQL_THD thd)
Definition:
tm_slot.cc:63
telemetry::Session_data::close
void close()
Definition:
tm_slot.cc:100
telemetry::Session_data::~Session_data
~Session_data()=default
telemetry::Session_data::m_stmt_stack
std::vector< opentelemetry::nostd::shared_ptr< opentelemetry::trace::Span > > m_stmt_stack
Definition:
tm_slot.h:59
telemetry::Session_data::m_depth
size_t m_depth
Definition:
tm_slot.h:61
telemetry::Session_data::m_thd
MYSQL_THD m_thd
Definition:
tm_slot.h:60
telemetry::Session_data::set
static void set(MYSQL_THD thd, Session_data *data)
Definition:
tm_slot.cc:69
telemetry::Session_data::create
static Session_data * create(MYSQL_THD thd, bool trace)
Definition:
tm_slot.cc:77
telemetry::Session_data::m_session_tracer
opentelemetry::nostd::shared_ptr< opentelemetry::trace::Tracer > m_session_tracer
Definition:
tm_slot.h:56
telemetry::Session_data::m_query_attributes_seen
bool m_query_attributes_seen
Definition:
tm_slot.h:62
telemetry::Session_data::m_trace
bool m_trace
Definition:
tm_slot.h:65
telemetry::Session_data::Session_data
Session_data(MYSQL_THD thd, bool trace)
Definition:
tm_slot.cc:89
mysql_thd_store_service.h
Connection event tracking.
telemetry
Definition:
option_usage.cc:40
telemetry::register_telemetry_slot
int register_telemetry_slot()
Definition:
tm_slot.cc:40
telemetry::unregister_telemetry_slot
void unregister_telemetry_slot()
Definition:
tm_slot.cc:52
components
telemetry
tm_slot.h
Generated by
1.9.2