Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
binaryseed authored Dec 16, 2024
1 parent 241b4b2 commit c501908
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/new_relic/sampler/beam.ex
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,12 @@ defmodule NewRelic.Sampler.Beam do
end

defp delta(:util, previous, current) do
{active, total} =
{_, {active, total}} =
Enum.zip(previous, current)
|> Enum.map_reduce({0, 0}, fn
{{n, a0, t0}, {n, a1, t1}}, {acc_a, acc_t} ->
{{n, a1 - a0, t1 - t0}, {acc_a + (a1 - a0), acc_t + (t1 - t0)}}
end)
|> elem(1)

safe_div(active, total)
end
Expand Down

0 comments on commit c501908

Please sign in to comment.