Liking cljdoc? Tell your friends :D

hive-ttracking.metrics

Metrics port: op-key -> latency/frequency aggregation for hive internals.

Op key: a vector [area op] or [area op sub]; each element a keyword or a short string from a closed vocabulary (tool name, verb, addon id, backend, method). Never ids, paths, queries or user text.

Callers bind this namespace late (requiring-resolve) and fall back to a no-op when it is absent. record! and timed never throw because of the sink: a sink failure is swallowed and counted in sink-error-count.

Metrics port: op-key -> latency/frequency aggregation for hive internals.

Op key: a vector [area op] or [area op sub]; each element a keyword or a
short string from a closed vocabulary (tool name, verb, addon id, backend,
method). Never ids, paths, queries or user text.

Callers bind this namespace late (requiring-resolve) and fall back to a
no-op when it is absent. `record!` and `timed` never throw because of the
sink: a sink failure is swallowed and counted in `sink-error-count`.
raw docstring

bucket-countclj

Number of log2 histogram buckets per op key.

Number of log2 histogram buckets per op key.
sourceraw docstring

bucket-indexclj

(bucket-index ns)

Histogram bucket for elapsed-ns: 0 for ns <= 0, else floor(log2 ns)+1, capped at 63. Bucket i holds values in [2^(i-1), 2^i).

Histogram bucket for elapsed-ns: 0 for ns <= 0, else floor(log2 ns)+1,
capped at 63. Bucket i holds values in [2^(i-1), 2^i).
sourceraw docstring

bucket-upperclj

(bucket-upper i)

Inclusive upper bound (ns) of bucket i.

Inclusive upper bound (ns) of bucket i.
sourceraw docstring

composite-sinkclj

(composite-sink & sinks)

Fan-out sink: observe! reaches every child (a throwing child is swallowed and counted, the others still record). snapshot merges the children's snapshots, later children winning on equal keys.

Fan-out sink: observe! reaches every child (a throwing child is swallowed
and counted, the others still record). snapshot merges the children's
snapshots, later children winning on equal keys.
sourceraw docstring

current-sinkclj

(current-sink)

The installed sink, or noop-sink when none is installed.

The installed sink, or `noop-sink` when none is installed.
sourceraw docstring

hotspotsclj

(hotspots snap)
(hotspots snap {:keys [by limit area] :or {by :total limit 20}})

PURE. Rank the rows of snapshot snap. opts: :by one of #{:total :count :mean :p99 :max :errors} (default :total) :limit max rows (default 20; nil or <= 0 keeps all) :area keep only keys whose first element equals area (keyword, or string spelling such as "mcp/tool"). Returns a vector of {:k :count :errors :total-ms :mean-ms :p50-ms :p95-ms :p99-ms :max-ms :share}; :share = row total time / total time of every row kept by :area (before :limit).

PURE. Rank the rows of snapshot snap.
opts: :by    one of #{:total :count :mean :p99 :max :errors} (default :total)
      :limit max rows (default 20; nil or <= 0 keeps all)
      :area  keep only keys whose first element equals area (keyword, or
             string spelling such as "mcp/tool").
Returns a vector of {:k :count :errors :total-ms :mean-ms :p50-ms :p95-ms
:p99-ms :max-ms :share}; :share = row total time / total time of every row
kept by :area (before :limit).
sourceraw docstring

IMetricsSinkcljprotocol

observe!clj

(observe! sink k elapsed-ns outcome)

Record one observation. k = op key. elapsed-ns = long. outcome = :ok | :error.

Record one observation. k = op key. elapsed-ns = long. outcome = :ok | :error.

snapshotclj

(snapshot sink)

Immutable value: {k {:count n :errors n :total-ns n :max-ns n :p50-ns n :p95-ns n :p99-ns n}}

Immutable value: {k {:count n :errors n :total-ns n :max-ns n :p50-ns n :p95-ns n :p99-ns n}}
source

install!clj

(install! sink)

Set the process-global sink (nil uninstalls). Returns sink.

Set the process-global sink (nil uninstalls). Returns sink.
sourceraw docstring

IResettablecljprotocol

-reset!clj

(-reset! sink)

Clear every aggregate held by sink.

Clear every aggregate held by sink.
source

noop-sinkclj

Sink that records nothing; snapshot is {}.

Sink that records nothing; snapshot is {}.
sourceraw docstring

record!clj

(record! k elapsed-ns outcome)

observe! on the current sink. Never throws; a sink exception is counted in sink-error-count. Returns nil.

observe! on the current sink. Never throws; a sink exception is counted in
`sink-error-count`. Returns nil.
sourceraw docstring

reset-sink!clj

(reset-sink! sink)

Clear the aggregates of sink (a stats-sink, or a composite holding one). Sinks without state are left alone. Returns nil.

Clear the aggregates of sink (a stats-sink, or a composite holding one).
Sinks without state are left alone. Returns nil.
sourceraw docstring

sink-error-countclj

(sink-error-count)

Number of sink exceptions swallowed by record! and composite-sink.

Number of sink exceptions swallowed by `record!` and `composite-sink`.
sourceraw docstring

stats-sinkclj

(stats-sink)

Lock-free in-process aggregator: ConcurrentHashMap k -> cell of LongAdders plus a 64-bucket log2 histogram (AtomicLongArray). Percentiles are the upper bound of the bucket holding the rank, clamped to :max-ns.

Lock-free in-process aggregator: ConcurrentHashMap k -> cell of LongAdders
plus a 64-bucket log2 histogram (AtomicLongArray). Percentiles are the
upper bound of the bucket holding the rank, clamped to :max-ns.
sourceraw docstring

timedcljmacro

(timed k & body)

Evaluate body, recording [k elapsed-ns outcome] through record!. outcome is :error when body throws (the throwable is rethrown), else :ok. Returns body's value. k is evaluated once, before body.

Evaluate body, recording [k elapsed-ns outcome] through `record!`.
outcome is :error when body throws (the throwable is rethrown), else :ok.
Returns body's value. k is evaluated once, before body.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close