The sets of data we manage can be thought of as resources. Each resource is represented by a shape of data consistent across interfaces.
In this documentation we use TypeScript to illustrate data. Below are common types shared across some resources.
Opportunities are load opportunities from the performance category exposed in the resulting JSON response from Lighthouse audits and consumed by Lighthouse's report renderer to display "opportunities" in the generated HTML report. It maps
id fields to audit definitions. The
rating field is what determines the color of bars seen in the "opportunities" section of the HTML report and reflects the opporunity impact.
In the above report, the first corresponding opportunity looks like the below.
Lighthouse can mimic a desktop or mobile experience by emulating the device and typical corresponding network conditions.
Page represents a URL and corresponding info to run Lighthouse audits against on Foo.
Page: Important Characteristics#
nameis a user-defined field to describe the page.
Foo manages a queue of Lighthouse audits to run on a group of pods within a cluster. When a pod becomes available, it picks the next item from the queue with an
available status and marks it as
QueueItems with an
available status are essentially Lighthouse audits waiting to start and all have associations to a
Page resource. When the corresponding Lighthouse audit has completed, the
QueueItem resource is deleted and a
LighthouseAudit resource is created from it. The processing of this queue utilizes the FIFO (First In First Out) method.
QueueItem: Important Characteristics#
indexrepresents the number in the queue order of an item.
1means the item is next in line while
0means a queue item is currently being audited by Lighthouse. If there are 25 items in the queue an
24would mean that item is last. Note:
indexis calculated after creation and will not be populated in the creation response.
idof a page enqueued to be Lighthouse audited.
statusis the queue status.
availableis the value of
statuswhen a page is waiting to be Lighthouse audited and
busywhen an audit is in progress.
tagis a user-defined or auto-generated string to describe the specific Lighthouse audit. On Foo users can tag an audit and can also do so via the API. This tag is transmitted to the resulting
typeis the type of run being executed in terms of Foo's services. At the time of this writing, the only possible value of this field is
lighthouseAuditbut there will be others in the future.
waitSecondsis an approximate value in seconds to account for the wait time of an item to be completed. This value should be taken with a grain of salt and not heavily relied upon. As our infrastructure changes, this value will be less reliable. This field will be either deprecated or revamped in the future at which time this doc will be updated. Note:
waitSecondsis calculated after creation and will not be populated in the creation response.
LighthouseAudit is the resulting payload from a Lighthouse audit on Foo.
LighthouseAudit: Important Characteristics#
finalScreenshotis a URL the last screenshot image captured by Lighthouse in the life cycle of the audit, hosted by Foo.
erroris only populated when Lighthouse exposes and error like
PROTOCOL_TIMEOUT. Typically scores will be
0when this happens.
opportunitiesrepresent performance load opportunities as detailed in the opportunity section.
reportis the URL of the HTML report generated by Lighthouse, hosted by Foo.
scoreSeoare the same scores you woud see at the top of a Lighthouse generated HTML report for each category respectively.
tagis a user-defined or auto-generated string to describe the specific Lighthouse audit. On Foo users can tag an audit and can also do so via the API.