Print viewer core functions for basic metrics display.
Provides text output for:
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
(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.(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.(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:'
(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
(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:'
(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.
Indent width for continuation lines after a label (label-width + 2 for ': ').
Indent width for continuation lines after a label (label-width + 2 for ': ').
(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.
(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.
Primary label width for print viewer output.
Primary label width for print viewer output.
(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.
(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}(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'(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.
(print-final-gc-warnings {:keys [final-gc-id samples-id warn-threshold]}
data-map)(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.
(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
Alias to criterium.viewer.print.table/print-table for backwards compatibility.
Alias to criterium.viewer.print.table/print-table for backwards compatibility.
Indent width for continuation lines after a sublabel (sublabel-width + 2 for ': ').
Indent width for continuation lines after a sublabel (sublabel-width + 2 for ': ').
(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.
(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.
Secondary/detail label width for print viewer output.
Secondary/detail label width for print viewer output.
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 |