Skip to content

Commit

Permalink
feat: debug log with the count of received events
Browse files Browse the repository at this point in the history
  • Loading branch information
paulswartz committed Oct 20, 2023
1 parent 7fb8734 commit 65cf6c1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/concentrate/merge_filter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ defmodule Concentrate.MergeFilter do

@impl GenStage
def handle_events(events, from, state) do
_ =
Logger.debug(fn ->
"#{__MODULE__} received events from=#{inspect(from)} event_count=#{length(events)}"
end)

{state, updated_keys} =
Enum.reduce(events, {state, []}, fn event, {state, updated_keys} ->
key = FeedUpdate.url(event) || from
Expand Down Expand Up @@ -122,7 +127,7 @@ defmodule Concentrate.MergeFilter do

_ =
Logger.debug(fn ->
"#{__MODULE__} merge time=#{time / 1_000}"
"#{__MODULE__} merge time=#{time / 1_000} keys=#{inspect(keys, limit: :infinity)}"
end)

{time, filtered} = :timer.tc(&Filter.run/2, [merged, state.filters])
Expand Down

0 comments on commit 65cf6c1

Please sign in to comment.