View Source Plausible.Google.Buffer (Plausible v0.0.1)

This GenServer inserts records into Clickhouse imported_* tables. Multiple buffers are automatically created for each table. Records are flushed when the table buffer reaches the maximum size, defined by max_buffer_size/0.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Flushes all table buffers to Clickhouse.

Callback implementation for GenServer.init/1.

Puts the given records into the table buffer.

Returns the total count of items in the given table buffer.

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

flush(pid, timeout \\ :infinity)

View Source

Flushes all table buffers to Clickhouse.

Link to this function

handle_continue(arg, state)

View Source

Callback implementation for GenServer.handle_continue/2.

Callback implementation for GenServer.init/1.

Link to this function

insert_many(pid, table_name, records)

View Source
@spec insert_many(pid(), term(), [map()]) :: :ok

Puts the given records into the table buffer.

@spec size(pid(), term()) :: non_neg_integer()

Returns the total count of items in the given table buffer.