Liking cljdoc? Tell your friends :D

clojure-miniprofiler.core


*current-miniprofiler*clj

source

add-childclj

(add-child section-name)
source

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
sourceraw docstring

add-custom-timingclj

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

assets-request?clj

(assets-request? req)

denotes if a request is for assets

denotes if a request is for assets
sourceraw 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.
sourceraw 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.
sourceraw docstring

build-miniprofiler-script-tagclj

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

create-custom-timingclj

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

create-miniprofilerclj

(create-miniprofiler req initial-opts)
source

current-msclj

(current-ms)
source

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.
sourceraw docstring

default-optionsclj

(default-options opts)
source

distance-of-ns-timeclj

(distance-of-ns-time ns0 ns1)
source

get-stacktrace-infoclj

(get-stacktrace-info duration)
source

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
sourceraw docstring

in-memory-storeclj

(in-memory-store)

creates an in-memory miniprofiler results store

creates an in-memory miniprofiler results store
sourceraw docstring

miniprofiler-resource-pathclj

(miniprofiler-resource-path req options)
source

miniprofiler-results-request?clj

(miniprofiler-results-request? req options)
source

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.
sourceraw docstring

miniprofiler-script-tagclj

source

ms-since-startclj

(ms-since-start)
source

parse-jsonclj

(parse-json value)
source

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.
sourceraw docstring

reconstruct-profileclj

(reconstruct-profile profiler duration)
source

render-shareclj

(render-share id options)

returns a ring response for sharing the miniprofiler result

returns a ring response for sharing the miniprofiler result
sourceraw docstring

req->idclj

(req->id req)
source

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
sourceraw 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.
sourceraw 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, etc.

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, etc.

This macro just takes a name for the section you're wrapping in it.
sourceraw docstring

uuidclj

(uuid)

generates an uuid

generates an uuid
sourceraw docstring

with-recordingcljmacro

(with-recording options req & body)
source

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.
sourceraw docstring

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

× close