1
0
Fork 1
mirror of https://akkoma.dev/AkkomaGang/akkoma.git synced 2024-12-25 04:53:06 +00:00
akkoma/benchmarks/load_testing/helper.ex

15 lines
419 B
Elixir
Raw Normal View History

2019-08-02 19:33:12 +01:00
defmodule Pleroma.LoadTesting.Helper do
2020-02-18 09:19:10 +00:00
alias Ecto.Adapters.SQL
alias Pleroma.Repo
2020-01-14 11:42:30 +00:00
def to_sec(microseconds), do: microseconds / 1_000_000
2020-02-18 09:19:10 +00:00
def clean_tables do
IO.puts("Deleting old data...\n")
SQL.query!(Repo, "TRUNCATE users CASCADE;")
SQL.query!(Repo, "TRUNCATE activities CASCADE;")
SQL.query!(Repo, "TRUNCATE objects CASCADE;")
SQL.query!(Repo, "TRUNCATE oban_jobs CASCADE;")
end
2019-08-02 19:33:12 +01:00
end