-
-
Save mschae/945c7f11423a68010ab2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Morgue.Repo do | |
use Ecto.Repo, otp_app: :my_awesome_app | |
def log(log_entry) do | |
:ok = :exometer.update ~w(my_awesome_webapp ecto query_exec_time)a, (log_entry.query_time + log_entry.queue_time || 0) / 1_000 | |
:ok = :exometer.update ~w(my_awesome_webapp ecto query_queue_time)a, (log_entry.queue_time || 0) / 1_000 # Note: You will have to add this to conf/exometer.exs if you want it | |
:ok = :exometer.update ~w(my_awesome_webapp ecto query_count)a, 1 | |
super log_entry | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment