aboutsummaryrefslogtreecommitdiff
path: root/lib/mix/tasks/benchmark.ex
diff options
context:
space:
mode:
authorRoman Chvanikov <chvanikoff@gmail.com>2019-05-08 17:08:06 +0700
committerRoman Chvanikov <chvanikoff@gmail.com>2019-05-08 17:08:06 +0700
commitb6b5b16ba4d65ecd9812b02d79f844548266eb8b (patch)
tree790623e31fed199f04168bcbddb4222a4bfb0a3a /lib/mix/tasks/benchmark.ex
parent0f0cc2703b7ffb99c58e72782925ea4dd61db41d (diff)
parent14deed7f7d0b88d5c8ac19bb3de467429c289746 (diff)
downloadpleroma-b6b5b16ba4d65ecd9812b02d79f844548266eb8b.tar.gz
Merge develop
Diffstat (limited to 'lib/mix/tasks/benchmark.ex')
-rw-r--r--lib/mix/tasks/benchmark.ex25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/mix/tasks/benchmark.ex b/lib/mix/tasks/benchmark.ex
new file mode 100644
index 000000000..0fbb4dbb1
--- /dev/null
+++ b/lib/mix/tasks/benchmark.ex
@@ -0,0 +1,25 @@
+defmodule Mix.Tasks.Pleroma.Benchmark do
+ use Mix.Task
+ alias Mix.Tasks.Pleroma.Common
+
+ def run(["search"]) do
+ Common.start_pleroma()
+
+ Benchee.run(%{
+ "search" => fn ->
+ Pleroma.Web.MastodonAPI.MastodonAPIController.status_search(nil, "cofe")
+ end
+ })
+ end
+
+ def run(["tag"]) do
+ Common.start_pleroma()
+
+ Benchee.run(%{
+ "tag" => fn ->
+ %{"type" => "Create", "tag" => "cofe"}
+ |> Pleroma.Web.ActivityPub.ActivityPub.fetch_public_activities()
+ end
+ })
+ end
+end