package granary

  1. Overview
  2. Docs
Pure-OCaml SQL engine

Install

dune-project
 Dependency

Authors

Maintainers

Sources

0.0.3.tar.gz
sha256=8b18780ea373be48301d9f333925860a2f9110fc0ac28684295118d72b65a67e
sha512=25ca3c9c5e2b528704a542502e0f37dc33ba003f65622d969b8c2b800778585f8ef0cf89b36e6679832e3993e8303aecddfc662742baf7044d6afe4a796b8f11

doc/granary.store/Granary_store/Store_event/index.html

Module Granary_store.Store_eventSource

Engine-internal events surfaced to an optional observer (the internals monitor; #382). Pure — depends on nothing in Granary_store.Store, so Store can depend on it without a cycle. Events are fire-and-forget; the library never blocks on an observer.

Sourcetype t =
  1. | Txn_begin of {
    1. txn_id : int64;
    }
  2. | Txn_commit of {
    1. txn_id : int64;
    2. frames : int;
    }
  3. | Txn_rollback of {
    1. txn_id : int64;
    }
  4. | Savepoint_begin of {
    1. txn_id : int64;
    2. name : string;
    }
  5. | Savepoint_release of {
    1. txn_id : int64;
    2. name : string;
    }
  6. | Savepoint_rollback of {
    1. txn_id : int64;
    2. name : string;
    }
  7. | Wal_append of {
    1. txn_id : int64;
    2. base_idx : int;
    3. count : int;
    }
  8. | Wal_reset of {
    1. epoch : int64;
    }
  9. | Checkpoint_begin of {
    1. target_frames : int;
    }
  10. | Checkpoint_end of {
    1. pages_migrated : int;
    }
  11. | Page_read of {
    1. txn_id : int64;
    2. tree : int;
      (*

      tree is the store tree id whose operation triggered the I/O; -1 when no op context was active (best-effort for Page_write, which is stamped at WAL-flush time with the most recently active tree).

      *)
    3. page : int64;
    }
  12. | Wal_read of {
    1. txn_id : int64;
    2. tree : int;
      (*

      tree is the store tree id whose operation triggered the WAL-served read (#392); -1 when no op context was active. Same best-effort txn_id/tree stamping as Page_read.

      *)
    3. page : int64;
    }
  13. | Page_write of {
    1. txn_id : int64;
    2. tree : int;
      (*

      tree is the store tree id whose operation triggered the I/O; -1 when no op context was active (best-effort for Page_write, which is stamped at WAL-flush time with the most recently active tree).

      *)
    3. page : int64;
    }
  14. | Page_alloc of {
    1. txn_id : int64;
    2. tree : int;
      (*

      tree is the store tree id whose operation triggered the I/O; -1 when no op context was active (best-effort for Page_write, which is stamped at WAL-flush time with the most recently active tree).

      *)
    3. page : int64;
    4. reused : bool;
    }
  15. | Page_free of {
    1. txn_id : int64;
    2. tree : int;
      (*

      tree is the store tree id whose operation triggered the I/O; -1 when no op context was active (best-effort for Page_write, which is stamped at WAL-flush time with the most recently active tree).

      *)
    3. page : int64;
    }
Sourceval label : t -> string

Short uppercase tag for display, e.g. "COMMIT", "WAL_APPEND".

Sourceval txn_id : t -> int64 option

The transaction id an event belongs to, or None for events with no single owning txn (Wal_reset, Checkpoint_*). Used by the monitor's txn-id filter.

Sourceval tree_id_of : t -> int option

tree_id_of ev is the store tree id for the page/WAL-read events (Page_read/Wal_read/Page_write/Page_alloc/Page_free), or None for every other event. -1 means "no active tree context".

Sourceval pp : Format.formatter -> t -> unit

Human-readable one-line rendering of an event.