#include <appdynamics.h>
Public Member Functions | |
BT (const char *name, const char *correlation_header=NULL) | |
BT (const std::string &name) | |
BT (const std::string &name, const std::string &correlation_header) | |
BT (appd_bt_handle bt) | |
~BT () | |
void | store (const char *guid) |
void | store (const std::string &guid) |
bool | is_snapshotting () const |
bool | enable_snapshot () const |
virtual void | add_error (enum appd_error_level level, const char *message, bool mark_bt_as_error=true) |
void | add_user_data (const char *key, const char *value) |
void | add_user_data (const std::string &key, const std::string &value) |
void | set_url (const char *url) |
void | set_url (const std::string &url) |
Public Member Functions inherited from appd::sdk::HandleWrapper< appd_bt_handle > | |
HandleWrapper () | |
HandleWrapper (appd_bt_handle handle) | |
virtual | ~HandleWrapper ()=default |
appd_bt_handle | handle () |
const appd_bt_handle | handle () const |
void | add_error (enum appd_error_level level, const std::string &message, bool mark_bt_as_error=true) |
Protected Member Functions | |
void | init (const char *name, const char *correlation_header=NULL) |
Private Member Functions | |
BT () | |
Additional Inherited Members | |
Protected Attributes inherited from appd::sdk::HandleWrapper< appd_bt_handle > | |
appd_bt_handle | m_handle |
bool | m_borrowed_handle |
Represents an AppDynamics business transaction for C++ applications.
An instance of this class begins a business transaction (similar to calling appd_bt_begin
) upon construction and ends the business transaction upon destruction. You can match a business transaction's lifetime to a scope:
{ appd::sdk::BT bt("compute"); // all code in this scope is part of the "compute" BT // `bt` is automatically ended when it goes out of scope }
When a BT has a lifetime that depends on the nondeterministic lifetimes of other objects, you can use a shared pointer to a BT to keep the BT alive for the lifetimes of its dependencies:
auto bt = std::make_shared<appd::sdk::BT>("compute"); auto prod = createProducer(bt); auto consumers = createConsumers(bt, NUM_WORKERS);
In this example, the BT
ends when the last reference to it ends.
You cannot copy a business transaction.
|
inline |
Construct a business transaction object with the given name.
If a valid AppDynamics correlation_header
is passed (generated by the SDK or another agent), the business transaction is marked to continue the transaction described in the header.
name | The name of the Business Transaction. |
correlation_header | An AppDynamics correlation header or NULL. |
|
inlineexplicit |
Construct a BT object with the given name.
This name will be used if there is no correlation string available (for continuing BTs from an upstream tier) or if the Controller has not yet initialized the agent configuration.
name | The name of the Business Transaction. |
|
inline |
Construct a continuing business transaction object with the given name and correlation header.
The name is used only if the correlation header is empty or otherwise invalid, in which case this BT will be reported as an originating BT with the specified name.
name | The name of the Business Transaction if the correlation header is invalid. |
correlation_header | An AppDynamics correlation header. |
|
inline |
|
inline |
|
private |
|
inlinevirtual |
Calls appd_bt_add_error
on this BT with the given error information.
Implements appd::sdk::HandleWrapper< appd_bt_handle >.
|
inline |
Calls appd_bt_add_user_data
on this business transaction with the given key and value.
|
inline |
Calls appd_bt_add_user_data
on this business transaction with the given key and value.
|
inline |
Calls appd_bt_enable_snapshot
on this BT.
|
inlineprotected |
|
inline |
Calls appd_bt_is_snapshotting
on this BT.
|
inline |
Calls appd_bt_set_url
on this business transaction with the given URL.
|
inline |
Calls appd_bt_set_url
on this business transaction with the given URL.
|
inline |
Calls appd_bt_store
on this BT with the given GUID.
|
inline |
Calls appd_bt_store
on this BT with the given GUID.