Merge branch 'delete_orphaned_activities' into develop
[akkoma] / benchmarks / load_testing / helper.ex
1 defmodule Pleroma.LoadTesting.Helper do
2 alias Ecto.Adapters.SQL
3 alias Pleroma.Repo
4
5 def to_sec(microseconds), do: microseconds / 1_000_000
6
7 def clean_tables do
8 IO.puts("Deleting old data...\n")
9 SQL.query!(Repo, "TRUNCATE users CASCADE;")
10 SQL.query!(Repo, "TRUNCATE activities CASCADE;")
11 SQL.query!(Repo, "TRUNCATE objects CASCADE;")
12 SQL.query!(Repo, "TRUNCATE oban_jobs CASCADE;")
13 end
14 end