MongoDB C++ Driver mongocxx-3.11.0
Loading...
Searching...
No Matches
apm.hpp
Go to the documentation of this file.
1// Copyright 2009-present MongoDB, Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#pragma once
16
17#include <functional>
18
20
33
35
36namespace mongocxx {
37namespace v_noabi {
38namespace options {
39
43class apm {
44 public:
60 on_command_started(std::function<void MONGOCXX_ABI_CDECL(const events::command_started_event&)>
62
69 const std::function<void MONGOCXX_ABI_CDECL(const events::command_started_event&)>&)
71
88 std::function<void MONGOCXX_ABI_CDECL(const events::command_failed_event&)> command_failed);
89
96 const std::function<void MONGOCXX_ABI_CDECL(const events::command_failed_event&)>&)
98
115 std::function<void MONGOCXX_ABI_CDECL(const events::command_succeeded_event&)>
117
124 const std::function<void MONGOCXX_ABI_CDECL(const events::command_succeeded_event&)>&)
126
143 std::function<void MONGOCXX_ABI_CDECL(const events::server_opening_event&)> server_opening);
144
151 const std::function<void MONGOCXX_ABI_CDECL(const events::server_opening_event&)>&)
153
170 std::function<void MONGOCXX_ABI_CDECL(const events::server_closed_event&)> server_closed);
171
178 const std::function<void MONGOCXX_ABI_CDECL(const events::server_closed_event&)>&)
180
198 std::function<void MONGOCXX_ABI_CDECL(const events::server_changed_event&)> server_changed);
199
206 const std::function<void MONGOCXX_ABI_CDECL(const events::server_changed_event&)>&)
208
225 std::function<void MONGOCXX_ABI_CDECL(const events::topology_opening_event&)>
227
234 const std::function<void MONGOCXX_ABI_CDECL(const events::topology_opening_event&)>&)
236
252 on_topology_closed(std::function<void MONGOCXX_ABI_CDECL(const events::topology_closed_event&)>
254
261 const std::function<void MONGOCXX_ABI_CDECL(const events::topology_closed_event&)>&)
263
281 std::function<void MONGOCXX_ABI_CDECL(const events::topology_changed_event&)>
283
290 const std::function<void MONGOCXX_ABI_CDECL(const events::topology_changed_event&)>&)
292
309 std::function<void MONGOCXX_ABI_CDECL(const events::heartbeat_started_event&)>
311
318 const std::function<void MONGOCXX_ABI_CDECL(const events::heartbeat_started_event&)>&)
320
337 std::function<void MONGOCXX_ABI_CDECL(const events::heartbeat_failed_event&)>
339
346 const std::function<void MONGOCXX_ABI_CDECL(const events::heartbeat_failed_event&)>&)
348
366 std::function<void MONGOCXX_ABI_CDECL(const events::heartbeat_succeeded_event&)>
368
375 const std::function<void MONGOCXX_ABI_CDECL(const events::heartbeat_succeeded_event&)>&)
377
378 private:
379 std::function<void MONGOCXX_ABI_CDECL(const events::command_started_event&)> _command_started;
380 std::function<void MONGOCXX_ABI_CDECL(const events::command_failed_event&)> _command_failed;
381 std::function<void MONGOCXX_ABI_CDECL(const events::command_succeeded_event&)>
382 _command_succeeded;
383 std::function<void MONGOCXX_ABI_CDECL(const events::server_closed_event&)> _server_closed;
384 std::function<void MONGOCXX_ABI_CDECL(const events::server_changed_event&)> _server_changed;
385 std::function<void MONGOCXX_ABI_CDECL(const events::server_opening_event&)> _server_opening;
386 std::function<void MONGOCXX_ABI_CDECL(const events::topology_closed_event&)> _topology_closed;
387 std::function<void MONGOCXX_ABI_CDECL(const events::topology_changed_event&)> _topology_changed;
388 std::function<void MONGOCXX_ABI_CDECL(const events::topology_opening_event&)> _topology_opening;
389 std::function<void MONGOCXX_ABI_CDECL(const events::heartbeat_started_event&)>
390 _heartbeat_started;
391 std::function<void MONGOCXX_ABI_CDECL(const events::heartbeat_failed_event&)> _heartbeat_failed;
392 std::function<void MONGOCXX_ABI_CDECL(const events::heartbeat_succeeded_event&)>
393 _heartbeat_succeeded;
394};
395
396} // namespace options
397} // namespace v_noabi
398} // namespace mongocxx
399
400#include <mongocxx/config/postlude.hpp>
401
Declares mongocxx::v_noabi::options::apm.
Class representing MongoDB application performance monitoring.
Definition apm.hpp:43
const std::function< void MONGOCXX_ABI_CDECL(const events::heartbeat_succeeded_event &)> & heartbeat_succeeded() const
Retrieves the heartbeat succeeded monitoring callback.
const std::function< void MONGOCXX_ABI_CDECL(const events::command_failed_event &)> & command_failed() const
Retrieves the command failed monitoring callback.
const std::function< void MONGOCXX_ABI_CDECL(const events::command_started_event &)> & command_started() const
Retrieves the command started monitoring callback.
apm & on_topology_opening(std::function< void MONGOCXX_ABI_CDECL(const events::topology_opening_event &)> topology_opening)
Set the topology_opening monitoring callback. The callback takes a reference to a topology_opening_ev...
apm & on_heartbeat_succeeded(std::function< void MONGOCXX_ABI_CDECL(const events::heartbeat_succeeded_event &)> heartbeat_succeeded)
Set the heartbeat succeeded monitoring callback. The callback takes a reference to a heartbeat_succee...
const std::function< void MONGOCXX_ABI_CDECL(const events::command_succeeded_event &)> & command_succeeded() const
Retrieves the command succeeded monitoring callback.
apm & on_topology_closed(std::function< void MONGOCXX_ABI_CDECL(const events::topology_closed_event &)> topology_closed)
Set the topology closed monitoring callback. The callback takes a reference to a topology_closed_even...
const std::function< void MONGOCXX_ABI_CDECL(const events::server_changed_event &)> & server_changed() const
Retrieves the server description changed monitoring callback.
apm & on_server_changed(std::function< void MONGOCXX_ABI_CDECL(const events::server_changed_event &)> server_changed)
Set the server description changed monitoring callback. The callback takes a reference to a server_ch...
apm & on_server_closed(std::function< void MONGOCXX_ABI_CDECL(const events::server_closed_event &)> server_closed)
Set the server closed monitoring callback. The callback takes a reference to a server_closed_event wh...
const std::function< void MONGOCXX_ABI_CDECL(const events::heartbeat_failed_event &)> & heartbeat_failed() const
Retrieves the heartbeat failed monitoring callback.
apm & on_command_failed(std::function< void MONGOCXX_ABI_CDECL(const events::command_failed_event &)> command_failed)
Set the command failed monitoring callback. The callback takes a reference to a command_failed_event ...
apm & on_command_started(std::function< void MONGOCXX_ABI_CDECL(const events::command_started_event &)> command_started)
Set the command started monitoring callback. The callback takes a reference to a command_started_even...
apm & on_heartbeat_failed(std::function< void MONGOCXX_ABI_CDECL(const events::heartbeat_failed_event &)> heartbeat_failed)
Set the heartbeat failed monitoring callback. The callback takes a reference to a heartbeat_failed_ev...
const std::function< void MONGOCXX_ABI_CDECL(const events::server_opening_event &)> & server_opening() const
Retrieves the server opening monitoring callback.
apm & on_server_opening(std::function< void MONGOCXX_ABI_CDECL(const events::server_opening_event &)> server_opening)
Set the server opening monitoring callback. The callback takes a reference to a server_opening_event ...
apm & on_topology_changed(std::function< void MONGOCXX_ABI_CDECL(const events::topology_changed_event &)> topology_changed)
Set the topology description changed monitoring callback. The callback takes a reference to a topolog...
const std::function< void MONGOCXX_ABI_CDECL(const events::server_closed_event &)> & server_closed() const
Retrieves the server closed monitoring callback.
apm & on_command_succeeded(std::function< void MONGOCXX_ABI_CDECL(const events::command_succeeded_event &)> command_succeeded)
Set the command succeeded monitoring callback. The callback takes a reference to a command_succeeded_...
const std::function< void MONGOCXX_ABI_CDECL(const events::topology_opening_event &)> & topology_opening() const
Retrieves the topology_opening monitoring callback.
const std::function< void MONGOCXX_ABI_CDECL(const events::topology_closed_event &)> & topology_closed() const
Retrieves the topology closed monitoring callback.
const std::function< void MONGOCXX_ABI_CDECL(const events::topology_changed_event &)> & topology_changed() const
Retrieves the topology description changed monitoring callback.
apm & on_heartbeat_started(std::function< void MONGOCXX_ABI_CDECL(const events::heartbeat_started_event &)> heartbeat_started)
Set the heartbeat started monitoring callback. The callback takes a reference to a heartbeat_started_...
const std::function< void MONGOCXX_ABI_CDECL(const events::heartbeat_started_event &)> & heartbeat_started() const
Retrieves the heartbeat started monitoring callback.
Provides mongocxx::v_noabi::events::command_failed_event.
Provides mongocxx::v_noabi::events::command_started_event.
Provides mongocxx::v_noabi::events::command_succeeded_event.
#define MONGOCXX_ABI_CDECL
Expands to __cdecl when built with MSVC on Windows.
Definition fwd.hpp:214
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition fwd.hpp:222
Provides mongocxx::v_noabi::events::heartbeat_failed_event.
Provides mongocxx::v_noabi::events::heartbeat_started_event.
Provides mongocxx::v_noabi::events::heartbeat_succeeded_event.
The mongocxx macro guard prelude header.
The top-level namespace within which all mongocxx library entities are declared.
The top-level namespace reserved for the C++ standard library.
Provides mongocxx::v_noabi::events::server_changed_event.
Provides mongocxx::v_noabi::events::server_closed_event.
Provides mongocxx::v_noabi::events::server_opening_event.
Provides mongocxx::v_noabi::events::topology_changed_event.
Provides mongocxx::v_noabi::events::topology_closed_event.
Provides mongocxx::v_noabi::events::topology_opening_event.