Fleet.History (fleet v0.1.0)

Copy Markdown View Source

Provides query access to the underlying rotating ring-buffer partition tables.

Allows searching, inspecting, and counting historical jobs retained within the configured retention period (e.g. 7 days with history_tables: 7, rotation_period: "1 day").

Summary

Functions

Counts historical jobs in the queue's partition tables.

Fetches a single historical job by its event ID.

Lists historical jobs from the queue's partition tables.

Functions

count_jobs(repo_or_conn, queue_name, opts \\ [])

@spec count_jobs(Fleet.Client.repo_or_conn(), Fleet.Client.queue_name(), keyword()) ::
  {:ok, integer()} | {:error, term()}

Counts historical jobs in the queue's partition tables.

get_job(repo_or_conn, queue_name, event_id)

@spec get_job(Fleet.Client.repo_or_conn(), Fleet.Client.queue_name(), integer()) ::
  {:ok, map() | nil} | {:error, term()}

Fetches a single historical job by its event ID.

list_jobs(repo_or_conn, queue_name, opts \\ [])

@spec list_jobs(Fleet.Client.repo_or_conn(), Fleet.Client.queue_name(), keyword()) ::
  {:ok, [map()]} | {:error, term()}

Lists historical jobs from the queue's partition tables.

Options

  • :limit - Maximum number of jobs to return (default 50).
  • :offset - Pagination offset (default 0).
  • :since - Only include jobs created after this DateTime.
  • :type - Filter by worker/event type name.
  • :order - Sort order by id: :desc (default) or :asc.