TT#14008 add cumulative global stats counters

Change-Id: I884a47c6d3e52fcb5572187fbd71fd11ec08cb8e
pull/1287/head
Richard Fuchs 5 years ago
parent 95a30674ac
commit e32d128bd8

@ -64,6 +64,7 @@ struct xmlrpc_helper {
/* XXX rework these */
struct stats rtpe_statsps;
struct stats rtpe_stats;
struct stats rtpe_stats_cumulative;
rwlock_t rtpe_callhash_lock;
GHashTable *rtpe_callhash;
@ -494,8 +495,7 @@ destroy:
diff_ ## x = 0; \
else \
diff_ ## x = ke->stats.x - ks_val; \
atomic64_add(&ps->stats.x, diff_ ## x); \
atomic64_add(&rtpe_statsps.x, diff_ ## x); \
RTPE_STATS_INC(x, diff_ ## x); \
} while (0)
static void update_requests_per_second_stats(struct requests_ps *request, uint64_t new_val) {

@ -1636,7 +1636,7 @@ static void media_packet_rtp(struct packet_handler_ctx *phc)
phc->payload_type,
FMT_M(endpoint_print_buf(&phc->mp.fsin)));
atomic64_inc(&phc->mp.stream->stats.errors);
atomic64_inc(&rtpe_statsps.errors);
RTPE_STATS_INC(errors, 1);
}
else {
atomic64_inc(&rtp_s->packets);
@ -2071,7 +2071,7 @@ static int stream_packet(struct packet_handler_ctx *phc) {
ilog(LOG_WARNING | LOG_FLAG_LIMIT, "Media packet from %s%s%s discarded due to lack of sink",
FMT_M(endpoint_print_buf(&phc->mp.fsin)));
atomic64_inc(&phc->mp.stream->stats.errors);
atomic64_inc(&rtpe_statsps.errors);
RTPE_STATS_INC(errors, 1);
goto out;
}
@ -2132,7 +2132,7 @@ static int stream_packet(struct packet_handler_ctx *phc) {
ret = -errno;
ilog(LOG_DEBUG,"Error when sending message. Error: %s",strerror(errno));
atomic64_inc(&phc->mp.stream->stats.errors);
atomic64_inc(&rtpe_statsps.errors);
RTPE_STATS_INC(errors, 1);
goto out;
}
@ -2142,8 +2142,8 @@ drop:
atomic64_inc(&phc->mp.stream->stats.packets);
atomic64_add(&phc->mp.stream->stats.bytes, phc->s.len);
atomic64_set(&phc->mp.stream->last_packet, rtpe_now.tv_sec);
atomic64_inc(&rtpe_statsps.packets);
atomic64_add(&rtpe_statsps.bytes, phc->s.len);
RTPE_STATS_INC(packets, 1);
RTPE_STATS_INC(bytes, phc->s.len);
out:
if (phc->unkernelize) {

@ -493,8 +493,15 @@ extern GHashTable *rtpe_callhash;
extern struct call_iterator_list rtpe_call_iterators[NUM_CALL_ITERATORS];
extern struct stats rtpe_statsps; /* per second stats, running timer */
extern struct stats rtpe_stats_cumulative; // total, cumulative
extern struct stats rtpe_stats; /* copied from statsps once a second */
#define RTPE_STATS_INC(field, num) \
do { \
atomic64_add(&rtpe_statsps.field, num); \
atomic64_add(&rtpe_stats_cumulative.field, num); \
} while (0)
int call_init(void);
void call_free(void);

Loading…
Cancel
Save