AppDynamics IoT C++ SDK
AppDynamics IoT C++ library contains code that facilitates capturing availability, usage, network performance and errors of an IoT Application.
|
#include <stdint.h>
#include <string.h>
Go to the source code of this file.
Data Structures | |
struct | appd_iot_sdk_config_t |
AppDynamics SDK Configuration Mandatory: All Fields. More... | |
struct | appd_iot_device_config_t |
AppDynamics Device Information Mandatory: Device Type and Device ID Fields. More... | |
struct | appd_iot_data_t |
AppDynamics Associative Array Data Structure Underlying implementation is a Sequential List of <key, value> pairs. More... | |
struct | appd_iot_custom_event_t |
AppDynamics Custom Event Mandatory: type, summary and timestamp_ms Fields. More... | |
struct | appd_iot_network_request_event_t |
AppDynamics Network Request Event Mandatory: url and timestamp_ms Fields. More... | |
struct | appd_iot_stack_frame_t |
AppDynamics Stack Frame This structure captures a single element in the stack frame Each stack frame should have atlease one of symbol_name, package_name or file_name. More... | |
struct | appd_iot_stack_trace_t |
AppDynamics Stack Trace This structure captures the strack trace. More... | |
struct | appd_iot_error_event_t |
AppDynamics Error Event This structure can be used to send error or exception or a crash. Mandatory: name and timestamp_ms Fields. More... | |
struct | appd_iot_http_req_t |
AppDynamics HTTP Request Structure Mandatory: All Fields Data is provided in raw format. If data is sent in gzip format then add the http request header "Content-Encoding: gzip". It is recommended to gzip data for efficient use of resources. More... | |
struct | appd_iot_http_resp_t |
AppDynamics HTTP Response Structure Mandatory: One of the resp_code or error fields should be populated. More... | |
struct | appd_iot_http_cb_t |
AppDynamics HTTP Callback list Mandatory: http_req_send_cb and http_resp_done_cb fields. More... | |
Macros | |
#define | APPD_IOT_NUM_SERVER_CORRELATION_HEADERS 2 |
Typedefs | |
typedef void(* | appd_iot_log_write_cb_t) (const char *logmsg, size_t logmsg_len) |
Log Write Callback implements the functionality to process log messages The callback implementation reads log message and writes it to disk or prints to std terminal. More... | |
typedef void(* | appd_iot_sdk_state_change_cb_t) (appd_iot_sdk_state_t sdk_state) |
This Callback function gets triggered whenever sdk state changes. SDK states are given in appd_iot_sdk_state_t. SDK inital state is set to UNINITIALIZED. SDK state is set to ENABLED after init function (appd_iot_init_sdk(void)) is called. SDK state is set to DISABLED when APPDYNAMICS Collector indicates IoT application on the Controller is disabled due to license expiry, kill switch or data limit exceeded. Users should periodically check on application status with APPDYNAMICS Collector and re-enable SDK using the API appd_iot_check_app_status(void). More... | |
typedef appd_iot_http_resp_t *(* | appd_iot_http_req_send_cb_t) (const appd_iot_http_req_t *http_req) |
Http Request Send Callback implements the functionality to send HTTP Request The callback implementation reads in http_req parameters, executes http request and populates http response params. Any server redirections (http status: 3xx) must be handled by the http client library. More... | |
typedef void(* | appd_iot_http_resp_done_cb_t) (appd_iot_http_resp_t *http_resp) |
Http Response Done Callback is triggered after http send callback returns and http response is processed by SDK.Any cleanup work can be part of this function which includes freeing the memory allocated to http_resp struct. This callback will be called even if send callback returns error code. More... | |
Functions | |
static void | appd_iot_data_set_integer (appd_iot_data_t *data, const char *key, int64_t value) |
Sets data field attributes for 64 bit integer value. More... | |
static void | appd_iot_data_set_double (appd_iot_data_t *data, const char *key, double value) |
Sets data field attributes for double value. More... | |
static void | appd_iot_data_set_datetime (appd_iot_data_t *data, const char *key, int64_t value) |
Sets data field attributes for datetime value. More... | |
static void | appd_iot_data_set_boolean (appd_iot_data_t *data, const char *key, bool value) |
Sets data field attributes for boolean value. More... | |
static void | appd_iot_data_set_string (appd_iot_data_t *data, const char *key, const char *value) |
Sets data field attributes for string value. More... | |
static void | appd_iot_init_to_zero (void *ptr, size_t size) |
Initializes memory block pointed by ptr to zero. More... | |
const char * | appd_iot_error_code_to_str (appd_iot_error_code_t error_code) __APPD_IOT_API |
Convert error code to string. More... | |
const char * | appd_iot_sdk_state_to_str (appd_iot_sdk_state_t sdk_state) __APPD_IOT_API |
Convert sdk state to string. More... | |
const appd_iot_data_t * | appd_iot_get_server_correlation_headers (void) __APPD_IOT_API |
Get Server Correlation headers in {key,value} format that need to be added to every outgoing http request to enable capturing Business Transaction (BT). More... | |
#define APPD_IOT_NUM_SERVER_CORRELATION_HEADERS 2 |
Number of Server Correlation Headers
typedef void(* appd_iot_log_write_cb_t) (const char *logmsg, size_t logmsg_len) |
Log Write Callback implements the functionality to process log messages
The callback implementation reads log message and writes it to disk or prints to std terminal.
logmsg | contains log message. Newline is not appended to the log message. Each logmsg is appended with a tag "E/APPDYNAMICS:". First Letter in the tag indicates log level as given in appd_iot_log_level_t. logmsg not to be freed in the log write callback. It is freed by the caller of log write cb. |
logmsg_len | contains the length of log message |
typedef void(* appd_iot_sdk_state_change_cb_t) (appd_iot_sdk_state_t sdk_state) |
This Callback function gets triggered whenever sdk state changes. SDK states are given in appd_iot_sdk_state_t.
SDK inital state is set to UNINITIALIZED. SDK state is set to ENABLED after init function (appd_iot_init_sdk(void)) is called. SDK state is set to DISABLED when APPDYNAMICS Collector indicates IoT application on the Controller is disabled due to license expiry, kill switch or data limit exceeded.
Users should periodically check on application status with APPDYNAMICS Collector and re-enable SDK using the API appd_iot_check_app_status(void).
sdk_state | indicates the new state of SDK. |
typedef appd_iot_http_resp_t*(* appd_iot_http_req_send_cb_t) (const appd_iot_http_req_t *http_req) |
Http Request Send Callback implements the functionality to send HTTP Request
The callback implementation reads in http_req parameters, executes http request and populates http response params. Any server redirections (http status: 3xx) must be handled by the http client library.
http_req | contains request parameters. The caller allocates memory and caller will free it. |
typedef void(* appd_iot_http_resp_done_cb_t) (appd_iot_http_resp_t *http_resp) |
Http Response Done Callback is triggered after http send callback returns
and http response is processed by SDK.Any cleanup work can be part of this function
which includes freeing the memory allocated to http_resp struct.
This callback will be called even if send callback returns error code.
http_resp | contains response parameters. This pointer is passed to free the memory it points to. http_resp also has user_data field which is populated in http send callback for internal purposes. |
Error Code Enums for SDK log.
enum appd_iot_sdk_state_t |
Enums for SDK State.
Severity of the errors occured in the application.
enum appd_iot_log_level_t |
Log Level Enums returned for all API calls.
AppDynamics Data Types.
Enumerator | |
---|---|
APPD_IOT_INTEGER | Integer Value |
APPD_IOT_DOUBLE | Double Value |
APPD_IOT_STRING | String Value |
APPD_IOT_BOOLEAN | Boolean Value |
APPD_IOT_DATETIME | DateTime Value |
|
inlinestatic |
Sets data field attributes for 64 bit integer value.
|
inlinestatic |
Sets data field attributes for double value.
|
inlinestatic |
Sets data field attributes for datetime value.
|
inlinestatic |
Sets data field attributes for boolean value.
|
inlinestatic |
Sets data field attributes for string value.
|
inlinestatic |
const char* appd_iot_error_code_to_str | ( | appd_iot_error_code_t | error_code | ) |
Convert error code to string.
error_code | that is to be converted to string |
const char* appd_iot_sdk_state_to_str | ( | appd_iot_sdk_state_t | sdk_state | ) |
Convert sdk state to string.
sdk_state | that is to be converted to string |
const appd_iot_data_t* appd_iot_get_server_correlation_headers | ( | void | ) |
Get Server Correlation headers in {key,value} format that need to be added to every outgoing http request to enable capturing Business Transaction (BT).