(add-child section-name)
(add-client-results req stored-results)
adds incoming client results to a stored set of results
adds incoming client results to a stored set of results
(add-custom-timing current-miniprofiler
call-type
custom-timing
duration
stacktrace-info)
(assets-request? req)
denotes if a request is for assets
denotes if a request is for assets
(build-miniprofiler-response-html response duration-ms profiler-id options)
inserts the miniprofiler javascript tag into an html response.
inserts the miniprofiler javascript tag into an html response.
(build-miniprofiler-response-json response duration-ms profiler-id options)
inserts the miniprofiler details into a json response.
inserts the miniprofiler details into a json response.
(build-miniprofiler-script-tag duration-ms profiler-id options)
(client-results req)
(create-custom-timing execute-type command-string stacktrace-info)
(create-miniprofiler req
{:keys [name-builder]
:or {name-builder profile-name-builder}
:as initial-opts})
(current-ms)
(custom-timing call-type execute-type command-string & body)
wraps some of your code with a timing, so that it will show up in the miniprofiler results. takes 3 other arguments: call-type: the type of timed call this is. Examples might be "sql" or "redis"
execute-type: within the call-type, what kind of request this is. Examples might be "get" or "query" or "execute"
command-string: a pretty printed string of what this is executing. For SQL, this would be the query, for datomic the query or transaction data, for redis the key you're getting etc.
wraps some of your code with a timing, so that it will show up in the miniprofiler results. takes 3 other arguments: call-type: the type of timed call this is. Examples might be "sql" or "redis" execute-type: within the call-type, what kind of request this is. Examples might be "get" or "query" or "execute" command-string: a pretty printed string of what this is executing. For SQL, this would be the query, for datomic the query or transaction data, for redis the key you're getting etc.
(default-options opts)
(distance-of-ns-time ns0 ns1)
(get-id-from-req req)
(get-stacktrace-info duration)
(html-pprint x)
pretty prints a string and returns it. Much faster than clojure.pprint, uses fipp
pretty prints a string and returns it. Much faster than clojure.pprint, uses fipp
(in-memory-store)
creates an in-memory miniprofiler results store
creates an in-memory miniprofiler results store
(miniprofiler-resource-path req options)
(miniprofiler-results-request? req options)
(miniprofiler-results-response req options)
builds a ring response that returns miniprofiler results as json in the :body.
builds a ring response that returns miniprofiler results as json in the :body.
(ms-since-start)
(parse-json value)
(profile-name-builder req)
(profile-request? req options)
dictates whether this request should be profiled (after it's been authenticated). By default removes profiling of assets.
dictates whether this request should be profiled (after it's been authenticated). By default removes profiling of assets.
(reconstruct-profile profiler duration)
(render-share id options)
returns a ring response for sharing the miniprofiler result
returns a ring response for sharing the miniprofiler result
(respond-with-asset req miniprofiler-resource-path)
returns a miniprofiler asset as a ring response
returns a miniprofiler asset as a ring response
(run-handler-profiled req handler options)
runs a handler in profiled mode, potentially adding the profiler into the content, stores traces etc.
runs a handler in profiled mode, potentially adding the profiler into the content, stores traces etc.
(trace section-name & body)
trace lets you wrap sections of your code, so they show up in the miniprofiler UI. traces are nested (based on the call structure they wrap). A trace should be a section of your code, e.g. rendering a specific view, loading the required data out of the database
this macro just takes a name for the section you're wrapping in it.
trace lets you wrap sections of your code, so they show up in the miniprofiler UI. traces are nested (based on the call structure they wrap). A trace should be a section of your code, e.g. rendering a specific view, loading the required data out of the database this macro just takes a name for the section you're wrapping in it.
(with-recording options req & body)
(wrap-miniprofiler handler opts)
Ring middleware for using miniprofiler. Takes an options map with the following options:
:store (optional, something that implements clojure-miniprofiler.store/Storage) Implementation of a store for miniprofiler results. By default uses an in-memory store, which means that profiling won't work properly in a multi-machine environment. See the documentation on the Storage protocol for more.
:authorized? (a function, optional): the most important option - this specifies which requests will be profiled. By default only requests from localhost will be, but in production you probably want to turn this on for admins/etc.
:base-path (a string, optional): a string that denotes the paths miniprofiler will interact on. By default set to /miniprofiler.
:trivial-ms (an integer, measured in milliseconds): traces that take below this amount of time are hidden by default in the web ui.
:profile-request? (a function) a function that dictates whether we should profile the current request. By default asset requests aren't profiled, just html/json ones.
Ring middleware for using miniprofiler. Takes an options map with the following options: :store (optional, something that implements clojure-miniprofiler.store/Storage) Implementation of a store for miniprofiler results. By default uses an in-memory store, which means that profiling won't work properly in a multi-machine environment. See the documentation on the Storage protocol for more. :authorized? (a function, optional): the most important option - this specifies which requests will be profiled. By default only requests from localhost will be, but in production you probably want to turn this on for admins/etc. :base-path (a string, optional): a string that denotes the paths miniprofiler will interact on. By default set to /miniprofiler. :trivial-ms (an integer, measured in milliseconds): traces that take below this amount of time are hidden by default in the web ui. :profile-request? (a function) a function that dictates whether we should profile the current request. By default asset requests aren't profiled, just html/json ones.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close