Browse Source

clean up code artifacts

closes #314

Change-Id: Ie6762654adc67a2cc2fd34c0bdda7a514928d389
changes/85/13085/2
Richard Fuchs 9 years ago
parent
commit
2a03c008ac
3 changed files with 7 additions and 6 deletions
  1. +5
    -4
      daemon/call.c
  2. +0
    -2
      daemon/call.h
  3. +2
    -0
      daemon/statistics.c

+ 5
- 4
daemon/call.c View File

@ -119,6 +119,8 @@ const int num_transport_protocols = G_N_ELEMENTS(transport_protocols);
static void __monologue_destroy(struct call_monologue *monologue);
static int monologue_destroy(struct call_monologue *ml);
static struct timeval add_ongoing_calls_dur_in_interval(struct callmaster *m,
struct timeval *interval_start, struct timeval *interval_duration);
/* called with call->master_lock held in R */
static int call_timer_delete_monologues(struct call *c) {
@ -1775,11 +1777,11 @@ void add_total_calls_duration_in_interval(struct callmaster *cm,
mutex_unlock(&cm->totalstats_interval.total_calls_duration_lock);
}
struct timeval add_ongoing_calls_dur_in_interval(struct callmaster *m,
static struct timeval add_ongoing_calls_dur_in_interval(struct callmaster *m,
struct timeval *interval_start, struct timeval *interval_duration) {
GHashTableIter iter;
gpointer key, value;
struct timeval call_duration, now, res = {0};
struct timeval call_duration, res = {0};
struct call *call;
struct call_monologue *ml;
@ -1794,8 +1796,7 @@ struct timeval add_ongoing_calls_dur_in_interval(struct callmaster *m,
if (timercmp(interval_start, &ml->started, >)) {
timeval_add(&res, &res, interval_duration);
} else {
gettimeofday(&now, NULL);
timeval_subtract(&call_duration, &now, &ml->started);
timeval_subtract(&call_duration, &g_now, &ml->started);
timeval_add(&res, &res, &call_duration);
}
}


+ 0
- 2
daemon/call.h View File

@ -442,8 +442,6 @@ struct callmaster {
struct callmaster *callmaster_new(struct poller *);
void callmaster_get_all_calls(struct callmaster *m, GQueue *q);
struct timeval add_ongoing_calls_dur_in_interval(struct callmaster *m,
struct timeval *iv_start, struct timeval *iv_duration);
//void calls_dump_redis(struct callmaster *);
//void calls_dump_redis_read(struct callmaster *);


+ 2
- 0
daemon/statistics.c View File

@ -176,6 +176,8 @@ void statistics_update_oneway(struct call* c) {
if (c->monologues.head) {
ml = c->monologues.head->data;
timeval_subtract(&tim_result_duration, &g_now, &ml->started);
if (IS_OWN_CALL(c)) {
if (ml->term_reason==TIMEOUT) {
atomic64_inc(&m->totalstats.total_timeout_sess);


Loading…
Cancel
Save