This commit is contained in:
Alexander Strizhakov 2020-03-17 13:47:13 +03:00
parent 1f29ecdcd7
commit 56503c385e
No known key found for this signature in database
GPG key ID: 022896A53AEF1381
2 changed files with 6 additions and 6 deletions

View file

@ -19,7 +19,7 @@ defmodule Pleroma.LoadTesting.Activities do
non_friends_used: 20 non_friends_used: 20
] ]
@max_concurrency 30 @max_concurrency 10
@visibility ~w(public private direct unlisted) @visibility ~w(public private direct unlisted)
@types ~w(simple emoji mentions hell_thread attachment tag like reblog simple_thread remote) @types ~w(simple emoji mentions hell_thread attachment tag like reblog simple_thread remote)
@ -81,7 +81,7 @@ def generate(user, opts \\ []) do
) )
end) end)
IO.puts("Generating iterations activities take #{to_sec(time)} sec.\n") IO.puts("Generating iterations of activities take #{to_sec(time)} sec.\n")
:ok :ok
end end

View file

@ -14,7 +14,7 @@ defmodule Pleroma.LoadTesting.Users do
friends: 100 friends: 100
] ]
@max_concurrency 30 @max_concurrency 10
@spec generate(keyword()) :: User.t() @spec generate(keyword()) :: User.t()
def generate(opts \\ []) do def generate(opts \\ []) do
@ -31,7 +31,7 @@ def generate(opts \\ []) do
end end
def generate_users(max) do def generate_users(max) do
IO.puts("Starting generating #{opts[:users]} users...") IO.puts("Starting generating #{max} users...")
{time, _} = {time, _} =
:timer.tc(fn -> :timer.tc(fn ->
@ -87,7 +87,7 @@ defp user_urls(%{local: false} = user) do
end end
def make_friends(main_user, max) when is_integer(max) do def make_friends(main_user, max) when is_integer(max) do
IO.puts("Starting making friends for #{opts[:friends]} users...") IO.puts("Starting making friends for #{max} users...")
{time, _} = {time, _} =
:timer.tc(fn -> :timer.tc(fn ->
@ -107,7 +107,7 @@ def make_friends(main_user, max) when is_integer(max) do
IO.puts("Making friends take #{to_sec(time)} sec.\n") IO.puts("Making friends take #{to_sec(time)} sec.\n")
end end
defp make_friends(%User{} = main_user, %User{} = user) do def make_friends(%User{} = main_user, %User{} = user) do
{:ok, _} = User.follow(main_user, user) {:ok, _} = User.follow(main_user, user)
{:ok, _} = User.follow(user, main_user) {:ok, _} = User.follow(user, main_user)
end end