Skip to content

Commit

Permalink
fix process.info in metrics (#582)
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-hek authored Jul 20, 2023
1 parent ea0570c commit 610984e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/membrane/core/element.ex
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,17 @@ defmodule Membrane.Core.Element do
self_pid = self()

Stalker.register_metric_function(:message_queue_length, fn ->
:erlang.process_info(self_pid, :message_queue_len) |> elem(1)
case Process.info(self_pid, :message_queue_len) do
{:message_queue_len, len} -> len
nil -> 0
end
end)

Stalker.register_metric_function(:total_reductions, fn ->
:erlang.process_info(self_pid, :reductions) |> elem(1)
case Process.info(self_pid, :reductions) do
{:reductions, reductions} -> reductions
nil -> 0
end
end)

state =
Expand Down

0 comments on commit 610984e

Please sign in to comment.