benchee
benchee copied to clipboard
Benchee throws an exception when running in the Livebook-App
Hello
Benchee
runs great in Livebook, but raises an exception in the Livebook-App.
In the Livebook-App the file Path.join([:code.root_dir(), "releases", otp_release, "OTP_VERSION"])
is not available.
Maybe Benchee.System.erlang/0
could return otp_release
as a fallback.
Huh, thanks for the report. Guess I have to get playing with live book. Weird that it isn't there but yeah... that this is the way to get the OTP version is still very sad.
We can do that, we rely on the correct version for some switches in logic though (sadly). But well, better than crashing.
@PragTob if you want to play with Livebook you can give benchee_dsl.livemd a try. I borrowed some lines from your readme for the notebook.
A quick workaround to prevent the crash is:
otp_release = :erlang.system_info(:otp_release)
File.mkdir_p!(Path.join([:code.root_dir(), "releases", otp_release]))
Path.join([:code.root_dir(), "releases", otp_release, "OTP_VERSION"])
|> File.write!("25.0")
The OTP version of the most recent livebook app seems to be 25.0 link.