summaryrefslogtreecommitdiff
path: root/benchmarks
diff options
context:
space:
mode:
authorMaksim Pechnikov <parallel588@gmail.com>2019-11-22 14:17:12 +0300
committerMaksim Pechnikov <parallel588@gmail.com>2019-11-22 14:17:12 +0300
commit1d6970baf1fd09c357740a380351adf44f247279 (patch)
tree7a3d743a176903d56786b83e016bf0cac65193a5 /benchmarks
parent1fcd579b6d8c26557dcc6f9d3c9f247d03e7b5a4 (diff)
fix
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/load_testing/fetcher.ex36
1 files changed, 27 insertions, 9 deletions
diff --git a/benchmarks/load_testing/fetcher.ex b/benchmarks/load_testing/fetcher.ex
index 776105d34..a45a71d4a 100644
--- a/benchmarks/load_testing/fetcher.ex
+++ b/benchmarks/load_testing/fetcher.ex
@@ -57,9 +57,6 @@ 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
})
@@ -77,8 +74,6 @@ 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", %{
@@ -102,10 +97,33 @@ defmodule Pleroma.LoadTesting.Fetcher do
})
end,
"Rendering favorites timeline" => fn ->
- Pleroma.Web.MastodonAPI.StatusView.render("index.json", %{
- activities: user_favourites,
- for: user,
- as: :activity})
+ conn = Phoenix.ConnTest.build_conn(:get, "http://localhost:4001/api/v1/favourites", nil)
+ Pleroma.Web.MastodonAPI.StatusController.favourites(
+ %Plug.Conn{conn |
+ assigns: %{user: user},
+ query_params: %{"limit" => "0"},
+ body_params: %{},
+ cookies: %{},
+ params: %{},
+ path_params: %{},
+ private: %{
+ Pleroma.Web.Router => {[], %{}},
+ phoenix_router: Pleroma.Web.Router,
+ phoenix_action: :favourites,
+ phoenix_controller: Pleroma.Web.MastodonAPI.StatusController,
+ phoenix_endpoint: Pleroma.Web.Endpoint,
+ phoenix_format: "json",
+ phoenix_layout: {Pleroma.Web.LayoutView, "app.html"},
+ phoenix_recycled: true,
+
+ phoenix_view: Pleroma.Web.MastodonAPI.StatusView,
+ plug_session: %{"user_id" => user.id},
+ plug_session_fetch: :done,
+ plug_session_info: :write,
+ plug_skip_csrf_protection: true
+ }
+ },
+ %{})
end,
})
end