Skip to content

Commit

Permalink
1.37 removed Unicode dot prefix from secondary results
Browse files Browse the repository at this point in the history
  • Loading branch information
jgpc42 committed Oct 22, 2023
1 parent 19a8587 commit 6811e7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 2 additions & 5 deletions src/jmh/result.clj
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,13 @@

secondary (reduce-kv
(fn [m ^String k v]
(if-let [[_ pct] (re-find #"\u00b7p([\d.]+)$" k)]
(if-let [[_ pct] (re-matches #"p([\d.]+)" k)]
(let [pct (* 100 (double (Double/valueOf ^String pct)))]
(update m :percentiles assoc-sorted pct (edn v)))
(if-let [b (benchmark-data k)]
(update m :secondary assoc-sorted (:name b (:fn b))
(merge b (edn v)))
(let [kind (if (.startsWith k "\u00b7")
(subs k 1)
k)]
(update m :secondary assoc-sorted kind (edn v))))))
(update m :secondary assoc-sorted k (edn v)))))
{} (into {} (.getSecondaryResults r)))

nprefix (count state/param-field-prefix)
Expand Down
6 changes: 4 additions & 2 deletions test/jmh/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,12 @@
(let [result (core/run
test/sample-env
(-> (assoc opts
;; :status true, :verbose true
:status true, :verbose true
:profilers ["gc"]
:fork {:count 1 :warmups 0})
(dissoc :mode)))]
;; (binding [*print-meta* true] (prn result))
(pp result)
(pp (meta result))
(is (= 11 (count result)))
(is (= 9 (count (filter :index result)))))))

Expand Down

0 comments on commit 6811e7e

Please sign in to comment.