Skip to content

CostReport

@final
class CostReport

Per-phase attribution for one sandbox, measured or projected.

CostReport declares no __new__ or __init__, so it is not constructed directly: an instance comes back from another call in this package.

complete: bool

False whenever any phase has no published rate.

fully_measured: bool

True only if every duration was timed. An estimate is never this.

items: list[LineItem]
label: str
priced: list[LineItem]

The line items with a published rate.

rates: RateTable
size: SizeClass
staleness: str | None

The staleness warning the table carried when this was computed.

total: Total

The total, which is a lower bound whenever anything is unpriced.

unpriced: list[LineItem]

The line items with no published rate.

def by_phase(phase: str) -> list[LineItem]

The line items belonging to one phase.

The string is judged by the core’s own [CostPhase::from_str], which is where the closed set lives. This module used to carry its own seven-element table for it — a parallel list over an enum, which would have gone stale the first time a phase was added and would have disagreed with the JS binding’s identical copy in whichever direction was edited first.

def render() -> str

Plain text, leading with what the dollars are rather than with the dollars.

def to_dict() -> dict

Core’s JSON shape for a report, as a dict: the one microvm cost --json and TypeScript’s toJson emit (#255).

def __repr__() -> str
def __str__() -> str

This page is generated from bindings/microvms-py/microvms.pyi by Griffe 2.3.0, run from site/scripts/gen-reference.mjs on every pnpm run sync, so an edit made here is overwritten by the next run.

To change the page, change the doc comment in the binding’s Rust source, then regenerate the declarations with mise run stubs. mise run stubs:check fails when the committed file no longer matches the source.