| 644 | } |
| 645 | |
| 646 | static void fn_timer(const struct tr2_timer_metadata *meta, |
| 647 | const struct tr2_timer *timer, |
| 648 | int is_final_data) |
| 649 | { |
| 650 | const char *event_name = is_final_data ? "timer" : "th_timer"; |
| 651 | struct json_writer jw = JSON_WRITER_INIT; |
| 652 | double t_total = NS_TO_SEC(timer->total_ns); |
| 653 | double t_min = NS_TO_SEC(timer->min_ns); |
| 654 | double t_max = NS_TO_SEC(timer->max_ns); |
| 655 | |
| 656 | jw_object_begin(&jw, 0); |
| 657 | event_fmt_prepare(event_name, __FILE__, __LINE__, NULL, &jw); |
| 658 | jw_object_string(&jw, "category", meta->category); |
| 659 | jw_object_string(&jw, "name", meta->name); |
| 660 | jw_object_intmax(&jw, "intervals", timer->interval_count); |
| 661 | jw_object_double(&jw, "t_total", 6, t_total); |
| 662 | jw_object_double(&jw, "t_min", 6, t_min); |
| 663 | jw_object_double(&jw, "t_max", 6, t_max); |
| 664 | jw_end(&jw); |
| 665 | |
| 666 | tr2_dst_write_line(&tr2dst_event, &jw.json); |
| 667 | jw_release(&jw); |
| 668 | } |
| 669 | |
| 670 | static void fn_counter(const struct tr2_counter_metadata *meta, |
| 671 | const struct tr2_counter *counter, |
nothing calls this directly
no test coverage detected