Skip to content

Commit

Permalink
Drop negative memory measurements
Browse files Browse the repository at this point in the history
Sadly this isn't really testable in our current structure,
but the test isn't really worth that re-architecturing I think sooo

Also of course ideally we wouldn't need this - but this is a good
guard for now to not let bad values through.
  • Loading branch information
PragTob committed Mar 16, 2018
1 parent c5523c0 commit 264e158
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/benchee/benchmark/runner.ex
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ defmodule Benchee.Benchmark.Runner do

# We return nil if no memory measurement is performed so keep it empty
defp updated_memory_usages(nil, memory_usages), do: memory_usages
defp updated_memory_usages(memory_usage, memory_usages) when memory_usage < 0, do: memory_usages
defp updated_memory_usages(memory_usage, memory_usages), do: [memory_usage | memory_usages]

defp iteration_measurements(
Expand Down

0 comments on commit 264e158

Please sign in to comment.