Public documentation to come soon. For now, see this internal Slack thread.
Use laminprofiler setup to create the record types that laminprofiler check writes to.
laminprofiler setupWhen run from a package repository root, this command:
- creates the
laminprofilerschema with features:package_versionduration_in_seccommit_hash16runner_env
- creates (or reuses) the top-level
LaminProfilertype - creates (or reuses) the package type (
<repo_name>, normalized with_) - creates (or reuses) task/script types for
tests/profiling/*.py
You can also set up a single profiling script:
laminprofiler setup tests/profiling/my_benchmark.pyIf profiling record types are missing, laminprofiler check raises an error telling you to run laminprofiler setup.
If a profiling script defines a top-level cleanup() function, laminprofiler calls it after each profiling run (run and check commands). This is useful for deleting benchmark artifacts between repeats.
Use the script pattern below so importing the script does not run the benchmark body:
def main():
...
def cleanup():
...
if __name__ == "__main__":
main()