Browse Source

MT#55283 convert rtpe_started to int64_t

Change-Id: Ib80187cfa9abd7f947926b9195e998bee6369ff6
pull/1938/head
Richard Fuchs 8 months ago
parent
commit
c59864d3d8
3 changed files with 5 additions and 5 deletions
  1. +3
    -3
      daemon/statistics.c
  2. +1
    -1
      include/statistics.h
  3. +1
    -1
      t/test-stats.c

+ 3
- 3
daemon/statistics.c View File

@ -9,7 +9,7 @@
#include "control_ng.h"
#include "bufferpool.h"
struct timeval rtpe_started;
int64_t rtpe_started;
mutex_t rtpe_codec_stats_lock;
@ -387,7 +387,7 @@ stats_metric_q *statistics_gather_metrics(struct interface_sampled_rate_stats *i
HEADER("totalstatistics", "Total statistics (does not include current running sessions):");
HEADER("{", "");
METRIC("uptime", "Uptime of rtpengine", "%" PRId64, "%" PRId64 " seconds", timeval_diff(timeval_from_us(rtpe_now), rtpe_started) / 1000000);
METRIC("uptime", "Uptime of rtpengine", "%" PRId64, "%" PRId64 " seconds", (rtpe_now - rtpe_started) / 1000000);
PROM("uptime_seconds", "gauge");
METRIC("managedsessions", "Total managed sessions", "%" PRIu64, "%" PRIu64, num_sessions);
@ -948,7 +948,7 @@ static void codec_stats_free(struct codec_stats *stats_entry) {
TYPED_GHASHTABLE_IMPL(codec_stats_ht, c_str_hash, c_str_equal, NULL, codec_stats_free)
void statistics_init(void) {
gettimeofday(&rtpe_started, NULL);
rtpe_started = now_us();
rtpe_stats = bufferpool_alloc0(shm_bufferpool, sizeof(*rtpe_stats));
mutex_init(&rtpe_codec_stats_lock);


+ 1
- 1
include/statistics.h View File

@ -101,7 +101,7 @@ struct call_stats {
struct stream_stats totals[4]; /* rtp in, rtcp in, rtp out, rtcp out */
};
extern struct timeval rtpe_started;
extern int64_t rtpe_started;
extern mutex_t rtpe_codec_stats_lock;
extern codec_stats_ht rtpe_codec_stats;


+ 1
- 1
t/test-stats.c View File

@ -82,7 +82,7 @@ int main(void) {
// fake current time
rtpe_now = 150 * 1000000LL;
rtpe_started = (struct timeval) {80,0};
rtpe_started = 80 * 1000000LL;
// test cmd_time_min/max/avg


Loading…
Cancel
Save