Skip to content

Commit

Permalink
Merge pull request #198 from PragTob/warn-memory-otp-18
Browse files Browse the repository at this point in the history
Add warning for memory measurement on OTP 18
  • Loading branch information
devonestes committed Mar 14, 2018
2 parents 5b87bca + ce5c76a commit ec0facf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/benchee/configuration.ex
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,20 @@ defmodule Benchee.Configuration do

defp update_measure_memory(config = %{measure_memory: measure_memory}) do
otp_version = List.to_integer(:erlang.system_info(:otp_release))
if measure_memory and otp_version <= 18, do: print_memory_measure_warning()
Map.put(config, :measure_memory, measure_memory and otp_version > 18)
end

defp print_memory_measure_warning do
IO.puts("""
Measuring memory consumption is only available on OTP 19 or greater.
If you would like to benchmark memory consumption, please upgrade to a
newer verion of OTP.
""")
end

defp save_option_conversion(config = %{save: false}) do
config
end
Expand Down

0 comments on commit ec0facf

Please sign in to comment.