Skip to content

Commit ee653b8

Browse files
committed
Overall fixes on docs and bench
1 parent 6224dbc commit ee653b8

File tree

3 files changed

+37
-35
lines changed

3 files changed

+37
-35
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ next sections.
2222
>
2323
> This README refers to the main branch of `nebulex_redis_adapter`,
2424
> not the latest released version on Hex. Please reference the
25-
> [official documentation][docs] for the latest stable release.
25+
> [official documentation][docs-lsr] for the latest stable release.
2626
27-
[docs-lsr]: http://hexdocs.pm/nebulex/NebulexRedisAdapter.html
27+
[docs-lsr]: http://hexdocs.pm/nebulex_redis_adapter/NebulexRedisAdapter.html
2828

2929
---
3030

@@ -84,7 +84,7 @@ module and also [Redix][redix].
8484
See [online documentation][docs] and [Redis cache example][redis_example]
8585
for more information.
8686

87-
[docs]: http://hexdocs.pm/nebulex_redis_adapter/Nebulex.Adapters.Redis.html
87+
[docs]: http://hexdocs.pm/nebulex_redis_adapter/3.0.0-rc.1/Nebulex.Adapters.Redis.html
8888
[redis_example]: http://github.com/elixir-nebulex/nebulex_examples/tree/master/redis_cache
8989

9090
## Distributed Caching
@@ -301,7 +301,7 @@ to learn more, see the [benchmarks](./benchmarks) directory.
301301
To run the benchmarks:
302302

303303
```
304-
$ MIX_ENV=test mix run benchmarks/benchmark.exs
304+
mix run benchmarks/benchmark.exs
305305
```
306306

307307
> Benchmarks use default Redis options (`host: "127.0.0.1", port: 6379`).

benchmarks/benchmark.exs

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
## Benchmarks
22

3+
_ = Application.start(:telemetry)
4+
35
defmodule BenchCache do
46
use Nebulex.Cache,
5-
otp_app: :nebulex,
6-
adapter: NebulexRedisAdapter
7+
otp_app: :nebulex,
8+
adapter: Nebulex.Adapters.Redis
79
end
810

911
# start caches
@@ -21,26 +23,23 @@ inputs = %{
2123
}
2224

2325
benchmarks = %{
24-
"get" => fn {cache, random} ->
25-
cache.get(random)
26-
end,
27-
"get_all" => fn {cache, _random} ->
28-
cache.get_all([1, 2, 3, 4, 5, 6, 7, 8, 9])
26+
"fetch" => fn {cache, random} ->
27+
cache.fetch(random)
2928
end,
30-
"put" => fn {cache, random} ->
31-
cache.put(random, random)
29+
"put!" => fn {cache, random} ->
30+
cache.put!(random, random)
3231
end,
33-
"put_new" => fn {cache, random} ->
34-
cache.put_new(random, random)
32+
"put_new!" => fn {cache, random} ->
33+
cache.put_new!(random, random)
3534
end,
36-
"replace" => fn {cache, random} ->
37-
cache.replace(random, random)
35+
"replace!" => fn {cache, random} ->
36+
cache.replace!(random, random)
3837
end,
39-
"put_all" => fn {cache, _random} ->
40-
cache.put_all(bulk)
38+
"put_all!" => fn {cache, _random} ->
39+
cache.put_all!(bulk)
4140
end,
42-
"delete" => fn {cache, random} ->
43-
cache.delete(random)
41+
"delete!" => fn {cache, random} ->
42+
cache.delete!(random)
4443
end,
4544
"take" => fn {cache, random} ->
4645
cache.take(random)
@@ -51,26 +50,29 @@ benchmarks = %{
5150
"ttl" => fn {cache, random} ->
5251
cache.ttl(random)
5352
end,
54-
"expire" => fn {cache, random} ->
55-
cache.expire(random, 1000)
53+
"expire!" => fn {cache, random} ->
54+
cache.expire!(random, 1000)
5655
end,
57-
"incr" => fn {cache, _random} ->
58-
cache.incr(:counter, 1)
56+
"incr!" => fn {cache, _random} ->
57+
cache.incr!(:counter, 1)
5958
end,
60-
"update" => fn {cache, random} ->
61-
cache.update(random, 1, &Kernel.+(&1, 1))
59+
"update!" => fn {cache, random} ->
60+
cache.update!(random, 1, &Kernel.+(&1, 1))
6261
end,
63-
"get_and_update" => fn {cache, random} ->
64-
cache.get_and_update(random, fn
62+
"get_and_update!" => fn {cache, random} ->
63+
cache.get_and_update!(random, fn
6564
nil -> {nil, 1}
6665
val -> {val, val * 2}
6766
end)
6867
end,
69-
"all" => fn {cache, _random} ->
70-
cache.all()
68+
"get_all!" => fn {cache, _random} ->
69+
cache.get_all!(in: [1, 2, 3, 4, 5, 6, 7, 8, 9])
70+
end,
71+
"count_all!" => fn {cache, _random} ->
72+
cache.count_all!()
7173
end,
72-
"count_all" => fn {cache, _random} ->
73-
cache.count_all()
74+
"delete_all!" => fn {cache, _random} ->
75+
cache.delete_all!(in: [1, 2, 3])
7476
end
7577
}
7678

mix.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ defmodule Nebulex.Adapters.Redis.MixProject do
6464
{:stream_data, "~> 1.2", only: [:dev, :test]},
6565

6666
# Benchmark Test
67-
{:benchee, "~> 1.4", only: :test},
68-
{:benchee_html, "~> 1.0", only: :test},
67+
{:benchee, "~> 1.4", only: [:dev, :test]},
68+
{:benchee_html, "~> 1.0", only: [:dev, :test]},
6969

7070
# Docs
7171
{:ex_doc, "~> 0.37", only: [:dev, :test], runtime: false}

0 commit comments

Comments
 (0)