1.2.0 permalink Arrow_down_16x16

print-summary

clojure.contrib.profile

  • (print-summary profile-summary)
Prints a table of the results returned by summarize.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/profile.clj:95 top

(defn print-summary
  "Prints a table of the results returned by summarize."
  [profile-summary]
  (let [name-width (apply max 1 (map (comp count name) (keys profile-summary)))
        fmt-string (str "%" name-width "s  %8d  %8d  %8d  %8d  %8d%n")]
    (printf (.replace fmt-string \d \s)
            "Name" "mean" "min" "max" "count" "sum")
    (doseq [k (sort (keys profile-summary))]
      (let [v (get profile-summary k)]
        (printf fmt-string (name k) (:mean v) (:min v) (:max v) (:count v) (:sum v))))))
Vars in clojure.contrib.profile/print-summary: defn doseq let name printf
Used in 0 other vars

Comments top

No comments for print-summary. Log in to add a comment.