Skip to main content

Live response-time stats from streamed AppPack web logs.

Project description

apppack-stats

Live response-time stats from streamed AppPack web logs.

apppack-stats shells out to apppack logs --raw --follow for the app you name, parses the JSON request lines, and renders a live Textual data table grouped by (method, normalized path). Click any column header to re-sort by it; click again to flip the direction.

Slowest endpoints — 1842/1903 lines parsed, 47s elapsed
┏━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━┓
┃ Method ┃ Path                          ┃ Count ┃ Avg ms ┃ p95 ms ┃ Max ms ┃ Err ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━┩
│ GET    │ /reports/<id>/export          │     7 │   1842 │   2210 │   2480 │     │
│ POST   │ /api/v1/orders                │    23 │    412 │    711 │    980 │   2 │
│ GET    │ /dashboard                    │    91 │    188 │    320 │    640 │     │
└────────┴───────────────────────────────┴───────┴────────┴────────┴────────┴─────┘

Usage

No install required — run it straight from PyPI with uv:

uvx apppack-stats <appname>

Press q (or Ctrl+C) to stop.

Keys

Key Action
Click column header Sort by that column (click again to reverse)
n Toggle URL normalization on/off
q Quit

The AppPack CLI must be on your PATH and authenticated against the account that owns the app.

Options

Flag Default Notes
--refresh SEC 1.0 Seconds between redraws
--start DUR 5m How far back to seed history (30m, 2h, 1d, …)
--prefix STRING none AppPack log-group prefix filter — see note below
--no-normalize off Group by raw path instead of normalizing IDs
-o, --output PATH none On exit, write the final stats to PATH as CSV (- for stdout). Rows are sorted by whichever column was active in the UI when you quit.

The table fills the terminal and scrolls when there are more rows than fit.

A note on --prefix

apppack logs --prefix filters on AppPack's underlying CloudWatch log-group names, which don't always begin with the service name shown in the rendered (web/web/<task>) label. Different AppPack apps use different log-group naming conventions, so a fixed default like web silently drops everything for some apps. By default apppack-stats passes no prefix and lets the parser filter — only access-log JSON lines (those with method, path, status, response_time_us) are counted; everything else is skipped.

URL normalization

By default, paths are normalized so that /orders/12345 and /orders/67890 share a row as /orders/<id>. UUIDs become /<uuid>, long hex hashes become /<hash>. Pass --no-normalize to keep raw paths.

Adding support for another log shape

Access-log shapes live in src/apppack_stats/extractors.py. Append a new LogShape(...) to the SHAPES list — pick a time_field key that doesn't collide with existing ones, set time_unit to "us", "ms", or "s", and the parser will pick it up automatically.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apppack_stats-0.5.0.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

apppack_stats-0.5.0-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file apppack_stats-0.5.0.tar.gz.

File metadata

  • Download URL: apppack_stats-0.5.0.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for apppack_stats-0.5.0.tar.gz
Algorithm Hash digest
SHA256 7363e7ecb86a807bfbd207885b8772aa0d2c1a8db06240da981d01b4c49e9b88
MD5 641fa06a5d6be7a2a33fc0d4ab5b36c3
BLAKE2b-256 6a9aafa00d17c2489f50683e74a9e47eaffee150bbdcee99466aaf06a4f35f0a

See more details on using hashes here.

File details

Details for the file apppack_stats-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: apppack_stats-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for apppack_stats-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 88fc75324a97fc99c805acbfb595514590d0e080806d0a8970e5f6057910c481
MD5 03eaf58c463dec485cb16b9c30938edb
BLAKE2b-256 714068e77c0601856b45c034e4ac63fce6c3bcf85a468818c95a7cfda3a50339

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page