MCPcopy Create free account
hub / github.com/git/git / fn_timer

Function fn_timer

trace2/tr2_tgt_event.c:646–668  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

644}
645
646static 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
670static void fn_counter(const struct tr2_counter_metadata *meta,
671 const struct tr2_counter *counter,

Callers

nothing calls this directly

Calls 8

jw_object_beginFunction · 0.85
event_fmt_prepareFunction · 0.85
jw_object_stringFunction · 0.85
jw_object_intmaxFunction · 0.85
jw_object_doubleFunction · 0.85
jw_endFunction · 0.85
tr2_dst_write_lineFunction · 0.85
jw_releaseFunction · 0.85

Tested by

no test coverage detected