# `Nebulex.Stats`
[🔗](https://github.com/elixir-nebulex/nebulex/blob/v2.6.6/lib/nebulex/stats.ex#L1)

Stats data type.

Stats struct defines two main keys:

* `:measurements` - A map with the measurements provided by the underlying
  adapter.
* `:metadata` - A map for including additional information; also provided
  by the underlying adapter.

## Measurements

The following measurements are expected to be present and fed by the
underlying adapter:

  * `:evictions` - When a cache entry is removed.
  * `:expirations` - When a cache entry is expired.
  * `:hits` - When a key is looked up in cache and found.
  * `:misses` - When a key is looked up in cache but not found.
  * `:updates` - When an existing cache entry is or updated.
  * `:writes` - When a cache entry is inserted or overwritten.

## Metadata

Despite the adapters can include any additional or custom metadata, It is
recommended they include the following keys:

  * `:cache` - The cache module, or the name (if an explicit name has been
    given to the cache).

**IMPORTANT:** Since the adapter may include any additional or custom
measurements, as well as metadata, it is recommended to check out the
adapter's documentation.

# `t`

```elixir
@type t() :: %Nebulex.Stats{
  measurements: %{optional(atom()) =&gt; term()},
  metadata: %{optional(atom()) =&gt; term()}
}
```

Nebulex.Stats data type

---

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