Skip to main content

Analyze Power BI Performance Analyzer JSON traces (export + run-level cache-aware summaries).

Project description

pbi-perf-trace

Utilities for analyzing Power BI Performance Analyzer JSON exports.

Install (dev)

pip install -e .[dev]

Development

  • Run lint: ruff check .
  • Run tests (venv): .\.venv\Scripts\python.exe -m pytest -q
  • Build dist: .\.venv\Scripts\python.exe -m build

CLI

Autorun (no args): export + analyze via config

If you run python main.py (or pbi-perf-trace) with no arguments, the tool will look for a pbi-perf-trace.json file in the current directory and run both export + analyze.

Example pbi-perf-trace.json:

{
	"files": {
		"measure_on_import": "C:/traces/perf_measure_on_import.json",
		"measure_on_direct": "C:/traces/perf_measure_on_direct.json"
	},
	"export_output": "output.csv",
	"out_dir": "out"
}

Export: traces -> pivoted CSV

pbi-perf-trace export --base-path "C:\\path\\to\\folder" --files "perf_measure_on_import.json=measure_on_import" --files "perf_measure_on_direct.json=measure_on_direct" --output output.csv

Analyze: run-level cache-aware summaries

pbi-perf-trace analyze --base-path "C:\\path\\to\\folder" --files "perf_measure_on_import.json=measure_on_import" --files "perf_measure_on_direct.json=measure_on_direct" --out-dir out

Outputs written to --out-dir:

  • kept_summary.csv
  • cold_reason_summary.csv
  • tag_official.csv
  • cache_official.csv

Library usage

Run both export + analyze (Python API)

pbi_perf_trace() is the main pip-friendly API. It accepts a dict mapping tag -> trace_json_path.

  • If output_path is provided, it writes CSV outputs into that directory.
  • It always returns DataFrames in-memory.
from pathlib import Path

from pbi_perf_trace import pbi_perf_trace

outputs = pbi_perf_trace(
	{
		"measure_on_import": Path(r"C:\\traces\\perf_measure_on_import.json"),
		"measure_on_direct": Path(r"C:\\traces\\perf_measure_on_direct.json"),
	},
	output_path="out",
)

# DataFrames are also returned in-memory:
print(outputs.tag_official.head())

License

MIT. See LICENSE.

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

pbi_perf_trace-0.1.0.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

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

pbi_perf_trace-0.1.0-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pbi_perf_trace-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fca195aa330d0548c57b5364452dbd08fb37f52c661fbd7a6dee75c3c7d37892
MD5 9e446e7d980be824740be581b7bc73ec
BLAKE2b-256 d3ddf50f366324e0ef00747ac5b92bd992968bc68d9b29b84740744165b1301b

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on IT-Matter-AS/pbi-perf-trace

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

File details

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

File metadata

  • Download URL: pbi_perf_trace-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pbi_perf_trace-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 416f44966c44dc3d4b1aa539ed58b30737905e905065472f8dc54ee47fa331d4
MD5 58d05cf298ddf77a5170cc94f30fb969
BLAKE2b-256 9dfd87343c6a2d157ca7e0605a75a06702523e786c6d27985bf20f796f9638b8

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on IT-Matter-AS/pbi-perf-trace

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