lkananowicz

lkananowicz

Monitoring connections pool of Ecto repo

Hi, I am looking for a way to monitor connections pool of Ecto repo. Basically we want to measure maximum capacity of our application, sort of a load/performace testing of app and DB.

We are using Postgres adapter in our application and have defined multiple repos with different pool_size options. Is there an existing library or examples on how to check/count active DB connections in real time? We were considering db_connection behaviour callbacks but just not sure if this is the right direction.

Most Liked

josevalim

josevalim

Creator of Elixir

Ecto emits telemetry events for every query: Ecto.Repo — Ecto v3.14.0

You can use it to track how long you are awaiting on the queue, the query time, as well as decoding time.

Last Post!

lkananowicz

lkananowicz

Thanks, yes, that seems like a very useful solution. I wonder about the case when given query won’t be finished for any reason, like a timeout for example. I guess in that case Telemetry won’t report any events regarding that query?

Where Next?

Popular in Questions Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

Other popular topics Top

Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 44139 214
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

We're in Beta

About us Mission Statement