merge develop
[akkoma] / lib / mix / tasks / pleroma / benchmark.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Mix.Tasks.Pleroma.Benchmark do
6 import Mix.Pleroma
7 use Mix.Task
8
9 def run(["search"]) do
10 start_pleroma()
11
12 Benchee.run(%{
13 "search" => fn ->
14 Pleroma.Activity.search(nil, "cofe")
15 end
16 })
17 end
18
19 def run(["tag"]) do
20 start_pleroma()
21
22 Benchee.run(%{
23 "tag" => fn ->
24 %{"type" => "Create", "tag" => "cofe"}
25 |> Pleroma.Web.ActivityPub.ActivityPub.fetch_public_activities()
26 end
27 })
28 end
29 end