Liking cljdoc? Tell your friends :D

criterium.viewer.print.core

Print viewer core functions for basic metrics display.

Provides text output for:

  • metrics, stats, extremes
  • bootstrap statistics
  • samples with outliers
  • outlier counts and significance
  • event stats (class loader, JIT, GC)
  • final GC warnings
  • OS and runtime info
  • histograms, KDE, quantiles
Print viewer core functions for basic metrics display.

Provides text output for:
- metrics, stats, extremes
- bootstrap statistics
- samples with outliers
- outlier counts and significance
- event stats (class loader, JIT, GC)
- final GC warnings
- OS and runtime info
- histograms, KDE, quantiles
raw docstring

for-each-metricclj

(for-each-metric metric-configs results f)

Iterate over metrics, calling f for each with data present.

Extracts data from results using each metric's :path. Calls f only when data is non-nil. Designed for the common print viewer pattern: (doseq [mc metric-configs] (when-let [data (get-in results (:path mc))] (print-fn mc data)))

Arguments: metric-configs - sequence of metric configs with :path keys results - nested map to look up data from (via get-in) f - function of (metric-config data)

Returns nil.

Iterate over metrics, calling f for each with data present.

Extracts data from results using each metric's :path. Calls f only when
data is non-nil. Designed for the common print viewer pattern:
  (doseq [mc metric-configs]
    (when-let [data (get-in results (:path mc))]
      (print-fn mc data)))

Arguments:
  metric-configs - sequence of metric configs with :path keys
  results        - nested map to look up data from (via get-in)
  f              - function of (metric-config data)

Returns nil.
sourceraw docstring

for-each-metric-keyedclj

(for-each-metric-keyed metric-configs results f)

Iterate over metrics, calling f for each with data present.

Like for-each-metric but uses (get results path) instead of get-in. Use this when the results map has vector paths as keys: {[:elapsed-time] {:data ...}}

Arguments: metric-configs - sequence of metric configs with :path keys results - map with path vectors as keys f - function of (metric-config data)

Returns nil.

Iterate over metrics, calling f for each with data present.

Like for-each-metric but uses (get results path) instead of get-in.
Use this when the results map has vector paths as keys:
  {[:elapsed-time] {:data ...}}

Arguments:
  metric-configs - sequence of metric configs with :path keys
  results        - map with path vectors as keys
  f              - function of (metric-config data)

Returns nil.
sourceraw docstring

format-labelclj

(format-label label)

Format a label with colon at primary width. Returns string like ' My Label:'

Format a label with colon at primary width.
Returns string like '           My Label:'
sourceraw docstring

format-labeled-valueclj

(format-labeled-value label value)
(format-labeled-value label value sublabel?)

Format a labeled value for print output.

Returns string like ' Label: value'.

Arguments: label - label text (padded to standard width with colon) value - value to display after label sublabel? - if true, use secondary width (36), else primary (32)

Example: (println (format-labeled-value "Elapsed" "123 ns")) ;;=> Elapsed: 123 ns

Format a labeled value for print output.

Returns string like '           Label: value'.

Arguments:
  label   - label text (padded to standard width with colon)
  value   - value to display after label
  sublabel? - if true, use secondary width (36), else primary (32)

Example:
  (println (format-labeled-value "Elapsed" "123 ns"))
  ;;=>            Elapsed: 123 ns
sourceraw docstring

format-sublabelclj

(format-sublabel label)

Format a label with colon at secondary width. Returns string like ' My Sublabel:'

Format a label with colon at secondary width.
Returns string like '               My Sublabel:'
sourceraw docstring

get-analysis-contextclj

(get-analysis-context id-key default-id view data-map metric-filter)

Extract common context for print viewer functions.

Looks up analysis data from data-map using the ID from view options (or default-id), extracts metrics-defs (optionally filtered by metric-filter), and computes transforms.

Arguments: id-key - keyword to look up in view for the analysis ID default-id - fallback ID if not specified in view view - view options map data-map - benchmark data map metric-filter - predicate to filter metrics, or nil for no filtering

Returns map with :analysis-map, :metric-configs, :transforms, or nil if no data found.

Extract common context for print viewer functions.

Looks up analysis data from data-map using the ID from view options
(or default-id), extracts metrics-defs (optionally filtered by
metric-filter), and computes transforms.

Arguments:
  id-key       - keyword to look up in view for the analysis ID
  default-id   - fallback ID if not specified in view
  view         - view options map
  data-map     - benchmark data map
  metric-filter - predicate to filter metrics, or nil for no filtering

Returns map with :analysis-map, :metric-configs, :transforms,
or nil if no data found.
sourceraw docstring

label-indentclj

Indent width for continuation lines after a label (label-width + 2 for ': ').

Indent width for continuation lines after a label
(label-width + 2 for ': ').
sourceraw docstring

label-indent-strclj

(label-indent-str)

Return a string of spaces matching label indent width (34 chars). Use for continuation lines after a format-label line.

Return a string of spaces matching label indent width (34 chars).
Use for continuation lines after a format-label line.
sourceraw docstring

label-strclj

(label-str label)

Format a label padded to primary width (32 chars). Returns a format-ready string without trailing colon.

Format a label padded to primary width (32 chars).
Returns a format-ready string without trailing colon.
sourceraw docstring

label-widthclj

Primary label width for print viewer output.

Primary label width for print viewer output.
sourceraw docstring

(print-bootstrap-stat metric {:keys [mean quantiles]} transforms show-stats)

Print bootstrap statistics for a metric.

The show-stats set controls which statistics are displayed: :median - Median with 95% CI :mean - Mean with 95% CI :spread - p10-p90 percentile spread

Default shows :median and :spread.

Print bootstrap statistics for a metric.

The show-stats set controls which statistics are displayed:
  :median - Median with 95% CI
  :mean   - Mean with 95% CI
  :spread - p10-p90 percentile spread

Default shows :median and :spread.
sourceraw docstring

(print-bootstrap-stats view data-map)

Print bootstrap statistics for all metrics.

View options: :bootstrap-stats-id - key for bootstrap data (default :bootstrap-stats) :show-stats - set of stats to display: #{:median :mean :spread} Default: #{:median :spread}

Print bootstrap statistics for all metrics.

View options:
  :bootstrap-stats-id - key for bootstrap data (default :bootstrap-stats)
  :show-stats         - set of stats to display: #{:median :mean :spread}
                        Default: #{:median :spread}
sourceraw docstring

(print-event-stats metrics-defs event-stats)
source

(print-event-stats-metrics event-stats metric ms)
source

(print-extreme metric stat transforms)

Print min and max values for a metric in spread format. Output: '{label} extremes [min max] unit'

Print min and max values for a metric in spread format.
Output: '{label} extremes [min max] unit'
sourceraw docstring

(print-extremes metrics stats transforms)

Print min/max extremes for all metrics. Each metric gets its own line with 'label extremes' format.

Print min/max extremes for all metrics.
Each metric gets its own line with 'label extremes' format.
sourceraw docstring

(print-final-gc-warnings {:keys [final-gc-id samples-id warn-threshold]}
                         data-map)
source

(print-metrics metrics metrics->values)
source

(print-outlier-count metric-config num-samples outliers show-medcouple?)

Print outlier counts for a metric. When show-medcouple? is true, also displays the medcouple value and skewness classification if available.

Print outlier counts for a metric.
When show-medcouple? is true, also displays the medcouple value and skewness
classification if available.
sourceraw docstring

(print-outlier-counts
  {:keys [outliers-id show-medcouple] :or {show-medcouple true} :as _view}
  data-map)

Print outlier counts for all metrics. Options: :outliers-id - key for outliers in data-map (default :outliers) :show-medcouple - if true, display medcouple and skewness classification

Print outlier counts for all metrics.
Options:
  :outliers-id - key for outliers in data-map (default :outliers)
  :show-medcouple - if true, display medcouple and skewness classification
sourceraw docstring

(print-outlier-significance metric-config outlier-significance)
source

(print-outlier-significances view data-map)
source

(print-stat metric stat transforms)
source

(print-stats metrics stats transforms)
source

Alias to criterium.viewer.print.table/print-table for backwards compatibility.

Alias to criterium.viewer.print.table/print-table
for backwards compatibility.
sourceraw docstring

sublabel-indentclj

Indent width for continuation lines after a sublabel (sublabel-width + 2 for ': ').

Indent width for continuation lines after a sublabel
(sublabel-width + 2 for ': ').
sourceraw docstring

sublabel-indent-strclj

(sublabel-indent-str)

Return a string of spaces matching sublabel indent width (38 chars). Use for continuation lines after a format-sublabel line.

Return a string of spaces matching sublabel indent width (38 chars).
Use for continuation lines after a format-sublabel line.
sourceraw docstring

sublabel-strclj

(sublabel-str label)

Format a label padded to secondary width (36 chars). Returns a format-ready string without trailing colon.

Format a label padded to secondary width (36 chars).
Returns a format-ready string without trailing colon.
sourceraw docstring

sublabel-widthclj

Secondary/detail label width for print viewer output.

Secondary/detail label width for print viewer output.
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