Sam API Documentation
sam
Tiny, concurrent sampling profiler for Clozure Common Lisp. Sam peeks into the stack of a running process repeatedly to figure out where time is spent.
Example:
Credits:
The core functionality of Sam was kindly provided by R. Matthew Emerson.
call‑with‑sampling (Function)
Syntax:
— Function: call‑with‑sampling fn &key
interval
Arguments and Values:
fn—a function designator.
interval—a positive number designating a time in seconds. The default is 0.001.
Description:
call-with-sampling
profiles fn, and returns a hash table containing the collected samples. Interval specifies the time between samples collected.
profile (Macro)
Syntax:
— Macro: profile (
&key
interval cutoff)
&body
forms
Arguments and Values:
interval—a positive number designating a time in seconds. The default is 0.001.
cutoff—a number of type (real 0 100)
designating a percentage. The default is 3.
forms—forms to be evaluated.
Description:
profile
profiles the evaluation of forms and prints a summary of the results, omitting samples that constitute below cutoff percent of the total samples. Interval specifies the time between samples collected.
profile‑process (Function)
Syntax:
— Function: profile‑process process duration &key
interval cutoff
Arguments and Values:
process—a process
.
duration—a positive number designating a time in seconds.
interval—a positive number designating a time in seconds. The default is 0.001.
cutoff—a number of type (real 0 100)
designating a percentage. The default is 3.
Description:
profile-process
profiles process for duration, and prints a summary of the results, omitting samples that constitute below cutoff percent of the total samples. Interval specifies the time between samples collected.
report‑samples (Function)
Syntax:
— Function: report‑samples h &key
cutoff
Arguments and Values:
h—a hash table containing samples.
cutoff—a number of type (real 0 100)
designating a percentage. The default is 3.
Description:
report-samples
prints a summary of the samples in h, omitting samples that constitute below cutoff percent of the total samples.
sample‑process (Function)
Syntax:
— Function: sample‑process process duration &key
interval
Arguments and Values:
process—a process
.
duration—a positive number designating a time in seconds.
interval—a positive number designating a time in seconds. The default is 0.001.
Description:
sample-process
profiles process for duration, and returns a hash table containing the collected samples. Interval is the time between samples collected.