Browse Source

MT#55283 convert ng_command_stats to int64_t

Change-Id: Iab5acb85dc2b857ffc3d4cbe8128a58907474c8f
pull/1938/head
Richard Fuchs 8 months ago
parent
commit
2b81650b13
3 changed files with 3 additions and 4 deletions
  1. +1
    -1
      daemon/control_ng.c
  2. +1
    -2
      daemon/statistics.c
  3. +1
    -1
      include/control_ng.h

+ 1
- 1
daemon/control_ng.c View File

@ -872,7 +872,7 @@ static void control_ng_process_payload(ng_ctx *hctx, str *reply, str *data, cons
if (command_ctx.opmode >= 0 && command_ctx.opmode < OP_COUNT) {
mutex_lock(&cur->cmd[command_ctx.opmode].lock);
cur->cmd[command_ctx.opmode].count++;
cur->cmd[command_ctx.opmode].time = timeval_add(cur->cmd[command_ctx.opmode].time, cmd_process_time);
cur->cmd[command_ctx.opmode].time += timeval_us(cmd_process_time);
mutex_unlock(&cur->cmd[command_ctx.opmode].lock);
}


+ 1
- 2
daemon/statistics.c View File

@ -616,8 +616,7 @@ stats_metric_q *statistics_gather_metrics(struct interface_sampled_rate_stats *i
mn = g_strdup_printf("%sduration", ng_command_strings_short[i]);
lw = g_ascii_strdown(mn, -1);
METRICs(lw, "%.6f", (double) cur->cmd[i].time.tv_sec +
(double) cur->cmd[i].time.tv_usec / 1000000.);
METRICs(lw, "%.6f", (double) cur->cmd[i].time / 1000000.);
PROM("request_seconds_total", "counter");
PROMLAB("proxy=\"%s\",request=\"%s\"", sockaddr_print_buf(&cur->proxy),
ng_command_strings[i]);


+ 1
- 1
include/control_ng.h View File

@ -48,7 +48,7 @@ enum ng_opmode {
struct ng_command_stats {
mutex_t lock;
unsigned int count;
struct timeval time;
int64_t time;
};
struct control_ng_stats {


Loading…
Cancel
Save