(defnp name & forms)
A replacement for clojure.core/defn that accumuldates profiling data. Converts a function like:
(defnp add-1 "Adds one to an arg" [x] (inc x))
to:
(defn add-1 "" ; dummy docstring [x] (with-timer-accum :demo.core/add-1 ; lookup key is fully-qualified function name (inc x))) ; function body unchanged
Does not handle function metadata like (defn ^:private my-fn ...)
A replacement for clojure.core/defn that accumuldates profiling data. Converts a function like: (defnp add-1 "Adds one to an arg" [x] (inc x)) to: (defn add-1 "" ; dummy docstring [x] (with-timer-accum :demo.core/add-1 ; lookup key is fully-qualified function name (inc x))) ; function body unchanged Does not handle function metadata like (defn ^:private my-fn ...)
(print-profile-stats)
Prints profile stats to stdout.
Prints profile stats to stdout.
(profile-data-sorted)
Returns a vector of profile stats sorted by ID.
Returns a vector of profile stats sorted by ID.
(profile-map)
Returns a map of all profile stats, keyed by ID.
Returns a map of all profile stats, keyed by ID.
(stats-get id)
Return basic stats for a given id
Return basic stats for a given id
(stats-update id seconds)
Updates timing stats for a given key & elapsed time
Updates timing stats for a given key & elapsed time
(timer-stats-reset)
Reset all timer statistics to empty
Reset all timer statistics to empty
(with-timer-accum id & forms)
Times execution of Clojure forms, accumulating results in timer-stats map under key id
.
Times execution of Clojure forms, accumulating results in timer-stats map under key `id`.
(with-timer-print id & forms)
Times execution of Clojure forms, printing the result to the screen.
Times execution of Clojure forms, printing the result to the screen.
(with-timer-result & forms)
Times execution of Clojure forms, returning a result map like: {:result result :seconds seconds}
Times execution of Clojure forms, returning a result map like: {:result result :seconds seconds}
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close