# `PromEx.ETSCronFlusher`
[🔗](https://github.com/akoutmos/prom_ex/blob/master/lib/prom_ex/ets_cron_flusher.ex#L1)

This module is used to regularly flush ETS of any buffered distribution
type metrics (see https://github.com/beam-telemetry/telemetry_metrics_prometheus_core/blob/main/lib/core.ex#L25-L28)
for more information. At the moment the flush interval is not configurable
but that could change in the future.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `defer_ets_flush`

```elixir
@spec defer_ets_flush(instance :: module()) :: :ok
```

This function will cancel the existing cron timer and schedule a new
new. The reason for this being that if metrics scrapes occur regularly,
there is no need to flush via the cron job. Cron ETS flushes should
only occur if the metrics endpoint for whatever reason fails to be
scraped so that ETS is not leaking memory.

# `start_link`

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

Used to start the `PromEx.ETSCronFlusher` process.

---

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