Skip to main content

Fast, easy, pretty and readable program instrumentation.

Project description

Kepler

Wish you could see stuff like this about your program?

image

Kepler meticulously tracks your program, and creates simply and easily readable reports to help you understand what they're doing.

Kepler is not a replacement for a good profiling tool, nor is it necessarily a great production implementation tool. Kepler is designed to be that go-to tool in your toolbelt for quick and dirty measurements of your programs.

Installing Kepler

pip install kepler

Kepler in action

The first thing you should do with Kepler is annotate a function or two you want to time with @kepler.time, and then add a kepler.report() call to your amin function.

Here's the script that produced the screenshot above:

import kepler, random, time

@kepler.time("do some stuff")
def do_some_stuff():
    split = kepler.stopwatch("watch")
    for i in kepler.time("loop", range(20)):
        with kepler.time("sleep"):
            time.sleep(random.random() / 100)
        if i % 2 == 1:
            with kepler.time("overhead"):
                split("odd")
        else:
            with kepler.time("overhead"):
                split("even")

@kepler.time
def main():
    with kepler.time("sloooow"):
        time.sleep(0.3)
    do_some_stuff()

main()
kepler.report()

Roadmap

✅ Changelog

  • Import and export reports as json
  • Report directly from json -- try python -m kepler.report < tests/data/simple_log.json
  • Testing for units, json import and export

🔜 Up next

  • Track system metrics

🌈 Before 1.0

  • Export traces to pandas
  • Flamegraphs
  • Integrate with open-telemetry
  • Track and report other metrics besidings timings
  • Thorough unit testing
  • Docs
  • Examples
  • Logo

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

kepler-0.2.2.tar.gz (160.0 kB view details)

Uploaded Source

Built Distribution

kepler-0.2.2-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file kepler-0.2.2.tar.gz.

File metadata

  • Download URL: kepler-0.2.2.tar.gz
  • Upload date:
  • Size: 160.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for kepler-0.2.2.tar.gz
Algorithm Hash digest
SHA256 615ca97bdc7e7a7b208abb3368f1151ba060d603d010337e9272251282b8c10d
MD5 d76890424f6f99b47d2606afd72f0909
BLAKE2b-256 3d6930fb170ea8ba9d4a13ef2ee2ad035f6ad7d8deea5c50cb06e28b39a360b3

See more details on using hashes here.

File details

Details for the file kepler-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: kepler-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for kepler-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3f89fd14bed9dcbd7415718f277ca594876b68880a689e1903243162ee4dbb1f
MD5 71761bbe08f8e2792024f19782cd76d9
BLAKE2b-256 46651ec7aad6b5e76f2d4cbbc11cccb4b5fda6f72449e5b6b303aee4d2801d47

See more details on using hashes here.

Supported by

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