diff --git a/lib/nebulex/adapters/cachex.ex b/lib/nebulex/adapters/cachex.ex index 37e8367..00daba6 100644 --- a/lib/nebulex/adapters/cachex.ex +++ b/lib/nebulex/adapters/cachex.ex @@ -87,6 +87,12 @@ defmodule Nebulex.Adapters.Cachex do > See [Cachex.start_link/1][cachex_start_link] for more information. + ## Telemetry events + + This adapter emits the recommended Telemetry events. + See the "Telemetry events" section in `Nebulex.Cache` + for more information. + ## Distributed caching topologies In the same way we use the distributed adapters and the multilevel one to @@ -146,6 +152,7 @@ defmodule Nebulex.Adapters.Cachex do # Inherit default transaction implementation use Nebulex.Adapter.Transaction + import Nebulex.Adapter import Nebulex.Helpers alias Cachex.{Options, Query} @@ -166,33 +173,33 @@ defmodule Nebulex.Adapters.Cachex do Cachex ]) - stats = - if opts[:stats_counter] do - true - else - Options.get(opts, :stats, &is_boolean/1, false) - end + adapter_meta = %{ + name: name, + telemetry: Keyword.fetch!(opts, :telemetry), + telemetry_prefix: Keyword.fetch!(opts, :telemetry_prefix), + stats: Options.get(opts, :stats, &is_boolean/1, false) + } child_spec = opts |> Keyword.put(:name, name) - |> Keyword.put(:stats, stats) + |> Keyword.put(:stats, adapter_meta.stats) |> Cachex.child_spec() - {:ok, child_spec, %{name: name, stats: stats}} + {:ok, child_spec, adapter_meta} end ## Nebulex.Adapter.Entry @impl true - def get(%{name: name}, key, _opts) do - Cachex.get!(name, key) + defspan get(adapter_meta, key, _opts) do + Cachex.get!(adapter_meta.name, key) end @impl true - def get_all(%{name: name}, keys, _opts) do + defspan get_all(adapter_meta, keys, _opts) do Enum.reduce(keys, %{}, fn key, acc -> - if value = Cachex.get!(name, key) do + if value = Cachex.get!(adapter_meta.name, key) do Map.put(acc, key, value) else acc @@ -201,15 +208,19 @@ defmodule Nebulex.Adapters.Cachex do end @impl true - def put(%{name: name}, key, value, ttl, :put, _opts) do + defspan put(adapter_meta, key, value, ttl, on_write, _opts) do + do_put(adapter_meta.name, key, value, ttl, on_write) + end + + defp do_put(name, key, value, ttl, :put) do Cachex.put!(name, key, value, ttl: to_ttl(ttl)) end - def put(%{name: name}, key, value, ttl, :replace, _opts) do + defp do_put(name, key, value, ttl, :replace) do Cachex.update!(name, key, value, ttl: to_ttl(ttl)) end - def put(%{name: name}, key, value, ttl, :put_new, _opts) do + defp do_put(name, key, value, ttl, :put_new) do # FIXME: This is a workaround since Cachex does not support a direct action # for put_new. Fix it if a better solution comes up. if Cachex.get!(name, key) do @@ -220,15 +231,19 @@ defmodule Nebulex.Adapters.Cachex do end @impl true - def put_all(adapter_meta, entries, ttl, on_write, opts) when is_map(entries) do - put_all(adapter_meta, :maps.to_list(entries), ttl, on_write, opts) + defspan put_all(adapter_meta, entries, ttl, on_write, _opts) do + do_put_all(adapter_meta.name, entries, ttl, on_write) + end + + defp do_put_all(name, entries, ttl, on_write) when is_map(entries) do + do_put_all(name, :maps.to_list(entries), ttl, on_write) end - def put_all(%{name: name}, entries, ttl, :put, _opts) when is_list(entries) do + defp do_put_all(name, entries, ttl, :put) when is_list(entries) do Cachex.put_many!(name, entries, ttl: to_ttl(ttl)) end - def put_all(%{name: name}, entries, ttl, :put_new, _opts) when is_list(entries) do + defp do_put_all(name, entries, ttl, :put_new) when is_list(entries) do {keys, _} = Enum.unzip(entries) # FIXME: This is a workaround since Cachex does not support a direct action @@ -243,31 +258,31 @@ defmodule Nebulex.Adapters.Cachex do end @impl true - def delete(%{name: name}, key, _opts) do - true = Cachex.del!(name, key) + defspan delete(adapter_meta, key, _opts) do + true = Cachex.del!(adapter_meta.name, key) :ok end @impl true - def take(%{name: name}, key, _opts) do - Cachex.take!(name, key) + defspan take(adapter_meta, key, _opts) do + Cachex.take!(adapter_meta.name, key) end @impl true - def has_key?(%{name: name}, key) do - {:ok, bool} = Cachex.exists?(name, key) + defspan has_key?(adapter_meta, key) do + {:ok, bool} = Cachex.exists?(adapter_meta.name, key) bool end @impl true - def ttl(%{name: name}, key) do + defspan ttl(adapter_meta, key) do cond do # Key does exist and has a TTL associated with it - ttl = Cachex.ttl!(name, key) -> + ttl = Cachex.ttl!(adapter_meta.name, key) -> ttl # Key does exist and hasn't a TTL associated with it - Cachex.get!(name, key) -> + Cachex.get!(adapter_meta.name, key) -> :infinity # Key does not exist @@ -277,21 +292,25 @@ defmodule Nebulex.Adapters.Cachex do end @impl true - def expire(%{name: name}, key, ttl) do - Cachex.expire!(name, key, to_ttl(ttl)) + defspan expire(adapter_meta, key, ttl) do + Cachex.expire!(adapter_meta.name, key, to_ttl(ttl)) end @impl true - def touch(%{name: name}, key) do - Cachex.touch!(name, key) + defspan touch(adapter_meta, key) do + Cachex.touch!(adapter_meta.name, key) end @impl true - def update_counter(%{name: name}, key, amount, :infinity, default, _opts) do + defspan update_counter(adapter_meta, key, amount, ttl, default, _opts) do + do_update_counter(adapter_meta.name, key, amount, ttl, default) + end + + defp do_update_counter(name, key, amount, :infinity, default) do Cachex.incr!(name, key, amount, initial: default) end - def update_counter(%{name: name}, key, incr, ttl, default, _opts) do + defp do_update_counter(name, key, incr, ttl, default) do # FIXME: This is a workaround since Cachex does not support `:ttl` here. # Fix it if a better solution comes up. Cachex.transaction!(name, [key], fn worker -> @@ -304,34 +323,42 @@ defmodule Nebulex.Adapters.Cachex do ## Nebulex.Adapter.Queryable @impl true - def execute(%{name: name}, :count_all, nil, _opts) do + defspan execute(adapter_meta, operation, query, _opts) do + do_execute(adapter_meta.name, operation, query) + end + + defp do_execute(name, :count_all, nil) do Cachex.size!(name) end - def execute(%{name: name}, :delete_all, nil, _opts) do + defp do_execute(name, :delete_all, nil) do Cachex.clear!(name) end - def execute(%{name: name}, :delete_all, :expired, _opts) do + defp do_execute(name, :delete_all, :expired) do Cachex.purge!(name) end - def execute(adapter_meta, :all, query, opts) do - adapter_meta - |> stream(query, opts) + defp do_execute(name, :all, query) do + name + |> do_stream(query, []) |> Enum.to_list() end - def execute(_adapter_meta, operation, query, _opts) do + defp do_execute(_name, operation, query) do raise Nebulex.QueryError, message: "unsupported #{operation}", query: query end @impl true - def stream(adapter_meta, nil, opts) do - stream(adapter_meta, Query.create(true, :key), opts) + defspan stream(adapter_meta, query, opts) do + do_stream(adapter_meta.name, query, opts) + end + + defp do_stream(name, nil, opts) do + do_stream(name, Query.create(true, :key), opts) end - def stream(%{name: name}, query, opts) do + defp do_stream(name, query, opts) do query = maybe_return_entry(query, opts[:return]) Cachex.stream!(name, query, batch_size: opts[:page_size] || 20) rescue @@ -360,16 +387,16 @@ defmodule Nebulex.Adapters.Cachex do ## Nebulex.Adapter.Persistence @impl true - def dump(%{name: name}, path, opts) do - case Cachex.dump(name, path, opts) do + defspan dump(adapter_meta, path, opts) do + case Cachex.dump(adapter_meta.name, path, opts) do {:ok, true} -> :ok {:error, _} = error -> error end end @impl true - def load(%{name: name}, path, opts) do - case Cachex.load(name, path, opts) do + defspan load(adapter_meta, path, opts) do + case Cachex.load(adapter_meta.name, path, opts) do {:ok, true} -> :ok {:error, _} = error -> error end @@ -378,10 +405,10 @@ defmodule Nebulex.Adapters.Cachex do ## Nebulex.Adapter.Stats @impl true - def stats(%{name: name, stats: stats}) do - if stats do + defspan stats(adapter_meta) do + if adapter_meta.stats do {meta, stats} = - name + adapter_meta.name |> Cachex.stats!() |> Map.pop(:meta, %{}) diff --git a/mix.exs b/mix.exs index 1cf8be2..ea0874a 100644 --- a/mix.exs +++ b/mix.exs @@ -2,8 +2,8 @@ defmodule NebulexAdaptersCachex.MixProject do use Mix.Project @source_url "https://github.com/cabol/nebulex_adapters_cachex" - @version "2.0.0" - @nbx_vsn "2.0.0" + @version "2.1.0" + @nbx_vsn "2.1.0" def project do [ @@ -51,6 +51,7 @@ defmodule NebulexAdaptersCachex.MixProject do [ nebulex_dep(), {:cachex, "~> 3.3"}, + {:telemetry, "~> 0.4", optional: true}, # Test & Code Analysis {:excoveralls, "~> 0.13", only: :test}, @@ -80,7 +81,7 @@ defmodule NebulexAdaptersCachex.MixProject do [ "nbx.setup": [ "cmd rm -rf nebulex", - "cmd git clone --depth 1 --branch v2.0.0 https://github.com/cabol/nebulex" + "cmd git clone --depth 1 --branch v#{@nbx_vsn} https://github.com/cabol/nebulex" ], check: [ "compile --warnings-as-errors", diff --git a/mix.lock b/mix.lock index 8007850..2183edf 100644 --- a/mix.lock +++ b/mix.lock @@ -4,31 +4,33 @@ "benchee_json": {:hex, :benchee_json, "1.0.0", "cc661f4454d5995c08fe10dd1f2f72f229c8f0fb1c96f6b327a8c8fc96a91fe5", [:mix], [{:benchee, ">= 0.99.0 and < 2.0.0", [hex: :benchee, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "da05d813f9123505f870344d68fb7c86a4f0f9074df7d7b7e2bb011a63ec231c"}, "bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"}, "cachex": {:hex, :cachex, "3.3.0", "6f2ebb8f27491fe39121bd207c78badc499214d76c695658b19d6079beeca5c2", [:mix], [{:eternal, "~> 1.2", [hex: :eternal, repo: "hexpm", optional: false]}, {:jumper, "~> 1.0", [hex: :jumper, repo: "hexpm", optional: false]}, {:sleeplocks, "~> 1.1", [hex: :sleeplocks, repo: "hexpm", optional: false]}, {:unsafe, "~> 1.0", [hex: :unsafe, repo: "hexpm", optional: false]}], "hexpm", "d90e5ee1dde14cef33f6b187af4335b88748b72b30c038969176cd4e6ccc31a1"}, - "certifi": {:hex, :certifi, "2.5.3", "70bdd7e7188c804f3a30ee0e7c99655bc35d8ac41c23e12325f36ab449b70651", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm", "ed516acb3929b101208a9d700062d520f3953da3b6b918d866106ffa980e1c10"}, + "certifi": {:hex, :certifi, "2.6.1", "dbab8e5e155a0763eea978c913ca280a6b544bfa115633fa20249c3d396d9493", [:rebar3], [], "hexpm", "524c97b4991b3849dd5c17a631223896272c6b0af446778ba4675a1dff53bb7e"}, "credo": {:hex, :credo, "1.5.5", "e8f422026f553bc3bebb81c8e8bf1932f498ca03339856c7fec63d3faac8424b", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "dd8623ab7091956a855dc9f3062486add9c52d310dfd62748779c4315d8247de"}, "deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"}, "dialyxir": {:hex, :dialyxir, "1.1.0", "c5aab0d6e71e5522e77beff7ba9e08f8e02bad90dfbeffae60eaf0cb47e29488", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "07ea8e49c45f15264ebe6d5b93799d4dd56a44036cf42d0ad9c960bc266c0b9a"}, - "earmark_parser": {:hex, :earmark_parser, "1.4.12", "b245e875ec0a311a342320da0551da407d9d2b65d98f7a9597ae078615af3449", [:mix], [], "hexpm", "711e2cc4d64abb7d566d43f54b78f7dc129308a63bc103fbd88550d2174b3160"}, + "earmark_parser": {:hex, :earmark_parser, "1.4.13", "0c98163e7d04a15feb62000e1a891489feb29f3d10cb57d4f845c405852bbef8", [:mix], [], "hexpm", "d602c26af3a0af43d2f2645613f65841657ad6efc9f0e361c3b6c06b578214ba"}, "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, "eternal": {:hex, :eternal, "1.2.2", "d1641c86368de99375b98d183042dd6c2b234262b8d08dfd72b9eeaafc2a1abd", [:mix], [], "hexpm", "2c9fe32b9c3726703ba5e1d43a1d255a4f3f2d8f8f9bc19f094c7cb1a7a9e782"}, - "ex_doc": {:hex, :ex_doc, "0.23.0", "a069bc9b0bf8efe323ecde8c0d62afc13d308b1fa3d228b65bca5cf8703a529d", [:mix], [{:earmark_parser, "~> 1.4.0", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm", "f5e2c4702468b2fd11b10d39416ddadd2fcdd173ba2a0285ebd92c39827a5a16"}, + "ex_doc": {:hex, :ex_doc, "0.24.2", "e4c26603830c1a2286dae45f4412a4d1980e1e89dc779fcd0181ed1d5a05c8d9", [:mix], [{:earmark_parser, "~> 1.4.0", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "e134e1d9e821b8d9e4244687fb2ace58d479b67b282de5158333b0d57c6fb7da"}, "excoveralls": {:hex, :excoveralls, "0.14.0", "4b562d2acd87def01a3d1621e40037fdbf99f495ed3a8570dfcf1ab24e15f76d", [:mix], [{:hackney, "~> 1.16", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "94f17478b0cca020bcd85ce7eafea82d2856f7ed022be777734a2f864d36091a"}, "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, - "hackney": {:hex, :hackney, "1.17.0", "717ea195fd2f898d9fe9f1ce0afcc2621a41ecfe137fae57e7fe6e9484b9aa99", [:rebar3], [{:certifi, "~>2.5", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "64c22225f1ea8855f584720c0e5b3cd14095703af1c9fbc845ba042811dc671c"}, + "hackney": {:hex, :hackney, "1.17.4", "99da4674592504d3fb0cfef0db84c3ba02b4508bae2dff8c0108baa0d6e0977c", [:rebar3], [{:certifi, "~>2.6.1", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "de16ff4996556c8548d512f4dbe22dd58a587bf3332e7fd362430a7ef3986b16"}, "idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"}, "jason": {:hex, :jason, "1.2.2", "ba43e3f2709fd1aa1dce90aaabfd039d000469c05c56f0b8e31978e03fa39052", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "18a228f5f0058ee183f29f9eae0805c6e59d61c3b006760668d8d18ff0d12179"}, "jumper": {:hex, :jumper, "1.0.1", "3c00542ef1a83532b72269fab9f0f0c82bf23a35e27d278bfd9ed0865cecabff", [:mix], [], "hexpm", "318c59078ac220e966d27af3646026db9b5a5e6703cb2aa3e26bcfaba65b7433"}, "makeup": {:hex, :makeup, "1.0.5", "d5a830bc42c9800ce07dd97fa94669dfb93d3bf5fcf6ea7a0c67b2e0e4a7f26c", [:mix], [{:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cfa158c02d3f5c0c665d0af11512fed3fba0144cf1aadee0f2ce17747fba2ca9"}, "makeup_elixir": {:hex, :makeup_elixir, "0.15.1", "b5888c880d17d1cc3e598f05cdb5b5a91b7b17ac4eaf5f297cb697663a1094dd", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "db68c173234b07ab2a07f645a5acdc117b9f99d69ebf521821d89690ae6c6ec8"}, + "makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"}, "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"}, "mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"}, - "nebulex": {:hex, :nebulex, "2.0.0", "d33dc5a2b96ba09e5eb1c90e53dd1d036b0c006f1bb379bcc5c10acd0b140d6d", [:mix], [{:decorator, "~> 1.3", [hex: :decorator, repo: "hexpm", optional: true]}, {:shards, "~> 1.0", [hex: :shards, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "411c707e455408ae79ae7bfe7ada125967d016b83ff2a4e9763fd7cc2dd9372d"}, + "nebulex": {:hex, :nebulex, "2.1.0", "6ed3dc8e851366c59b1260c73d8c70bd694667f1da439bcd13c9eca2d20c74bb", [:mix], [{:decorator, "~> 1.4", [hex: :decorator, repo: "hexpm", optional: true]}, {:shards, "~> 1.0", [hex: :shards, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "d19ef2d7ee57350b1e88931d79c621e69b4ed52ba3351d53348cd4283a0fdb72"}, "nimble_parsec": {:hex, :nimble_parsec, "1.1.0", "3a6fca1550363552e54c216debb6a9e95bd8d32348938e13de5eda962c0d7f89", [:mix], [], "hexpm", "08eb32d66b706e913ff748f11694b17981c0b04a33ef470e33e11b3d3ac8f54b"}, "parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"}, "sleeplocks": {:hex, :sleeplocks, "1.1.1", "3d462a0639a6ef36cc75d6038b7393ae537ab394641beb59830a1b8271faeed3", [:rebar3], [], "hexpm", "84ee37aeff4d0d92b290fff986d6a95ac5eedf9b383fadfd1d88e9b84a1c02e1"}, - "sobelow": {:hex, :sobelow, "0.11.0", "cdc17e3a9f1ea78dc55dbe0a03121cb6767fef737c6d9f1e62ee7e78730abccc", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "c57807bfe6f231338b657781f89ef0320b66a0dbe779aa911d6ed27cfa14ae6e"}, + "sobelow": {:hex, :sobelow, "0.11.1", "23438964486f8112b41e743bbfd402da3e5b296fdc9eacab29914b79c48916dd", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "9897363a7eff96f4809304a90aad819e2ad5e5d24db547af502885146746a53c"}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"}, "stream_data": {:hex, :stream_data, "0.5.0", "b27641e58941685c75b353577dc602c9d2c12292dd84babf506c2033cd97893e", [:mix], [], "hexpm", "012bd2eec069ada4db3411f9115ccafa38540a3c78c4c0349f151fc761b9e271"}, + "telemetry": {:hex, :telemetry, "0.4.3", "a06428a514bdbc63293cd9a6263aad00ddeb66f608163bdec7c8995784080818", [:rebar3], [], "hexpm", "eb72b8365ffda5bed68a620d1da88525e326cb82a75ee61354fc24b844768041"}, "unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"}, "unsafe": {:hex, :unsafe, "1.0.1", "a27e1874f72ee49312e0a9ec2e0b27924214a05e3ddac90e91727bc76f8613d8", [:mix], [], "hexpm", "6c7729a2d214806450d29766abc2afaa7a2cbecf415be64f36a6691afebb50e5"}, } diff --git a/test/test_helper.exs b/test/test_helper.exs index a9ea7ce..ac2a992 100644 --- a/test/test_helper.exs +++ b/test/test_helper.exs @@ -1,3 +1,6 @@ +# Start Telemetry +Application.start(:telemetry) + # Set nodes nodes = [:"node1@127.0.0.1", :"node2@127.0.0.1", :"node3@127.0.0.1"] :ok = Application.put_env(:nebulex_adapters_cachex, :nodes, nodes) @@ -5,7 +8,7 @@ nodes = [:"node1@127.0.0.1", :"node2@127.0.0.1", :"node3@127.0.0.1"] # Nebulex dependency path nbx_dep_path = Mix.Project.deps_paths()[:nebulex] -for file <- File.ls!("#{nbx_dep_path}/test/support"), file != "test_cache.ex" do +for file <- File.ls!("#{nbx_dep_path}/test/support") -- ["test_cache.ex"] do Code.require_file("#{nbx_dep_path}/test/support/" <> file, __DIR__) end