vitro DocsPricing

Performance.

Quick timings while you iterate, and a full Lighthouse audit for numbers that go in a report.

Two tools

get_performance_metrics is instant. run_audit needs a browser to itself. Choose by what the number is for.

SituationTool
Is this slower than last time?get_performance_metrics
Comparing several pagesget_performance_metrics
Inside a loopget_performance_metrics
Why is it slow, specifically?run_audit
An accessibility or SEO scorerun_audit
A number going into a reportrun_audit

Quick timings

get_performance_metrics(session_id, lease, page_id)

This reads the page's own PerformanceObserver data: navigation timings, first paint, FCP, LCP, transfer size and resource count. It needs no queue or second browser. It tells you whether the page is slow and roughly where. Use it by default for regression checks.

Full audits

run_audit(session_id, lease, url, categories: ["performance", "accessibility"])
  -> {ticket, queue_position, available, note}
get_audit(session_id, lease, ticket)

run_audit runs real Lighthouse in a separate browser that vitro starts for the audit and then discards. You get scores, Core Web Vitals, the biggest opportunities and the failed audits. categories defaults to all four: performance, accessibility, best-practices and seo.

An audit loads the page several times under throttling and uses a lot of CPU and memory, so audits share a small pool of browsers sized to the machine. When the pool is busy, an audit waits in a queue. run_audit returns a ticket at once with your queue position and never blocks. Do not poll it in a tight loop. To learn that it finished, use one of these, best first:

  1. Send a progressToken with the call. vitro pushes notifications/progress as the queue moves, when the slot becomes yours, and with the result. Your client must keep the streamable-HTTP channel open for this.
  2. Watch your own timeline. audit_started and audit_finished appear in the session journal.
  3. Call get_audit with the ticket now and then.

If available is false, Lighthouse is not installed on that machine. get_performance_metrics still works. Report that Lighthouse is unavailable, and do not report the page as broken.

Getting numbers you can trust

  • Throttle on purpose. set_network_conditions takes download_kbps, upload_kbps, latency_ms and offline. Unthrottled local numbers make any page look fast.
  • Set the viewport first with emulate or resize. LCP depends on what is above the fold, so a metric without its viewport cannot be reproduced.
  • Measure a settled page. Use wait_for on the element you care about first, so you do not time a page mid-load.
  • A new session starts with an empty cache, which gives the first-visit number (usually the useful one). Do not compare it with a warm reload and call the difference a regression.

Report each number with its viewport, its throttling and whether the cache was cold.

What is missing on purpose

There is no start_trace. A Chrome trace is tens of megabytes and needs a UI to read, so an agent cannot use it. run_audit gives the same conclusions, already reduced to opportunities and failed audits.