Kolo CLI¶
kolo¶
kolo [OPTIONS] COMMAND [ARGS]...
trace¶
Subcommands for working with Kolo traces.
kolo trace [OPTIONS] COMMAND [ARGS]...
delete¶
Delete one or more traces stored by Kolo.
kolo trace delete [OPTIONS] [TRACE_IDS]...
Options
- --old¶
Delete old traces.
- --before <before>¶
Delete traces older than this datetime. Must be used with –old.
- --vacuum¶
Recover disk space from the Kolo database.
Arguments
- TRACE_IDS¶
Optional argument(s)
download¶
Download a trace from the Kolo dashboard
kolo trace download [OPTIONS] TRACE_ID
Arguments
- TRACE_ID¶
Required argument
dump¶
Dump a trace from the Kolo database to stdout or a specified file.
kolo trace dump [OPTIONS] TRACE_ID
Options
- --file <file>¶
The name of the file to save the trace to.
- --as-python¶
Show the trace as readable Python types.
- --syntax-highlight <syntax_highlight>¶
Highlight Python syntax. Ignored unless –as-python is set.
- Options:
off | light | dark
Arguments
- TRACE_ID¶
Required argument
json-to-msgpack¶
Convert all legacy json traces to msgpack
kolo trace json-to-msgpack [OPTIONS]
list¶
List of recent traces stored by Kolo.
kolo trace list [OPTIONS]
Options
- --count <count>¶
The number of rows to show.
- --reverse¶
Reverse the order of the rows: newest at the bottom.
list-queries¶
List all SQL queries in a trace.
kolo trace list-queries [OPTIONS] TRACE_ID
Options
- --syntax-highlight <syntax_highlight>¶
Highlight SQL query syntax.
- Options:
off | light | dark
Arguments
- TRACE_ID¶
Required argument
load¶
Load a trace from a file into the Kolo database.
kolo trace load [OPTIONS] PATH
Options
- --created-at <created_at>¶
Mark this trace as created at this time.
Arguments
- PATH¶
Required argument
upload¶
Upload a trace to the Kolo dashboard
kolo trace upload [OPTIONS] TRACE_ID
Arguments
- TRACE_ID¶
Required argument
generate-test¶
Generate a test from a Kolo trace.
kolo generate-test [OPTIONS] [TRACE_IDS]...
Options
- --test-name <test_name>¶
The name of the generated test.
- --test-class <test_class>¶
The name of the generated TestCase class.
- --file <file>¶
Write the generated test to this file.
- --settings <settings>¶
The dotted path to a Django settings module.
- --use-saved-schemas¶
Load Django schemas saved with kolo store-django-model-schema instead of using the current schema. This may be useful when generating a test from an old trace.
- --intermediate-format¶
Show an intermediate format of the data Kolo has extracted from the trace for use in the test.
- --and-run¶
[Experimental, Use not recommended] Immediately run the newly generated test.
- --unittest¶
Generate a unittest style test.
- --pytest¶
Generate a pytest style test (default).
Arguments
- TRACE_IDS¶
Optional argument(s)
run¶
Profile Python code using Kolo.
PATH is the path to the python file or module being profiled.
kolo run [OPTIONS] PATH [ARGS]...
Options
- --one-trace-per-test¶
Generate a trace for each test traced by Kolo.
- --use-monitoring¶
Enable Kolo implementation using sys.monitoring
Arguments
- PATH¶
Required argument
- ARGS¶
Optional argument(s)
dbshell¶
Open a sqlite3 shell to the Kolo database.
kolo dbshell [OPTIONS]
store-django-model-schema¶
Store Django model info for test generation.
kolo store-django-model-schema [OPTIONS]
Options
- --settings <settings>¶
The dotted path to a Django settings module.