aboutsummaryrefslogtreecommitdiff
path: root/lib/mix/tasks/benchmark.ex
blob: e4b1a638af17c23d125d8ab77db4ffaaf60ceb89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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.Activity.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