From 063afd398205c5fdcdb43d2a09a48fc67778d78e Mon Sep 17 00:00:00 2001 From: Mayel de Borniol Date: Tue, 17 Jan 2023 16:59:38 +1300 Subject: [PATCH] misc --- .iex.exs | 9 +++++++++ benchmarks/feeds.ex | 26 -------------------------- flavours/classic/config/dev.exs | 8 +++++--- flavours/classic/config/prod.exs | 2 ++ mix.exs | 4 ++-- 5 files changed, 18 insertions(+), 31 deletions(-) delete mode 100644 benchmarks/feeds.ex diff --git a/.iex.exs b/.iex.exs index 32f73edb0d..458d36b83a 100755 --- a/.iex.exs +++ b/.iex.exs @@ -34,3 +34,12 @@ end # end import_if_enabled(Bonfire.Common.Test.Interactive.Helpers) + +defmodule ObserverCLI do + def observer_cli_start, do: start() + defp start do + Logger.configure(level: :error) + :observer_cli.start + end +end +import ObserverCLI \ No newline at end of file diff --git a/benchmarks/feeds.ex b/benchmarks/feeds.ex deleted file mode 100644 index 5fbb338f4f..0000000000 --- a/benchmarks/feeds.ex +++ /dev/null @@ -1,26 +0,0 @@ -# NOTE: make sure you populate your local with seeds first, and then copy paste this in iex -Logger.configure(level: :warn) -Benchee.run( - %{ - "minimal join/preloads, with boundaries applied" => fn -> Bonfire.Social.FeedActivities.feed(:local, preloads: :with_object) end, - "minimal join/preloads, without boundaries applied" => fn -> Bonfire.Social.FeedActivities.feed(:local, skip_boundary_check: true, preloads: :with_object) end, - - "caching preloads, with boundaries applied" => fn -> Bonfire.Social.FeedActivities.feed(:local) |> Bonfire.Social.Feeds.LiveHandler.preloads(with_cache: true) end, - "caching preloads, without boundaries applied " => fn -> Bonfire.Social.FeedActivities.feed(:local, skip_boundary_check: true) |> Bonfire.Social.Feeds.LiveHandler.preloads(with_cache: true) end, - - "full join/preloads, with boundaries applied" => fn -> Bonfire.Social.FeedActivities.feed(:local, preloads: :feed) end, - "full join/preloads, without boundaries applied" => fn -> Bonfire.Social.FeedActivities.feed(:local, skip_boundary_check: true, preloads: :feed) end, - # "AP:shared_outbox" => fn -> ActivityPubWeb.ObjectView.render("outbox.json", %{outbox: :shared_outbox}) end - }, - parallel: 10, - warmup: 2, - time: 5, - memory_time: 2, - reduction_time: 2, - profile_after: true, - formatters: [ - Benchee.Formatters.HTML, - Benchee.Formatters.Console - ] -) -Logger.configure(level: :debug) diff --git a/flavours/classic/config/dev.exs b/flavours/classic/config/dev.exs index e991cf9bc5..7cdd3aa919 100755 --- a/flavours/classic/config/dev.exs +++ b/flavours/classic/config/dev.exs @@ -86,8 +86,12 @@ config :bonfire, Bonfire.Web.Endpoint, config :bonfire, Bonfire.Web.Endpoint, phoenix_profiler: [server: Bonfire.Web.Profiler] +config :surface, + log_level: :debug + config :logger, - level: :debug, + # level: :debug, + level: :info, truncate: :infinity config :logger, :console, @@ -98,8 +102,6 @@ config :phoenix, :stacktrace_depth, 30 config :phoenix, :plug_init_mode, :runtime -config :surface, :compiler, warn_on_undefined_props: false - config :exsync, src_monitor: true, reload_timeout: 75, diff --git a/flavours/classic/config/prod.exs b/flavours/classic/config/prod.exs index dea572d579..607c772289 100755 --- a/flavours/classic/config/prod.exs +++ b/flavours/classic/config/prod.exs @@ -18,3 +18,5 @@ config :bonfire, Bonfire.Web.Endpoint, server: true config :bonfire, Bonfire.Common.Repo, # in releases migrations are not in a flavour-specific directory priv: "priv/repo" + +# config :surface, :compiler, warn_on_undefined_props: false diff --git a/mix.exs b/mix.exs index d91ab07cb0..bc8f5b4511 100755 --- a/mix.exs +++ b/mix.exs @@ -59,8 +59,8 @@ defmodule Bonfire.Umbrella.MixProject do # {:bypass, "~> 2.1", only: :test}, # used in furlex # Benchmarking utilities - {:benchee, "~> 1.1", only: :dev}, - {:benchee_html, "~> 1.0", only: :dev}, + {:benchee, "~> 1.1", only: [:dev, :test]}, + {:benchee_html, "~> 1.0", only: [:dev, :test]}, # for Telemetry store {:circular_buffer, "~> 0.4", only: :dev},