[PATCH v1 14/25] structured-logging: add timer around preload_index
- From
- git@jeffhostetler.com <git@jeffhostetler.com>
- Date
- Jul 13, 2018, 16:56 UTC
- Message-ID
- <20180713165621.52017-15-git@jeffhostetler.com>
- In-Reply-To
- <20180713165621.52017-1-git@jeffhostetler.com>
From: Jeff Hostetler <jeffhost@microsoft.com>
Use a SLOG timer to record the time spend in preload_index() and report it in the "cmd_exit" event.
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> --- preload-index.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/preload-index.c b/preload-index.c index 4d08d44..572bb56 100644 --- a/preload-index.c +++ b/preload-index.c @@ -116,8 +116,14 @@ static void preload_index(struct index_state *index, int read_index_preload(struct index_state *index, const struct pathspec *pathspec) { + int slog_tid; int retval = read_index(index); + slog_tid = slog_start_timer("index", "preload"); + preload_index(index, pathspec); + + slog_stop_timer(slog_tid); + return retval; }
-- 2.9.3