Skip to content

Commit

Permalink
OPS-9: Enhance the support for diagnosing slow SIP processing
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuchircu committed Apr 12, 2019
1 parent 94d3d31 commit 6e33e7c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions core_stats.c
Expand Up @@ -57,6 +57,7 @@ stat_var* err_rpls;
stat_var* bad_URIs;
stat_var* unsupported_methods;
stat_var* bad_msg_hdr;
stat_var* slow_msgs;


stat_export_t core_stats[] = {
Expand All @@ -71,6 +72,7 @@ stat_export_t core_stats[] = {
{"bad_URIs_rcvd", 0, &bad_URIs },
{"unsupported_methods", 0, &unsupported_methods },
{"bad_msg_hdr", 0, &bad_msg_hdr },
{"slow_messages" , 0, &slow_msgs },
{"timestamp", STAT_IS_FUNC, (stat_var**)get_ticks },
{0,0,0}
};
Expand Down
3 changes: 3 additions & 0 deletions core_stats.h
Expand Up @@ -74,6 +74,9 @@ extern stat_var* unsupported_methods;
/*! \brief Set in get_hdr_field(). */
extern stat_var* bad_msg_hdr;

/*! \brief SIP message processing which exceeded 'threshold' duration */
extern stat_var* slow_msgs;

#ifdef PKG_MALLOC
int init_pkg_stats(int no_procs);
#endif
Expand Down
4 changes: 2 additions & 2 deletions receive.c
Expand Up @@ -274,8 +274,8 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info,
context_destroy(CONTEXT_GLOBAL, ctx);

current_processing_ctx = NULL;
stop_expire_timer( start, execmsgthreshold, "msg processing",
msg->buf, msg->len, 0);
__stop_expire_timer( start, execmsgthreshold, "msg processing",
msg->buf, msg->len, 0, slow_msgs);
reset_longest_action_list(execmsgthreshold);

/* free possible loaded avps -bogdan */
Expand Down

0 comments on commit 6e33e7c

Please sign in to comment.