OrmaosDocs

Reference

ormaos io

Shows the database, file, subprocess and HTTP events of a recording or a call, grouped by what was done and by the line of your code that caused it.

View as Markdown
ormaos io [-h] [--json] [--limit N] [--offset N]
          [--kind {sqlite,file,subprocess,http}]
          [address]
ArgumentFrom the parserDefault
address`last` (the default), a recording such as r3, or an address inside one: r3:c42 (a call), r3:e5 (an exception), r3:i7 (an io event), r3:l2 (a logging record)last
--jsonprint JSON on stdout.
--limit Nshow at most N entries (default 20)20
--offset Nskip the first N entries.
--kind KINDshow only this kind of I/O. One of: sqlite, file, subprocess, http.
order-sync
$ ormaos io r1:e1
r1:e1 sync_orders and the calls below it: 180 io events (sqlite 180)
  30x sqlite "SELECT on_hand, pack_size FROM stock WHERE sku = ?"  at inventory.py:87 in apply_order  [r1:i3]
  30x sqlite "SELECT ? FROM applied_orders WHERE order_id = ?"  at inventory.py:92 in apply_order  [r1:i4]
  30x sqlite BEGIN  at inventory.py:101 in apply_order  [r1:i5]
  30x sqlite "UPDATE stock SET on_hand = on_hand - ? WHERE sku = ?"  at inventory.py:101 in apply_order  [r1:i6]
  30x sqlite "INSERT INTO applied_orders (order_id, sku, quantity, applied_at) VALU..."  at inventory.py:105 in apply_order  [r1:i7]
  30x sqlite COMMIT  at inventory.py:100 in apply_order  [r1:i8]
calls directly below: 36 check_order (6 raised, no io), 30 apply_order (180 io)
next: ormaos io r1:i3 | ormaos io r1:i4 | ormaos tree r1:c130 | ormaos io r1:c16

The I/O is grouped by what was done and by the line of your code that caused it, with a count. A statement, a path or a URL is text of your program, so it is between quotes when it is more than one plain word. The last lines say how the I/O splits among the calls directly below.

KindRecordedNever recorded
sqlitethe connection (the path of the database), each statement with every literal replaced by ?, the tableparameters, literals, rows
fileopen with the path and the mode; read and write when Python code calls them on the filecontents, sizes
subprocessa program started with subprocess or os.exec*/os.posix_spawn: its name and how many arguments; os.system as system shell, os.fork as forkarguments, environment, output, the shell command
httpmethod, scheme, host, port, path, status and duration, for http.client (so also urllib, requests, urllib3) and httpxquery string, user and password of the URL, ;parameters, fragment, headers, bodies

Arguments#

address#

A recording, a call (its I/O and the I/O of the calls below it), an exception (the call that handled it), or one I/O event:

order-sync
$ ormaos io r1:i3
r1:i3 sqlite "SELECT on_hand, pack_size FROM stock WHERE sku = ?"
  caused at   inventory.py:87 in apply_order  [r1:c135]
  inside      r1:c1 <module> > r1:c16 main > r1:c130 sync_orders
  database    data/inventory.db
  parameters  not recorded; literals are shown as ?
next: ormaos io r1:c135 | ormaos tree r1:c135 | ormaos io r1

--kind KIND#

Only sqlite, file, subprocess or http.

order-sync
$ ormaos io r1 --kind file
r1: 182 io events (sqlite 181, file 1), showing file
  1x file open data/orders.csv (read)  at fetch.py:26 in from_csv  [r1:i2]
next: ormaos io r1:i2 | ormaos io r1:c20 | ormaos exceptions r1

--limit N#

At most N groups. Default 20.

--offset N#

Skips the first N groups.

--json#

Kinds io and io_event. Schemas: /schemas/io.json, /schemas/io_event.json.