| 1 | #ifndef _Agent_h_ | ||
| 2 | #define _Agent_h_ | ||
| 3 | |||
| 4 | #include <string> | ||
| 5 | |||
| 6 | using namespace std; | ||
| 7 | |||
| 8 | class Agent { | ||
| 9 | public: | ||
| 10 | Agent( | ||
| 11 | const char *license_key = NULL, | ||
| 12 | const char *app_name = NULL, | ||
| 13 | const char *app_language = NULL, | ||
| 14 | const char *app_language_version = NULL | ||
| 15 | ); | ||
| 16 | 0 | ~Agent() {} | |
| 17 | void embed_collector(); | ||
| 18 | void init(); | ||
| 19 | long begin_transaction(); | ||
| 20 | int set_transaction_name(long transaction_id, const char *name); | ||
| 21 | int set_transaction_request_url(long transaction_id, const char *request_url); | ||
| 22 | int set_transaction_max_trace_segments(long transaction_id, int max_trace_segments); | ||
| 23 | int set_transaction_category(long transaction_id, const char *category); | ||
| 24 | int set_transaction_type_web(long transaction_id); | ||
| 25 | int set_transaction_type_other(long transaction_id); | ||
| 26 | int add_transaction_attribute(long transaction_id, const char *key, const char *value); | ||
| 27 | int notice_transaction_error(long transaction_id, const char *exception_type, const char *error_message, const char *stack_trace, const char *stack_frame_delimiter); | ||
| 28 | int end_transaction(long transaction_id); | ||
| 29 | int record_metric(const char *name, double value); | ||
| 30 | int record_cpu_usage(double cpu_user_time_seconds, double cpu_usage_percent); | ||
| 31 | int record_memory_usage(double memory_megabyte); | ||
| 32 | long begin_generic_segment(long transaction_id, long parent_segment_id, const char *name); | ||
| 33 | long begin_datastore_segment(long transaction_id, long parent_segment_id, const char *table, const char *operation, const char *sql, const char *sql_trace_rollup_name); | ||
| 34 | long begin_external_segment(long transaction_id, long parent_segment_id, const char *host, const char *name); | ||
| 35 | int end_segment(long transaction_id, long segment_id); | ||
| 36 | const char* get_license_key(); | ||
| 37 | const char* get_app_name(); | ||
| 38 | const char* get_app_language(); | ||
| 39 | const char* get_app_language_version(); | ||
| 40 | |||
| 41 | private: | ||
| 42 | string license_key; | ||
| 43 | string app_name; | ||
| 44 | string app_language; | ||
| 45 | string app_language_version; | ||
| 46 | bool config_loaded; | ||
| 47 | }; | ||
| 48 | |||
| 49 | #endif | ||
| 50 |