Skip to content

Commit

Permalink
add :bench environment
Browse files Browse the repository at this point in the history
  • Loading branch information
ProducerMatt committed May 12, 2024
1 parent 3844b23 commit 378a356
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions bench.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
if [[ -z "$1" ]]; then
echo "Needs a .exs script"
exit 1
fi
MIX_ENV="bench" mix run $1
5 changes: 5 additions & 0 deletions bench/plugin_testing.ex
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,11 @@ inputs = %{
msgs: T.make_messages(512, 1),
max_concurrency: 8
}
# "20 fast modules, 1 message 1 thread" => %{
# mods: T.make_fake_modules(20, :fast),
# msgs: T.make_messages(1, 1),
# max_concurrency: 1
# }
}

suites = %{
Expand Down
4 changes: 2 additions & 2 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ extra_metadata =
config :stampede,
compile_env: Mix.env()

config :stampede, :type_check, enable_runtime_checks: Mix.env() != :bench

config :stampede, Stampede.Scheduler,
jobs: [
{"@daily", {Stampede.Interact, :clean_interactions!, []}}
Expand Down Expand Up @@ -79,8 +81,6 @@ config :nostrum,
config :mnesia,
dir: ~c".mnesia/#{Mix.env()}/#{node()}"

config :stampede, :type_check, enable_runtime_checks: false

for config <- "./*.secret.exs" |> Path.expand(__DIR__) |> Path.wildcard() do
import_config config
end
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ defmodule Stampede.MixProject do
{:stream_data, "~> 0.5.0"},

# Benchmarking
{:benchee, "~> 1.1", runtime: false, only: :dev},
{:benchee, "~> 1.1", runtime: false, only: :bench},

# profiling
# {:eflambe, ">= 0.0.0", only: :dev},
Expand Down

0 comments on commit 378a356

Please sign in to comment.