(get-tx-report-queue-multicast! conn id)
(get-tx-report-queue-multicast! conn id send-end-token?)
Multicast the datomic.api/tx-report-queue to different consumers.
A multicaster thread is started on demand per connection. conn
and id
identifies the consumer.
Repeated calls using the same conn
and id
returns the same queue.
The optional third parameter, send-end-token?
, if set to true
, instructs the multicaster thread
to send :end
if the queue is stopped.
The default value for send-end-token?
is false
.
A queue may be stopped using stop-multicaster-id!
, stop-multicaster!
or stop-all-multicasters!
.
Returns a java.util.concurrent.BlockingQueue
like datomic.api/tx-report-queue
.
Multicast the datomic.api/tx-report-queue to different consumers. A multicaster thread is started on demand per connection. `conn` and `id` identifies the consumer. Repeated calls using the same `conn` and `id` returns the same queue. The optional third parameter, `send-end-token?`, if set to `true`, instructs the multicaster thread to send `:end` if the queue is stopped. The default value for `send-end-token?` is `false`. A queue may be stopped using `stop-multicaster-id!`, `stop-multicaster!` or `stop-all-multicasters!`. Returns a `java.util.concurrent.BlockingQueue` like `datomic.api/tx-report-queue`.
(processing-time-stats {:keys [age-days queue-name now db duration->long]
:or {age-days 30
now (ZonedDateTime/now ZoneOffset/UTC)
duration->long (fn [duration]
(.toSeconds duration))}})
Gather processing time statistics. Default unit is seconds.
Optional keyword arguments:
:age-days — last number of days to look at data from. Defaults to 30. Use nil to have no limit.
:queue-name — only gather statistics for this queue name. Defaults to nil, meaning all queues.
:duration->long - Specify what unit should be used for values. Must take a java.time.Duration as input and return a long.
Defaults to (fn [duration] (.toSeconds duration).
I.e. the default unit is seconds.
Example return value: {:queue-a {:avg 1 :max 10 :min 0 :p50 ... :p90 ... :p95 ... :p99 ...}}
Gather processing time statistics. Default unit is seconds. Optional keyword arguments: * :age-days — last number of days to look at data from. Defaults to 30. Use nil to have no limit. * :queue-name — only gather statistics for this queue name. Defaults to nil, meaning all queues. * :duration->long - Specify what unit should be used for values. Must take a java.time.Duration as input and return a long. Defaults to (fn [duration] (.toSeconds duration). I.e. the default unit is seconds. Example return value: {:queue-a {:avg 1 :max 10 :min 0 :p50 ... :p90 ... :p95 ... :p99 ...}}
(retry-stats {:keys [age-days queue-name now db]
:or {age-days 30 now (ZonedDateTime/now ZoneOffset/UTC)}})
Gather retry statistics.
Optional keyword arguments:
Example return value: {:queue-a {:ok 100, :retries 2, :retry-percentage 2.0} :queue-b {:ok 100, :retries 75, :retry-percentage 75.0}}
From the example value above, we can see that :queue-b fails at a much higher rate than :queue-a. Assuming that the queue consumers are correctly implemented, this means that the service representing :queue-b is much more unstable than the one representing :queue-a. This again implies that you will probably want to fix the downstream service of :queue-b, if that is possible.
Gather retry statistics. Optional keyword arguments: * :age-days — last number of days to look at data from. Defaults to 30. * :queue-name — only gather statistics for this queue name. Defaults to nil, meaning all queues. Example return value: {:queue-a {:ok 100, :retries 2, :retry-percentage 2.0} :queue-b {:ok 100, :retries 75, :retry-percentage 75.0}} From the example value above, we can see that :queue-b fails at a much higher rate than :queue-a. Assuming that the queue consumers are correctly implemented, this means that the service representing :queue-b is much more unstable than the one representing :queue-a. This again implies that you will probably want to fix the downstream service of :queue-b, if that is possible.
(stop-all-multicasters!)
Stop forwarding all reports from datomic.api/tx-report-queue for any conn
.
All multicaster threads will exit.
Repeated calls are no-op.
The multicaster thread will send :end
if send-end-token?
was true
when get-tx-report-queue-multicast!
was called.
Returns true
if any queue was stopped.
Returns false
if no queues existed.
Stop forwarding all reports from datomic.api/tx-report-queue for any `conn`. All multicaster threads will exit. Repeated calls are no-op. The multicaster thread will send `:end` if `send-end-token?` was `true` when `get-tx-report-queue-multicast!` was called. Returns `true` if any queue was stopped. Returns `false` if no queues existed.
(stop-multicast-consumer-id! conn id)
Stop forwarding reports from datomic.api/tx-report-queue to the queue identified by conn
and id
.
If this is the last report destination for the given conn
, the multicaster thread will exit.
Repeated calls are no-op.
The multicaster thread will send :end
if send-end-token?
was true
when get-tx-report-queue-multicast!
was called.
Returns true
if the queue was stopped.
Return false
if the queue does not exist.
Stop forwarding reports from datomic.api/tx-report-queue to the queue identified by `conn` and `id`. If this is the last report destination for the given `conn`, the multicaster thread will exit. Repeated calls are no-op. The multicaster thread will send `:end` if `send-end-token?` was `true` when `get-tx-report-queue-multicast!` was called. Returns `true` if the queue was stopped. Return `false` if the queue does not exist.
(stop-multicaster! conn)
Stop forwarding reports from datomic.api/tx-report-queue to any queues belonging to conn
.
The multicaster thread will exit.
Repeated calls are no-op.
The multicaster thread will send :end
if send-end-token?
was true
when get-tx-report-queue-multicast!
was called.
Returns true
if any queue belonging to conn
was stopped.
Returns false
is conn
did not have any associated queues.
Stop forwarding reports from datomic.api/tx-report-queue to any queues belonging to `conn`. The multicaster thread will exit. Repeated calls are no-op. The multicaster thread will send `:end` if `send-end-token?` was `true` when `get-tx-report-queue-multicast!` was called. Returns `true` if any queue belonging to `conn` was stopped. Returns `false` is `conn` did not have any associated queues.
(unhealthy?)
Returns true
if there are queues in error or a thread is slow, and the application has been up for over 10 minutes, otherwise false
.
Returns `true` if there are queues in error or a thread is slow, and the application has been up for over 10 minutes, otherwise `false`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close