# `PhoenixMicro.Phoenix.MetricsStore`
[🔗](https://github.com/iamkanishka/phoenix_micro/blob/v1.0.0/lib/phoenix_micro/phoenix/metrics_store.ex#L1)

In-process ring-buffer store for PhoenixMicro Telemetry metrics.

Subscribes to all `[:phoenix_micro, ...]` events and maintains the last
N data points per metric. The LiveDashboard page reads from this store
to render real-time charts without hitting a time-series database.

Start it in your supervision tree before `PhoenixMicro.Application`:

    children = [
      PhoenixMicro.Phoenix.MetricsStore,
      # ...
    ]

Or rely on `PhoenixMicro.Application` starting it automatically when
`:phoenix_live_dashboard` is detected.

# `all`

```elixir
@spec all() :: %{required(atom()) =&gt; [map()]}
```

Returns a snapshot of all metrics.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `get`

```elixir
@spec get(atom()) :: [map()]
```

Returns the last N data points for a given metric key.

# `latest`

```elixir
@spec latest(atom()) :: map() | nil
```

Returns the latest single value for a metric (most recent data point).

# `start_link`

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

---

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