~ihabunek/triglav

5f140d5be584b3d73ef936a4894c6f6bf61c7c70 — Ivan Habunek 9 months ago de1e145
Add timing to validate routes task
1 files changed, 8 insertions(+), 1 deletions(-)

M lib/mix/tasks/triglav/validate_routes.ex
M lib/mix/tasks/triglav/validate_routes.ex => lib/mix/tasks/triglav/validate_routes.ex +8 -1
@@ 18,7 18,14 @@ defmodule Mix.Tasks.Triglav.ValidateRoutes do
  def run(_args) do
    Application.put_env(:triglav, :repo_only, true)
    {:ok, _} = Application.ensure_all_started(:triglav)
    validate_routes()

    Logger.info("Starting validation...")

    {time, _} = :timer.tc(&validate_routes/0)

    time_seconds = :erlang.float_to_binary(time / 1_000_000, decimals: 2)

    Logger.info("Done. Took #{time_seconds} seconds.")
  end

  @spec validate_routes() :: :ok | :error