This module requires the following dependencies:
[{:ex_doc, "~> 0.14.3", only: :dev},
{:poison, "~> 3.0"},
{:ex_json_schema, "~> 0.5.2"}]Note that ex_doc is optional as you can still use iex-based documentation.
| name: Test & Deploy | |
| on: push | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: erlef/setup-beam@v1 |
This module requires the following dependencies:
[{:ex_doc, "~> 0.14.3", only: :dev},
{:poison, "~> 3.0"},
{:ex_json_schema, "~> 0.5.2"}]Note that ex_doc is optional as you can still use iex-based documentation.
| diff --git a/rebar.lock b/rebar.lock | |
| index 1c484c5..ce009d3 100644 | |
| --- a/rebar.lock | |
| +++ b/rebar.lock | |
| @@ -3,17 +3,14 @@ | |
| {<<"cowboy_swagger">>,{pkg,<<"cowboy_swagger">>,<<"1.1.0">>},1}, | |
| {<<"cowlib">>,{pkg,<<"cowlib">>,<<"1.0.2">>},2}, | |
| {<<"goldrush">>,{pkg,<<"goldrush">>,<<"0.1.8">>},3}, | |
| - {<<"iso8601">>,{pkg,<<"inaka_iso8601">>,<<"1.1.2">>},1}, | |
| + {<<"inaka_iso8601">>,{pkg,<<"inaka_iso8601">>,<<"1.1.2">>},1}, |
| defmodule MsTest do | |
| use ExUnit.Case | |
| doctest Ms | |
| @bob %{name: "Bob", job: "developer"} | |
| @alice %{name: "Alice", job: "musician"} | |
| @john %{name: "John", job: "musician"} | |
| @ada %{name: "Ada", job: "developer"} | |
| @alan %{name: "Alan", job: "developer"} | |
| @table :users |
A few considerations in case you need to work on performance even further (you may not even need them, but it's worth knowing).
GenServer flow to read data may become a bottleneck (as it happens inside the GenServer process)duplicate_bag. This speeds up writes, as it doesn't have to check for dupes.It may also be interesting to read directly from the table instead of going through the GenServer.
That's possible by creating the table as public and named_table, giving it __MODULE__ as name.
In addition, as the table would be mostly reads, it can be marked as read_concurrency (which optimizes reads over writes).
ets.new(__MODULE__, [:named_table, :duplicate_bag, :public, :read_concurrency])
This assumes a working copy of in your PATH
A generic tcp client pool. You give it a protocol to use to decode/encode messages and it handles connection management for you, including reconnecting, closing, maintaining connections. The use case is to provide a solid infrastructure to connect to tcp services like memcached, redis, etc.
A deployable observer application that can target a node or self and provides the same information (or better) as the native observer gui
A tool capable of generatic a heatmap of running processes, where color shows the inbox length for each process. Useful to find bottlenecks (can also be part of the web observer).
| # Given a Message model with a body column | |
| from(m in Message, select: count(m.body)) |> Repo.one |
| SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc -> 'tags' ? 'qui'; |
| \set ON_ERROR_ROLLBACK interactive | |
| \set COMP_KEYWORD_CASE upper | |
| \set HISTFILE ~/.psql/history- :DBNAME | |
| \pset pager off | |
| \pset null '(null)' | |
| \x auto | |
| \set VERBOSITY verbose | |
| \set HISTCONTROL ignoredups | |
| \timing | |
| \pset linestyle unicode |