Skip to main content

Profile Metaflow steps with pyinstrument and render as HTML cards

Project description

metaflow-pyinstrument

Profile Metaflow steps with pyinstrument and view results as interactive HTML cards.

Installation

pip install metaflow-pyinstrument

Usage

from metaflow import FlowSpec, step, pypi_base
from metaflow_pyinstrument import pyinstrument_card

@pypi_base(packages={'pyinstrument': ''})
class MyFlow(FlowSpec):

    @pyinstrument_card()
    @step
    def train(self):
        # Your code here - will be profiled
        result = sum(i**2 for i in range(100000))
        self.next(self.end)

    @step
    def end(self):
        pass

if __name__ == '__main__':
    MyFlow()

Run with:

python myflow.py --environment=fast-bakery --with kubernetes run

View the card:

python myflow.py card view train

Parameters

Parameter Default Description
card_id "pyinstrument" Card identifier
interval 0.001 Sampling interval (seconds). Use 0.0001 for fast code
html_attribute "html" Artifact name for HTML output

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

metaflow_pyinstrument-0.1.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

metaflow_pyinstrument-0.1.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file metaflow_pyinstrument-0.1.0.tar.gz.

File metadata

  • Download URL: metaflow_pyinstrument-0.1.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for metaflow_pyinstrument-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bfb96a9757c650674d6c3e7731f24bd98159b88a992ac304b8be6063bf045f16
MD5 9c7358f0b08a60066a58de5ae6fa470b
BLAKE2b-256 b02693d50e971ea6e626ba1420c82b29c6147cfb4e6370ea3f2bf18f4ba6b5e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaflow_pyinstrument-0.1.0.tar.gz:

Publisher: publish.yml on outerbounds/metaflow-pyinstrument

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file metaflow_pyinstrument-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for metaflow_pyinstrument-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae41b6a2ce6adf8cfa2b428afcf3d4fcd9c368d2bc89d3c4c793cfc1fb9382bd
MD5 bbd4669e488fbc9f9490d1401842c554
BLAKE2b-256 61ccafafca3e9df48842a36e812b180efb7048bc921f78d75d54bfff9b1fa6ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaflow_pyinstrument-0.1.0-py3-none-any.whl:

Publisher: publish.yml on outerbounds/metaflow-pyinstrument

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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