Skip to content

Commit

Permalink
Merge pull request #4 from Whatnot-Inc/report-channels-joined-on-socket
Browse files Browse the repository at this point in the history
Report number of joined channels on a socket
  • Loading branch information
studzien authored Feb 8, 2024
2 parents 9ba82be + b7ca0eb commit 85a6a25
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/phoenix/socket.ex
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,11 @@ defmodule Phoenix.Socket do
payload: reply
}


state = put_channel(state, pid, topic, join_ref)

num_channels = map_size(state.channels)
:telemetry.execute([:phoenix, :socket, :joined_channels], %{total: num_channels})
{:reply, :ok, encode_reply(socket, reply), {state, socket}}

{:error, reply} ->
Expand Down

0 comments on commit 85a6a25

Please sign in to comment.