datomic

enn 2025-10-09T15:43:37.591879Z

Is is possible for a metrics callback function running inside a transactor to determine whether that transactor is an active transactor or a standby transactor?

jaret 2025-10-09T15:51:19.701259Z

The logs report an event in the datomic.lifecycle namespace that will report transactor/standby :

;standby example
2017-02-14 15:33:59.944 INFO  default    datomic.lifecycle-ext - {:event :transactor/standby, :rev 10127704, :missed 0, :timestamp 1487086439310, :pid 9, :tid 16}

;active example:
2017-02-11 04:24:11.703 INFO  default    datomic.lifecycle - {:tid 16, :username "Uhop48pFJo0G4A/bJIwbcxipUUi7Ly3K+snqMVCGVxI=", :port 4334, :rev 10067870, :host "0.0.0.0", :pid 8, :event :transactor/heartbeat, :version "0.9.5530", :timestamp 1486787051694, :encrypt-channel true}

enn 2025-10-09T16:43:51.172089Z

Hmm ... so the idea would be to configure a logger and have it set some state visible to the metrics callback?

enn 2025-10-09T17:48:21.062129Z

What is the difference between these metrics? 1. Datoms - "Number of unique datoms in the index" 2. IndexDatoms - "Number of datoms stored by the index, all sorts" Does "the index" here mean that each of these metrics is reported for each of the four Datomic indexes? If so, is there a way to tell which metric value corresponds to which index? Or does "the index" just mean the database? Apologies for the flurry of questions.

favila 2025-10-10T17:09:28.030259Z

said differently: IndexDatoms must always be at least 2x the Datoms value (because EAVT and AEVT each contain every unique datom), and at most 4x (if every single datom is both a ref, thus in VAET, and value-indexed, thus in AVET).

favila 2025-10-09T18:08:33.091449Z

"the index" in this language is the entire index

favila 2025-10-09T18:08:42.153549Z

so all four "sorts": eavt, aevt, etc

enn 2025-10-09T18:09:17.792459Z

I see, and that’s true for both metrics?

favila 2025-10-09T18:09:28.767989Z

IndexDatoms is sum of datoms in all sorts; Datoms is just the unique datoms, so == to the sum of datoms in EAVT or AEVT