Merge remote-tracking branch 'pleroma/develop' into feature/disable-account
[akkoma] / lib / mix / tasks / benchmark.ex
1 defmodule Mix.Tasks.Pleroma.Benchmark do
2 use Mix.Task
3 alias Mix.Tasks.Pleroma.Common
4
5 def run(["search"]) do
6 Common.start_pleroma()
7
8 Benchee.run(%{
9 "search" => fn ->
10 Pleroma.Web.MastodonAPI.MastodonAPIController.status_search(nil, "cofe")
11 end
12 })
13 end
14
15 def run(["tag"]) do
16 Common.start_pleroma()
17
18 Benchee.run(%{
19 "tag" => fn ->
20 %{"type" => "Create", "tag" => "cofe"}
21 |> Pleroma.Web.ActivityPub.ActivityPub.fetch_public_activities()
22 end
23 })
24 end
25 end