#ifndef OMNI_TX_TIMESTAMP_DEBUG_H #define OMNI_TX_TIMESTAMP_DEBUG_H #include "protocol.h" #ifdef __cplusplus extern "C" { #endif #define TX_TIMESTAMP_DEBUG_RECORD_SEND_CHUNK "send_chunk" #define TX_TIMESTAMP_DEBUG_RECORD_ERRQUEUE_EVENT "errqueue_event" typedef struct tx_timestamp_debug_record { char record_type[32]; char node_role[OMNI_MAX_NODE_ROLE]; char node_id[OMNI_MAX_PEER_ID]; message_type_t message_type; uint64_t message_id; char from[OMNI_MAX_PEER_ID]; char to[OMNI_MAX_PEER_ID]; char file_name[OMNI_MAX_FILE_NAME]; int body_size; char phase[32]; int send_call_index; int frame_offset_start; int frame_offset_end; int bytes_written; uint32_t expected_tx_id; int read_index; char event_name[OMNI_MAX_EVENT_NAME]; int64_t ts_unix_nano; uint32_t ee_info; uint32_t ee_data; int matched_send_call_index; int selected_for_latency; } tx_timestamp_debug_record_t; typedef struct tx_timestamp_debug_logger { omni_file_logger_t file_logger; int enabled; } tx_timestamp_debug_logger_t; tx_timestamp_debug_logger_t *tx_timestamp_debug_open_jsonl(const char *path); void tx_timestamp_debug_close(tx_timestamp_debug_logger_t *logger); int tx_timestamp_debug_log(tx_timestamp_debug_logger_t *logger, const tx_timestamp_debug_record_t *record); #ifdef __cplusplus } #endif #endif