aboutsummaryrefslogtreecommitdiff
path: root/lib/mix/tasks/pleroma/benchmark.ex
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2019-07-15 17:10:27 -0500
committerMark Felder <feld@FreeBSD.org>2019-07-15 17:10:27 -0500
commitffb4eb9779ddd28ecee84c06e8dc58f4a4daaa38 (patch)
treeb397d1192c69a7d089c86d41b6e09e89954ea798 /lib/mix/tasks/pleroma/benchmark.ex
parente912f81c828cc7e1d2c0dff8daed3ad52f407a61 (diff)
parent03bcb40883dafa2886110e2b625c4cc5c21106f1 (diff)
downloadpleroma-ffb4eb9779ddd28ecee84c06e8dc58f4a4daaa38.tar.gz
Merge branch 'develop' into feature/matstodon-statuses-by-name
Diffstat (limited to 'lib/mix/tasks/pleroma/benchmark.ex')
-rw-r--r--lib/mix/tasks/pleroma/benchmark.ex29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/mix/tasks/pleroma/benchmark.ex b/lib/mix/tasks/pleroma/benchmark.ex
new file mode 100644
index 000000000..5222cce80
--- /dev/null
+++ b/lib/mix/tasks/pleroma/benchmark.ex
@@ -0,0 +1,29 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Mix.Tasks.Pleroma.Benchmark do
+ import Mix.Pleroma
+ use Mix.Task
+
+ def run(["search"]) do
+ start_pleroma()
+
+ Benchee.run(%{
+ "search" => fn ->
+ Pleroma.Activity.search(nil, "cofe")
+ end
+ })
+ end
+
+ def run(["tag"]) do
+ start_pleroma()
+
+ Benchee.run(%{
+ "tag" => fn ->
+ %{"type" => "Create", "tag" => "cofe"}
+ |> Pleroma.Web.ActivityPub.ActivityPub.fetch_public_activities()
+ end
+ })
+ end
+end