Skip to content

Commit

Permalink
stats: Use duration field from events
Browse files Browse the repository at this point in the history
  • Loading branch information
cmouse committed Oct 17, 2018
1 parent c93059b commit fbe550d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/stats/stats-metrics.c
Expand Up @@ -144,13 +144,9 @@ stats_metrics_get_event_filter(struct stats_metrics *metrics)
static void
stats_metric_event(struct metric *metric, struct event *event)
{
struct timeval tv_start, tv_end;
intmax_t duration = 0;
intmax_t duration;

if (event_get_last_send_time(event, &tv_end)) {
event_get_create_time(event, &tv_start);
duration = timeval_diff_usecs(&tv_end, &tv_start);
}
event_get_last_duration(event, &duration);
stats_dist_add(metric->duration_stats, duration);

for (unsigned int i = 0; i < metric->fields_count; i++) {
Expand Down

0 comments on commit fbe550d

Please sign in to comment.