Hi, Attached is a patch that adds a few more more stats (the code was actually written by Angus). We find these stats useful - hopefully others will too.
Cheers, Tim
From: Tim Beale <[email protected]> Add some more stats for debugging + overload - number of times client is told to try again + invalid_request - message contained invalid paramter, e.g. invalid size + msg_queue_avail - messages currently available at the Totem layer + msg-queue_reserved - messages currently reserved at the Totem layer --- diff --git a/exec/coroipcs.c b/exec/coroipcs.c index f40c10c..d407a8a 100644 --- a/exec/coroipcs.c +++ b/exec/coroipcs.c @@ -704,6 +704,7 @@ static void *pthread_ipc_consumer (void *conn) * parameter, such as an invalid size */ if (send_ok == -1) { + api->stats_increment_value (conn_info->stats_handle, "invalid_request"); coroipc_response_header.size = sizeof (coroipc_response_header_t); coroipc_response_header.id = 0; coroipc_response_header.error = CS_ERR_INVALID_PARAM; @@ -720,6 +721,7 @@ static void *pthread_ipc_consumer (void *conn) /* * Overload, tell library to retry */ + api->stats_increment_value (conn_info->stats_handle, "overload"); coroipc_response_header.size = sizeof (coroipc_response_header_t); coroipc_response_header.id = 0; coroipc_response_header.error = CS_ERR_TRY_AGAIN; diff --git a/exec/main.c b/exec/main.c index 2526a8d..be9e118 100644 --- a/exec/main.c +++ b/exec/main.c @@ -601,6 +601,13 @@ static void corosync_totem_stats_updater (void *data) stats = api->totem_get_stats(); + objdb->object_key_replace (stats->hdr.handle, + "msg_reserved", strlen("msg_reserved"), + &stats->msg_reserved, sizeof (stats->msg_reserved)); + objdb->object_key_replace (stats->hdr.handle, + "msg_queue_avail", strlen("msg_queue_avail"), + &stats->msg_queue_avail, sizeof (stats->msg_queue_avail)); + objdb->object_key_replace (stats->mrp->srp->hdr.handle, "orf_token_tx", strlen("orf_token_tx"), &stats->mrp->srp->orf_token_tx, sizeof (stats->mrp->srp->orf_token_tx)); @@ -753,6 +760,13 @@ static void corosync_totem_stats_init (void) &stats->mrp->srp->hdr.handle, "srp", strlen ("srp")); + objdb->object_key_create_typed (stats->hdr.handle, + "msg_reserved", &stats->msg_reserved, + sizeof (stats->msg_reserved), OBJDB_VALUETYPE_UINT32); + objdb->object_key_create_typed (stats->hdr.handle, + "msg_queue_avail", &stats->msg_queue_avail, + sizeof (stats->msg_queue_avail), OBJDB_VALUETYPE_UINT32); + /* Members object */ objdb->object_create (stats->mrp->srp->hdr.handle, &object_memb_handle, @@ -1200,6 +1214,16 @@ static hdb_handle_t corosync_stats_create_connection (const char* name, &zero_64, sizeof (zero_64), OBJDB_VALUETYPE_UINT64); + objdb->object_key_create_typed (object_handle, + "invalid_request", + &zero_64, sizeof (zero_64), + OBJDB_VALUETYPE_UINT64); + + objdb->object_key_create_typed (object_handle, + "overload", + &zero_64, sizeof (zero_64), + OBJDB_VALUETYPE_UINT64); + return object_handle; } diff --git a/exec/totempg.c b/exec/totempg.c index c51255d..5d8e7a0 100644 --- a/exec/totempg.c +++ b/exec/totempg.c @@ -956,6 +956,7 @@ static int msg_count_send_ok ( int avail = 0; avail = totemmrp_avail (); + totempg_stats.msg_queue_avail = avail; return ((avail - totempg_reserved) > msg_count); } @@ -980,6 +981,7 @@ static int send_reserve ( msg_count = (msg_size / (totempg_totem_config->net_mtu - sizeof (struct totempg_mcast) - 16)) + 1; totempg_reserved += msg_count; + totempg_stats.msg_reserved = totempg_reserved; return (msg_count); } @@ -988,6 +990,7 @@ static void send_release ( int msg_count) { totempg_reserved -= msg_count; + totempg_stats.msg_reserved = totempg_reserved; } int totempg_callback_token_create ( diff --git a/include/corosync/totem/totem.h b/include/corosync/totem/totem.h index 090a0db..239b035 100644 --- a/include/corosync/totem/totem.h +++ b/include/corosync/totem/totem.h @@ -278,6 +278,8 @@ typedef struct { typedef struct { totem_stats_header_t hdr; totemmrp_stats_t *mrp; + uint32_t msg_reserved; + uint32_t msg_queue_avail; } totempg_stats_t; #endif /* TOTEM_H_DEFINED */
_______________________________________________ Openais mailing list [email protected] https://lists.linux-foundation.org/mailman/listinfo/openais
