(measure fs)(measure fs {:keys [on-error? id] :as opts})takes a set of functions (namespace vars) with 'optional options' and wraps them with timers.
i.e. (measure #{#'app/foo #'app/bar}) or (measure #{#'app/foo #'app/bar} {:report log/info})
by default 'measure' will use 'println' to report times functions took
takes a set of functions (namespace vars) with 'optional options'
and wraps them with timers.
i.e. (measure #{#'app/foo #'app/bar})
or
(measure #{#'app/foo #'app/bar} {:report log/info})
by default 'measure' will use 'println' to report times functions took(trace fs)(trace fs {:keys [id] :as opts})takes a set of functions (namespace vars) with 'optional options' and wraps them µ/trace (https://github.com/BrunoBonacci/mulog#%CE%BCtrace)
=> (trace #{#'user/rsum #'user/rmult})
in case µ/trace options are not provided, but the can be
=> (trace #{#'user/rsum #'user/rmult} {:pairs [:moo :zoo] ;; standard µ/trace :pairs :capture (fn [x] {:x-is x}) ;; ----- || ------- :capture :format-args (comp s/upper-case ;; if provided will also format and add input args to pairs str first)}}))
takes a set of functions (namespace vars) with 'optional options'
and wraps them µ/trace (https://github.com/BrunoBonacci/mulog#%CE%BCtrace)
=> (trace #{#'user/rsum
#'user/rmult})
in case µ/trace options are not provided, but the can be
=> (trace #{#'user/rsum
#'user/rmult} {:pairs [:moo :zoo] ;; standard µ/trace :pairs
:capture (fn [x] {:x-is x}) ;; ----- || ------- :capture
:format-args (comp s/upper-case ;; if provided will also format and add input args to pairs
str
first)}}))(uncalip fs)takes a set of functions (namespace vars) and removes all calip wrappers from them. i.e. (uncalip #{#'app/foo #'app/bar})
takes a set of functions (namespace vars) and removes all calip wrappers from them.
i.e. (uncalip #{#'app/foo #'app/bar})(untrace fs)takes a set of functions (namespace vars) and removes µ/trace from them. i.e. (untrace #{#'app/foo #'app/bar})
takes a set of functions (namespace vars) and removes µ/trace from them.
i.e. (untrace #{#'app/foo #'app/bar})(unwrap fs)(unwrap fs {:keys [id]})takes a set of functions (namespace vars) and removes calip wrappers from them. if an :id is provided, only removes a wrapper with this id
i.e. (unwrap #{#'app/foo #'app/bar}) (unwrap #{#'app/foo #'app/bar} {:id :retry}) (unwrap (wrapped))
takes a set of functions (namespace vars) and removes calip wrappers from them.
if an :id is provided, only removes a wrapper with this id
i.e. (unwrap #{#'app/foo #'app/bar})
(unwrap #{#'app/foo #'app/bar} {:id :retry})
(unwrap (wrapped))(wrap fs advice)(wrap fs advice {:keys [id] :or {id :wrap}})takes a set of functions (namespace vars) and wraps them in an 'advice' function that is called instead of the function with the function name (var), the function itself and its arguments: (fn [fname f & args] ...)
it is up to the 'advice' to call (or not to call) the function:
=> (wrap #{#'user/rsum} (fn [fname f & args] (println "calling" fname "with" args) (apply f args)))
a function can be wrapped many times as long as wrappers have different ids. by default an id is :wrap, but it can be provided:
=> (wrap #{#'user/rsum} retry {:id :retry})
takes a set of functions (namespace vars) and wraps them in an 'advice' function
that is called _instead_ of the function with the function name (var),
the function itself and its arguments: (fn [fname f & args] ...)
it is up to the 'advice' to call (or not to call) the function:
=> (wrap #{#'user/rsum}
(fn [fname f & args]
(println "calling" fname "with" args)
(apply f args)))
a function can be wrapped many times as long as wrappers have different ids.
by default an id is :wrap, but it can be provided:
=> (wrap #{#'user/rsum} retry {:id :retry})(wrapped)returns all the functions wrapped by calip with ids of their wrappers => {#'user/rsum #{:measure :trace}}
returns all the functions wrapped by calip with ids of their wrappers
=> {#'user/rsum #{:measure :trace}}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 |