Browse Source

MT#55283 track time of last Redis update per call

Change-Id: I8c064abab2650679748416e40bd8debd40b4e7e8
pull/1826/head
Richard Fuchs 2 years ago
parent
commit
e20262489a
4 changed files with 7 additions and 1 deletions
  1. +2
    -1
      daemon/call_interfaces.c
  2. +2
    -0
      daemon/cli.c
  3. +2
    -0
      daemon/redis.c
  4. +1
    -0
      include/call.h

+ 2
- 1
daemon/call_interfaces.c View File

@ -2680,8 +2680,9 @@ void ng_call_stats(call_t *call, const str *fromtag, const str *totag, bencode_i
bencode_dictionary_add_integer(output, "created", call->created.tv_sec);
bencode_dictionary_add_integer(output, "created_us", call->created.tv_usec);
bencode_dictionary_add_integer(output, "last signal", call->last_signal);
ssrc = bencode_dictionary_add_dictionary(output, "SSRC");
bencode_dictionary_add_integer(output, "last redis update", atomic64_get_na(&call->last_redis_update));
ssrc = bencode_dictionary_add_dictionary(output, "SSRC");
tags = bencode_dictionary_add_dictionary(output, "tags");
stats:


+ 2
- 0
daemon/cli.c View File

@ -613,11 +613,13 @@ static void cli_list_call_info(struct cli_writer *cw, call_t *c) {
"tos: %u\n"
"last_signal: %llu\n"
"redis_keyspace: %i\n"
"last redis update: %llu\n"
"foreign: %s\n"
"recording: %s\n"
"\n",
c->callid.s, c->ml_deleted ? "yes" : "no", (int) c->created.tv_sec, c->created_from,
(unsigned int) c->tos, (unsigned long long) c->last_signal, c->redis_hosted_db,
(unsigned long long) atomic64_get_na(&c->last_redis_update),
IS_FOREIGN_CALL(c) ? "yes" : "no", c->recording ? "yes" : "no");
for (__auto_type l = c->monologues.head; l; l = l->next) {


+ 2
- 0
daemon/redis.c View File

@ -2712,6 +2712,8 @@ void redis_update_onekey(call_t *c, struct redis *r) {
if (redis_check_conn(r) == REDIS_STATE_DISCONNECTED)
return;
atomic64_set_na(&c->last_redis_update, rtpe_now.tv_sec);
rwlock_lock_r(&c->master_lock);
redis_expires_s = rtpe_config.redis_expires_secs;


+ 1
- 0
include/call.h View File

@ -761,6 +761,7 @@ struct call {
endpoint_t dtmf_log_dest;
unsigned int redis_hosted_db;
atomic64 last_redis_update;
struct recording *recording;
str metadata;


Loading…
Cancel
Save