# `Slap.SlateDB.Telemetry`
[🔗](https://github.com/mjrusso/slap/blob/slap_slatedb-v0.2.0/slap_slatedb/lib/slap/slatedb/telemetry.ex#L1)

Emits `:telemetry` events for one database. Start it after `Slap.SlateDB.open/2`,
usually under the supervisor that owns the database:

    {:ok, db} = Slap.SlateDB.open("orders", store: store)
    {:ok, _pid} = Slap.SlateDB.Telemetry.start_link(db: db, metadata: %{name: "orders"})

Events, each with the `:metadata` option as metadata:

  * `[:slap, :slatedb, :durable]` - `%{durable_seq: seq}`, when the durable
    sequence number goes up. Updates are coalesced, as for
    `Slap.SlateDB.subscribe/3`.
  * `[:slap, :slatedb, :stats]` - `Slap.SlateDB.stats/1`, every `:interval` ms
    (default 10,000).
  * `[:slap, :slatedb, :closed]` - `%{}`, with `:reason` added to the metadata
    (`:clean`, `:fenced`, `:panic` or `:unknown`), once, when the database
    closes. The process then stops normally.

Options: `:db` (required), `:metadata` (a map, default `%{}`), `:interval`.
A supervised child uses its database handle as part of its child ID, so
one supervisor can run telemetry for multiple databases.

# `child_spec`

```elixir
@spec child_spec(keyword()) :: Supervisor.child_spec()
```

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `start_link`

```elixir
@spec start_link(keyword()) :: GenServer.on_start()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
