summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfeld <feld@feld.me>2023-11-08 18:27:08 +0000
committerfeld <feld@feld.me>2023-11-08 18:27:08 +0000
commita51f3937eef0c6add91234863d5f936c59830d88 (patch)
tree749d6493f3ddd26074e74114ae3a1f85c6605f57
parentaef1a88dc65bbcb46e9244a14d5bbeff9cdbcddc (diff)
parente23672d82f0a6e61bf4ada65cfca6cfbc647710d (diff)
downloadpleroma-a51f3937eef0c6add91234863d5f936c59830d88.tar.gz
pleroma-a51f3937eef0c6add91234863d5f936c59830d88.zip
Merge branch 'benchee' into 'develop'
Ensure benchee doesn't run unless we are executing benchmarks See merge request pleroma/pleroma!3972
-rw-r--r--benchmarks/mix/tasks/pleroma/benchmark.ex (renamed from lib/mix/tasks/pleroma/benchmark.ex)16
-rw-r--r--changelog.d/benchee.skip0
-rw-r--r--mix.exs4
3 files changed, 16 insertions, 4 deletions
diff --git a/lib/mix/tasks/pleroma/benchmark.ex b/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
--- /dev/null
+++ b/changelog.d/benchee.skip
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