Commit c9ba4894 authored by setop's avatar setop 🚀
Browse files

Update decorator.ex

parent e95beb23
...@@ -36,18 +36,12 @@ defmodule Incendium.Decorator do ...@@ -36,18 +36,12 @@ defmodule Incendium.Decorator do
""" """
def incendium_profile_with_tracing(body, _context) do def incendium_profile_with_tracing(body, _context) do
# If we're not in prod, it's safe to profile # If we're not in prod, it's safe to profile
if Mix.env() in [:dev, :test] do Storage.latest_stacks_path()
Storage.latest_stacks_path() |> Path.dirname()
|> Path.dirname() |> File.mkdir_p!()
|> File.mkdir_p!()
quote do quote do
Incendium.profile_with_tracing(fn -> unquote(body) end) Incendium.profile_with_tracing(fn -> unquote(body) end)
# It's never a good idea to profile in prod
# (your functions will run ~10x slower)
end end
end end
end end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment