From 808db902603b0454057874327cfabbcad46f1a88 Mon Sep 17 00:00:00 2001 From: Donald Hutchison Date: Thu, 25 Jan 2024 15:16:41 +0100 Subject: [PATCH] Revert "Add logging to repo_helper to get timing info." This reverts commit 24bc5bce8a46416c7d9eb101427f39beea62a99e. --- apps/explorer/lib/explorer/repo/repo_helper.ex | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/apps/explorer/lib/explorer/repo/repo_helper.ex b/apps/explorer/lib/explorer/repo/repo_helper.ex index 3915ed94a92c..292d7a94513d 100644 --- a/apps/explorer/lib/explorer/repo/repo_helper.ex +++ b/apps/explorer/lib/explorer/repo/repo_helper.ex @@ -35,32 +35,16 @@ defmodule Explorer.Repo.RepoHelper do chunk_size = Keyword.get(opts, :chunk_size, @chunk_size) - chunks = ceil(length(elements) / chunk_size) - if chunks > 1 do - Logger.info("!!!! safe_insert_all #{kind |> to_string()} chunks #{chunks}") - end - - global_insert_start = System.monotonic_time() - elements |> Enum.chunk_every(chunk_size) |> Enum.reduce({0, []}, fn chunk, {total_count, acc} -> - local_insert_start = System.monotonic_time() - {count, inserted} = try do - result = __MODULE__.insert_all(kind, chunk, opts) - if chunks > 1 do - local_insert_end = System.monotonic_time() - Logger.info("!!!! inserted #{kind |> to_string()} in #{local_insert_end - local_insert_start} (global #{local_insert_end - global_insert_start})") - end - result + __MODULE__.insert_all(kind, chunk, opts) rescue exception -> old_truncate = Application.get_env(:logger, :truncate) Logger.configure(truncate: :infinity) - failed = System.monotonic_time() - Logger.info("!!!! failed #{kind |> to_string()} in #{failed - local_insert_start} (global #{failed - global_insert_start})") Logger.error(fn -> [