diff --git a/lib/mix/tasks/pleroma/benchmark.ex b/benchmarks/mix/tasks/pleroma/benchmark.ex similarity index 93% rename from lib/mix/tasks/pleroma/benchmark.ex rename to benchmarks/mix/tasks/pleroma/benchmark.ex index f32492169..42b28478d 100644 --- a/lib/mix/tasks/pleroma/benchmark.ex +++ b/benchmarks/mix/tasks/pleroma/benchmark.ex @@ -3,8 +3,20 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Tasks.Pleroma.Benchmark do - import Mix.Pleroma + @shortdoc "Benchmarks" + @moduledoc """ + Benchmark tasks available: + + adapters + render_timeline + search + tag + + MIX_ENV=benchmark mix pleroma.benchmark adapters + """ + use Mix.Task + import Mix.Pleroma def run(["search"]) do start_pleroma() @@ -63,7 +75,7 @@ defmodule Mix.Tasks.Pleroma.Benchmark do Benchee.run( %{ - "Standart rendering" => fn activities -> + "Standard rendering" => fn activities -> Pleroma.Web.MastodonAPI.StatusView.render("index.json", %{ activities: activities, for: user, diff --git a/changelog.d/benchee.skip b/changelog.d/benchee.skip new file mode 100644 index 000000000..e69de29bb diff --git a/mix.exs b/mix.exs index 3c1ce1f7e..e4c14fc9f 100644 --- a/mix.exs +++ b/mix.exs @@ -176,7 +176,6 @@ defmodule Pleroma.Mixfile do {:prometheus_ecto, "~> 1.4"}, {:recon, "~> 2.5"}, {:joken, "~> 2.0"}, - {:benchee, "~> 1.0"}, {:pot, "~> 1.0"}, {:ex_const, "~> 0.2"}, {:plug_static_index_html, "~> 1.0.0"}, @@ -202,7 +201,8 @@ defmodule Pleroma.Mixfile do {:covertool, "~> 2.0", only: :test}, {:hackney, "~> 1.18.0", override: true}, {:mox, "~> 1.0", only: :test}, - {:websockex, "~> 0.4.3", only: :test} + {:websockex, "~> 0.4.3", only: :test}, + {:benchee, "~> 1.0", only: :benchmark} ] ++ oauth_deps() end