A simple, fast, monitoring profiler for Clojure/Script.
These macros conditionally[1] activate thread-local or dynamic (multi-threaded) profiling for their body:
(profiled [level & body] [level :when test & body])
(profiled-dynamic [level & body] [level :when test & body])
(profile [level stats-id & body] [level stats-id :when test & body])
(profile-dynamic [level stats-id & body] [level stats-id :when test & body])
profiled*
ALWAYS returns [<result> ?<thread-local-stats>] vector.
profile*
ALWAYS returns <result>; and handles[2] ?<thread-local-stats>.
[1] Compile-time elision for: [level ns] Runtime filtering for: [level ns (test)] ; Note optional arbitrary test
[2] See set-handler!
to un/register handler fn/s (e.g. for logging or
further analysis).
This macro conditionally[3] records body execution times when profiling is active:
(p [form-id & body] [level form-id & body]) ; ALWAYS returns body's result
[3] Compile-time elision for: [level ns] Runtime filtering for: [profiling-active?]
Please see the API docs for more info.
Tufte is highly optimized: even without elision, you can usually leave profiling code in production (e.g. for sampled profiling, or to detect unusual performance behaviour). Tufte's stats maps are well suited to programmatic inspection + analysis.
A simple, fast, monitoring profiler for Clojure/Script. Core API: ========= These macros conditionally[1] activate thread-local or dynamic (multi-threaded) profiling for their body: (profiled [level & body] [level :when test & body]) (profiled-dynamic [level & body] [level :when test & body]) (profile [level stats-id & body] [level stats-id :when test & body]) (profile-dynamic [level stats-id & body] [level stats-id :when test & body]) `profiled*` ALWAYS returns [<result> ?<thread-local-stats>] vector. `profile*` ALWAYS returns <result>; and handles[2] ?<thread-local-stats>. [1] Compile-time elision for: [level ns] Runtime filtering for: [level ns (test)] ; Note optional arbitrary test [2] See `set-handler!` to un/register handler fn/s (e.g. for logging or further analysis). ------------------------------------------------------------------------- This macro conditionally[3] records body execution times when profiling is active: (p [form-id & body] [level form-id & body]) ; ALWAYS returns body's result [3] Compile-time elision for: [level ns] Runtime filtering for: [profiling-active?] Please see the API docs for more info. How/where to use this library: ============================== Tufte is highly optimized: even without elision, you can usually leave profiling code in production (e.g. for sampled profiling, or to detect unusual performance behaviour). Tufte's stats maps are well suited to programmatic inspection + analysis.
No vars found in this namespace.
Private implementation details.
Private implementation details.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close