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 start(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=pypi --with kubernetes run

View the card:

python myflow.py card view start

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.1.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.1-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: metaflow_pyinstrument-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 93a79986672676eaf6d04abc4f27630a5b4360d0ca56c5b597686f6cc2457e47
MD5 ca678d67568af3c58b4f48a652776035
BLAKE2b-256 178f804c7ecf28e7857413bb95988e062d3d91351e569858888e7bbffeb253ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaflow_pyinstrument-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for metaflow_pyinstrument-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 692bda2ab0c4707e89046afb192327fafcdf8f1c52398e26a4159891b3ef4fb9
MD5 7a2dad8653123a52b4d7fff6abd5a137
BLAKE2b-256 f8bb1a39dbe26c21c80b0c365244a1a4424b49a7beb596068f8c9f0c568316ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaflow_pyinstrument-0.1.1-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