From: Jeff Hostetler <[email protected]>

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 <[email protected]>
---
 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

Reply via email to