Extract and aggregate timing statistics and trace data for yarn operations.
Extract and aggregate timing statistics and trace data for yarn operations.
(timings-collector &
{:keys [yarns events window window-chunk precision
percentiles]
:or {yarns nil
events #{:done-at :deps-time :call-at :time :yank-at}
percentiles [50 90 95 99]
precision 3
window 60000}})
Creates a timing statistics collector for yarn operations.
This function returns a collector function that plays two roles:
When called with no arguments, it aggregates and returns a snapshot of the timing statistics collected. The snapshot is a map whose keys are vectors of the form [yarn-id event-type] and whose values are structs knitty.tstats/Stats.
When called with a yank-result argument, it extract timing information (via trace) and update the internal statistics tracker.
Options (keyword arguments):
Usage:
;; create a collector for all yarns and events (def stats (timings-collector))
;; run 'yank' (with tracing enabled) and pass result into the collector (doto @(knitty.core/yank {} [(knitty.core/yarn ::y {} (Thread/sleep 1))] {:tracing true}) (stats))
;; retrieve current aggregated statistics (stats)
Creates a timing statistics collector for yarn operations. This function returns a collector function that plays two roles: When called with no arguments, it aggregates and returns a snapshot of the timing statistics collected. The snapshot is a map whose keys are vectors of the form [yarn-id event-type] and whose values are structs knitty.tstats/Stats. When called with a yank-result argument, it extract timing information (via trace) and update the internal statistics tracker. Options (keyword arguments): - :yarns - a predicate function filter yarns for which timings should be collected; - :events - a set of event types to capture, defaults to #{:yank-at :call-at :done-at :deps-time :time}; - :window - the aggregator's time window in ms for windowed statistics (default: 60000); - :window-chunk- the chunk size (in ms) for subdividing the window (default: 1/8 of window); - :precision - the number of significant digits for recording histogram values (default: 3) - :percentiles - percentiles to compute (default: [50 90 95 99]). Usage: ;; create a collector for all yarns and events (def stats (timings-collector)) ;; run 'yank' (with tracing enabled) and pass result into the collector (doto @(knitty.core/yank {} [(knitty.core/yarn ::y {} (Thread/sleep 1))] {:tracing true}) (stats)) ;; retrieve current aggregated statistics (stats)
(yarn-timings yank-result)
(yarn-timings yank-result yarns)
(yarn-timings yank-result yarns events)
Extracts and aggregates timing data from the trace logs of a yank-result.
Returns an eduction of key-value [[yarn-id event-type] stats]
pairs.
Extracts and aggregates timing data from the trace logs of a yank-result. Returns an eduction of key-value `[[yarn-id event-type] stats]` pairs.
cljdoc builds & hosts documentation for Clojure/Script libraries
Ctrl+k | Jump to recent docs |
← | Move to previous article |
→ | Move to next article |
Ctrl+/ | Jump to the search field |