I’m using HTTPoison and Hackney pools:
:hackney_pool.child_spec(:start, [checkout_timeout: ..., max_connections: 100]),
:hackney_pool.child_spec(:trigger, [checkout_timeout: ..., max_connections: 100]),
:hackney_pool.child_spec(:result, [checkout_timeout: ..., max_connections: 100])
...
HTTPoison.get('...', [...], [
...,
hackney: [pool: :start]
])
Is there any way to сatch the number of running/queuing connections and monitor them in live? Thanks
You can use the get_stats/1 function on
:hackney_pool. This returns a proplist (keyword list in Elixir) with:Then you can use the Keyword.fetch/2 function to get the
:in_use_countvalue, which will tell you the active connection count. I'm not 100% sure on how you'd monitor it though.