mirror of https://github.com/status-im/timbre.git
19 lines
12 KiB
HTML
19 lines
12 KiB
HTML
<!DOCTYPE html PUBLIC ""
|
|
"">
|
|
<html><head><meta charset="UTF-8" /><link href="css/default.css" rel="stylesheet" type="text/css" /><script src="js/jquery.min.js" type="text/javascript"></script><script src="js/page_effects.js" type="text/javascript"></script><title>taoensso.timbre.profiling documentation</title></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Timbre</span> <span class="project-version">4.6.0</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>taoensso</span></div></div></li><li class="depth-2"><a href="taoensso.timbre.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>timbre</span></div></a></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>appenders</span></div></div></li><li class="depth-4"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>3rd-party</span></div></div></li><li class="depth-5 branch"><a href="taoensso.timbre.appenders.3rd-party.gelf.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>gelf</span></div></a></li><li class="depth-5 branch"><a href="taoensso.timbre.appenders.3rd-party.irclj.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>irclj</span></div></a></li><li class="depth-5 branch"><a href="taoensso.timbre.appenders.3rd-party.postgresql.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>postgresql</span></div></a></li><li class="depth-5 branch"><a href="taoensso.timbre.appenders.3rd-party.rolling.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rolling</span></div></a></li><li class="depth-5 branch"><a href="taoensso.timbre.appenders.3rd-party.rotor.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rotor</span></div></a></li><li class="depth-5"><a href="taoensso.timbre.appenders.3rd-party.slack.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>slack</span></div></a></li><li class="depth-4 branch"><a href="taoensso.timbre.appenders.carmine.html"><div class="inner"><span class="tree" style="top: -207px;"><span class="top" style="height: 216px;"></span><span class="bottom"></span></span><span>carmine</span></div></a></li><li class="depth-4 branch"><a href="taoensso.timbre.appenders.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-4 branch"><a href="taoensso.timbre.appenders.example.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>example</span></div></a></li><li class="depth-4"><a href="taoensso.timbre.appenders.postal.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>postal</span></div></a></li><li class="depth-3 branch current"><a href="taoensso.timbre.profiling.html"><div class="inner"><span class="tree" style="top: -362px;"><span class="top" style="height: 371px;"></span><span class="bottom"></span></span><span>profiling</span></div></a></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tools</span></div></div></li><li class="depth-4"><a href="taoensso.timbre.tools.logging.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>logging</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="taoensso.timbre.profiling.html#var-*pdata*"><div class="inner"><span>*pdata*</span></div></a></li><li class="depth-1"><a href="taoensso.timbre.profiling.html#var-capture-time.21"><div class="inner"><span>capture-time!</span></div></a></li><li class="depth-1"><a href="taoensso.timbre.profiling.html#var-defnp"><div class="inner"><span>defnp</span></div></a></li><li class="depth-1"><a href="taoensso.timbre.profiling.html#var-fn-sigs"><div class="inner"><span>fn-sigs</span></div></a></li><li class="depth-1"><a href="taoensso.timbre.profiling.html#var-fnp"><div class="inner"><span>fnp</span></div></a></li><li class="depth-1"><a href="taoensso.timbre.profiling.html#var-format-stats"><div class="inner"><span>format-stats</span></div></a></li><li class="depth-1"><a href="taoensso.timbre.profiling.html#var-fq-keyword"><div class="inner"><span>fq-keyword</span></div></a></li><li class="depth-1"><a href="taoensso.timbre.profiling.html#var-merge-times.3Estats.21"><div class="inner"><span>merge-times>stats!</span></div></a></li><li class="depth-1"><a href="taoensso.timbre.profiling.html#var-p"><div class="inner"><span>p</span></div></a></li><li class="depth-1"><a href="taoensso.timbre.profiling.html#var-p*"><div class="inner"><span>p*</span></div></a></li><li class="depth-1"><a href="taoensso.timbre.profiling.html#var-profile"><div class="inner"><span>profile</span></div></a></li><li class="depth-1"><a href="taoensso.timbre.profiling.html#var-pspy"><div class="inner"><span>pspy</span></div></a></li><li class="depth-1"><a href="taoensso.timbre.profiling.html#var-pspy*"><div class="inner"><span>pspy*</span></div></a></li><li class="depth-1"><a href="taoensso.timbre.profiling.html#var-sampling-profile"><div class="inner"><span>sampling-profile</span></div></a></li><li class="depth-1"><a href="taoensso.timbre.profiling.html#var-with-pdata"><div class="inner"><span>with-pdata</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">taoensso.timbre.profiling</h1><div class="doc"><pre class="plaintext">DEPRECATED, further development work will be focused on
|
|
Tufte at <a href="https://github.com/ptaoussanis/tufte">https://github.com/ptaoussanis/tufte</a>.</pre></div><div class="public anchor" id="var-*pdata*"><h3>*pdata*</h3><h4 class="dynamic">dynamic</h4><div class="usage"></div><div class="doc"><pre class="plaintext">{::pid {:times [t1 t2 ...] ; Times awaiting merge into stats
|
|
:ntimes _ ; (count times)
|
|
:stats {} ; Cumulative stats
|
|
}}</pre></div><div class="src-link"><a href="https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/profiling.clj#L21">view source</a></div></div><div class="public anchor" id="var-capture-time.21"><h3>capture-time!</h3><div class="usage"><code>(capture-time! id t-elapsed)</code></div><div class="doc"><pre class="plaintext"></pre></div><div class="src-link"><a href="https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/profiling.clj#L104">view source</a></div></div><div class="public anchor" id="var-defnp"><h3>defnp</h3><h4 class="type">macro</h4><div class="usage"><code>(defnp name doc-string? attr-map? [params*] prepost-map? body)</code><code>(defnp name doc-string? attr-map? ([params*] prepost-map? body) + attr-map?)</code></div><div class="doc"><pre class="plaintext">Like `defn` but wraps fn bodies with `p` macro.
|
|
</pre></div><div class="src-link"><a href="https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/profiling.clj#L254">view source</a></div></div><div class="public anchor" id="var-fn-sigs"><h3>fn-sigs</h3><div class="usage"><code>(fn-sigs fn-name sigs)</code></div><div class="doc"><pre class="plaintext">Implementation detail.
|
|
</pre></div><div class="src-link"><a href="https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/profiling.clj#L217">view source</a></div></div><div class="public anchor" id="var-fnp"><h3>fnp</h3><h4 class="type">macro</h4><div class="usage"><code>(fnp name? [params*] prepost-map? body)</code><code>(fnp name? ([params*] prepost-map? body) +)</code></div><div class="doc"><pre class="plaintext">Like `fn` but wraps fn bodies with `p` macro.
|
|
</pre></div><div class="src-link"><a href="https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/profiling.clj#L235">view source</a></div></div><div class="public anchor" id="var-format-stats"><h3>format-stats</h3><div class="usage"><code>(format-stats stats & [sort-field])</code></div><div class="doc"><pre class="plaintext"></pre></div><div class="src-link"><a href="https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/profiling.clj#L184">view source</a></div></div><div class="public anchor" id="var-fq-keyword"><h3>fq-keyword</h3><h4 class="type">macro</h4><div class="usage"><code>(fq-keyword id)</code></div><div class="doc"><pre class="plaintext">Returns namespaced keyword for given id.
|
|
</pre></div><div class="src-link"><a href="https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/profiling.clj#L10">view source</a></div></div><div class="public anchor" id="var-merge-times.3Estats.21"><h3>merge-times>stats!</h3><div class="usage"><code>(merge-times>stats!)</code><code>(merge-times>stats! id)</code></div><div class="doc"><pre class="plaintext"></pre></div><div class="src-link"><a href="https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/profiling.clj#L129">view source</a></div></div><div class="public anchor" id="var-p"><h3>p</h3><h4 class="type">macro</h4><div class="usage"><code>(p id & body)</code></div><div class="doc"><pre class="plaintext"></pre></div><div class="src-link"><a href="https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/profiling.clj#L45">view source</a></div></div><div class="public anchor" id="var-p*"><h3>p*</h3><div class="usage"></div><div class="doc"><pre class="plaintext"></pre></div><div class="src-link"><a href="https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/profiling.clj#L60">view source</a></div></div><div class="public anchor" id="var-profile"><h3>profile</h3><h4 class="type">macro</h4><div class="usage"><code>(profile level id & body)</code></div><div class="doc"><pre class="plaintext">When logging is enabled, executes named body with profiling enabled. Body
|
|
forms wrapped in (pspy) will be timed and time stats logged. Always returns
|
|
body's result.
|
|
|
|
Note that logging appenders will receive both a formatted profiling string AND
|
|
the raw profiling stats under a special :profiling-stats key (useful for
|
|
queryable db logging).</pre></div><div class="src-link"><a href="https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/profiling.clj#L77">view source</a></div></div><div class="public anchor" id="var-pspy"><h3>pspy</h3><h4 class="type">macro</h4><div class="usage"><code>(pspy id & body)</code></div><div class="doc"><pre class="plaintext">Profile spy. When in the context of a *pdata* binding, records execution time
|
|
of named body. Always returns the body's result.</pre></div><div class="src-link"><a href="https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/profiling.clj#L30">view source</a></div></div><div class="public anchor" id="var-pspy*"><h3>pspy*</h3><div class="usage"></div><div class="doc"><pre class="plaintext"></pre></div><div class="src-link"><a href="https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/profiling.clj#L49">view source</a></div></div><div class="public anchor" id="var-sampling-profile"><h3>sampling-profile</h3><h4 class="type">macro</h4><div class="usage"><code>(sampling-profile level probability id & body)</code></div><div class="doc"><pre class="plaintext">Like `profile`, but only enables profiling with given probability.
|
|
</pre></div><div class="src-link"><a href="https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/profiling.clj#L93">view source</a></div></div><div class="public anchor" id="var-with-pdata"><h3>with-pdata</h3><h4 class="type">macro</h4><div class="usage"><code>(with-pdata level & body)</code></div><div class="doc"><pre class="plaintext"></pre></div><div class="src-link"><a href="https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/profiling.clj#L70">view source</a></div></div></div></body></html> |