benchmarks/ added favourites timeline

This commit is contained in:
Maksim Pechnikov 2019-11-19 21:11:15 +03:00
commit 1fcd579b6d
3 changed files with 34 additions and 1 deletions

View file

@ -57,6 +57,9 @@ defmodule Pleroma.LoadTesting.Fetcher do
Pleroma.Web.ActivityPub.ActivityPub.fetch_public_activities(
mastodon_federated_timeline_params
)
end,
"User favourites timeline" => fn ->
Pleroma.Web.ActivityPub.ActivityPub.fetch_favourites(user)
end
})
@ -74,6 +77,8 @@ defmodule Pleroma.LoadTesting.Fetcher do
mastodon_federated_timeline_params
)
user_favourites = Pleroma.Web.ActivityPub.ActivityPub.fetch_favourites(user)
Benchee.run(%{
"Rendering home timeline" => fn ->
Pleroma.Web.MastodonAPI.StatusView.render("index.json", %{
@ -95,7 +100,13 @@ defmodule Pleroma.LoadTesting.Fetcher do
for: user,
as: :activity
})
end
end,
"Rendering favorites timeline" => fn ->
Pleroma.Web.MastodonAPI.StatusView.render("index.json", %{
activities: user_favourites,
for: user,
as: :activity})
end,
})
end