Browse Source

MT#55283 export poller thread stats

Change-Id: I5b8b2e6c791d27a1d29e982c72005aff38e7cd6d
pull/1993/merge
Richard Fuchs 2 weeks ago
parent
commit
d279b14a99
5 changed files with 41 additions and 1 deletions
  1. +1
    -1
      daemon/main.c
  2. +13
    -0
      daemon/statistics.c
  3. +2
    -0
      include/main.h
  4. +23
    -0
      t/test-stats.c
  5. +2
    -0
      t/test-transcode.c

+ 1
- 1
daemon/main.c View File

@ -68,7 +68,7 @@
struct poller **rtpe_pollers;
struct poller *rtpe_control_poller;
static unsigned int num_rtpe_pollers;
static unsigned int num_poller_threads;
unsigned int num_poller_threads;
struct poller_thread *rtpe_poller_threads;
unsigned int num_media_pollers;
unsigned int rtpe_poller_rr_iter;


+ 13
- 0
daemon/statistics.c View File

@ -912,6 +912,19 @@ stats_metric_q *statistics_gather_metrics(struct interface_sampled_rate_stats *i
mutex_unlock(&rtpe_codec_stats_lock);
HEADER("]", "");
HEADER("poller_threads", NULL);
HEADER("[", NULL);
for (unsigned int i = 0; i < num_poller_threads; i++) {
struct poller_thread *pt = &rtpe_poller_threads[i];
HEADER("{", "");
METRICs("index", "%u", i);
METRICs("pid", "%u", (unsigned int) pt->pid);
METRICs("wakeups", "%" PRIu64, atomic64_get_na(&pt->wakeups));
METRICs("items", "%" PRIu64, atomic64_get_na(&pt->items));
HEADER("}", "");
}
HEADER("]", NULL);
HEADER("}", NULL);
return ret;


+ 2
- 0
include/main.h View File

@ -316,6 +316,8 @@ extern struct poller **rtpe_pollers; // at least one poller, in an array
extern struct poller *rtpe_control_poller; // poller for control sockets (maybe rtpe_pollers[0])
extern unsigned int num_media_pollers; // for media sockets, >= 1
extern unsigned int rtpe_poller_rr_iter; // round-robin assignment of pollers to each thread
extern unsigned int num_poller_threads;
extern struct poller_thread *rtpe_poller_threads;
INLINE struct poller *rtpe_get_poller(void) {


+ 23
- 0
t/test-stats.c View File

@ -18,6 +18,8 @@ struct rtpengine_config rtpe_config = {
};
struct rtpengine_config initial_rtpe_config;
struct poller **rtpe_pollers = (struct poller *[]) {NULL};
unsigned int num_poller_threads;
struct poller_thread *rtpe_poller_threads;
struct poller *rtpe_control_poller;
struct poller *uring_poller;
unsigned int num_media_pollers = 1;
@ -1265,6 +1267,9 @@ int main(void) {
"[\n"
"\n"
"]\n"
"poller_threads\n"
"[\n"
"]\n"
"}\n");
RTPE_STATS_INC(ng_commands[OP_OFFER]);
@ -2451,6 +2456,9 @@ int main(void) {
"[\n"
"\n"
"]\n"
"poller_threads\n"
"[\n"
"]\n"
"}\n");
RTPE_STATS_INC(ng_commands[OP_ANSWER]);
@ -3634,6 +3642,9 @@ int main(void) {
"[\n"
"\n"
"]\n"
"poller_threads\n"
"[\n"
"]\n"
"}\n");
// test cmd_ps_min/max/avg
@ -4836,6 +4847,9 @@ int main(void) {
"[\n"
"\n"
"]\n"
"poller_threads\n"
"[\n"
"]\n"
"}\n");
// test average call duration
@ -6027,6 +6041,9 @@ int main(void) {
"[\n"
"\n"
"]\n"
"poller_threads\n"
"[\n"
"]\n"
"}\n");
@ -7212,6 +7229,9 @@ int main(void) {
"[\n"
"\n"
"]\n"
"poller_threads\n"
"[\n"
"]\n"
"}\n");
@ -8400,6 +8420,9 @@ int main(void) {
"[\n"
"\n"
"]\n"
"poller_threads\n"
"[\n"
"]\n"
"}\n");


+ 2
- 0
t/test-transcode.c View File

@ -13,6 +13,8 @@ int _log_facility_dtmf;
struct rtpengine_config rtpe_config;
struct rtpengine_config initial_rtpe_config;
struct poller **rtpe_pollers;
unsigned int num_poller_threads;
struct poller_thread *rtpe_poller_threads;
struct poller *rtpe_control_poller;
struct poller *uring_poller;
unsigned int num_media_pollers;


Loading…
Cancel
Save