Liking cljdoc? Tell your friends :D

clojure-miniprofiler


*current-miniprofiler*clj


add-childclj

(add-child section-name)

add-client-resultsclj

(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
raw docstring

add-custom-timingclj

(add-custom-timing current-miniprofiler
                   call-type
                   custom-timing
                   duration
                   stacktrace-info)

assets-request?clj

(assets-request? req)

denotes if a request is for assets

denotes if a request is for assets
raw docstring

build-miniprofiler-response-htmlclj

(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.
raw docstring

build-miniprofiler-response-jsonclj

(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.
raw docstring

build-miniprofiler-script-tagclj

(build-miniprofiler-script-tag duration-ms profiler-id options)

client-resultsclj

(client-results req)

create-custom-timingclj

(create-custom-timing execute-type command-string stacktrace-info)

create-miniprofilerclj

(create-miniprofiler
  req
  {:keys [name-gen] :or {name-gen profile-name-gen} :as initial-opts})

current-msclj

(current-ms)

custom-timingcljmacro

(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.
raw docstring

default-optionsclj

(default-options opts)

distance-of-ns-timeclj

(distance-of-ns-time ns0 ns1)

get-id-from-reqclj

(get-id-from-req req)

get-stacktrace-infoclj

(get-stacktrace-info duration)

html-pprintclj

(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
raw docstring

in-memory-storeclj

(in-memory-store)

creates an in-memory miniprofiler results store

creates an in-memory miniprofiler results store
raw docstring

miniprofiler-resource-pathclj

(miniprofiler-resource-path req options)

miniprofiler-results-request?clj

(miniprofiler-results-request? req options)

miniprofiler-results-responseclj

(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.
raw docstring

miniprofiler-script-tagclj


ms-since-startclj

(ms-since-start)

parse-jsonclj

(parse-json value)

profile-name-genclj

(profile-name-gen req)

profile-request?clj

(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.
raw docstring

reconstruct-profileclj

(reconstruct-profile profiler duration)

render-shareclj

(render-share id options)

returns a ring response for sharing the miniprofiler result

returns a ring response for sharing the miniprofiler result
raw docstring

respond-with-assetclj

(respond-with-asset req miniprofiler-resource-path)

returns a miniprofiler asset as a ring response

returns a miniprofiler asset as a ring response
raw docstring

run-handler-profiledclj

(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.
raw docstring

tracecljmacro

(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.
raw docstring

uuidclj

(uuid)

generates an uuid

generates an uuid
raw docstring

with-recordingcljmacro

(with-recording options req & body)

wrap-miniprofilerclj

(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.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close