docs: add results object explainer#3495
Conversation
9fe7739 to
f058053
Compare
| * **[Calibre](https://calibreapp.com)** - Calibre is a web performance monitoring tool running Lighthouse continuously or on-demand via an API. Test using emulated devices and connection speeds from a number of geographical locations. Set budgets and improve performance with actionable guidelines. Note that Calibre is a paid product with a free 14-day trial. | ||
| * **[Calibre](https://calibreapp.com)** - Calibre is a web performance monitoring tool running Lighthouse continuously or on-demand via an API. Test using emulated devices and connection speeds from a number of geographical locations. Set budgets and improve performance with actionable guidelines. Note that Calibre is a paid product with a free 14-day trial. | ||
|
|
||
| * **[HTTPArchive](http://httparchive.org/)** - HTTPArchive tracks how the web is built by crawling 500k pages with Web Page Test, including Lighthouse results, and stores the information in BigQuery where it is [publicly available](https://discuss.httparchive.org/t/quickstart-guide-to-exploring-the-http-archive/682). |
There was a problem hiding this comment.
sorry, made this conflict
docs/understanding-results.md
Outdated
| | Name | Description | | ||
| | - | - | | ||
| | lighthouseVersion | The version of Lighthouse with which these results were generated. | | ||
| | generatedTime | The ISO timestamp at which the results were generated. | |
There was a problem hiding this comment.
"The ISO-8601 timestamp of when the results were generated", maybe?
docs/understanding-results.md
Outdated
| | userAgent | The user agent string of the version of Chrome that was used by Lighthouse. | | ||
| | initialUrl | The URL that was supplied to Lighthouse and initially navigated to. | | ||
| | url | The URL that Lighthouse ended up auditing after redirects were followed. | | ||
| | score | The overall score `0-100`, a weighted average of all category scores. | |
There was a problem hiding this comment.
right now this is really the PWA category score, which we may have to maintain until LH 3.0 :)
There was a problem hiding this comment.
are you sure?
lighthouse/lighthouse-core/report/v2/report-generator.js
Lines 109 to 110 in 320eb1f
There was a problem hiding this comment.
are you sure?
technically correct that it's a weighted average of all category score, which is the best kind of correct, but it also happens that the weights are 0 except for the PWA category. So, maybe just add a sentence that by default it's currently weighted to only give the PWA score or something?
docs/understanding-results.md
Outdated
| | name | `string` | The string identifier of the audit in kebab case. | | ||
| | category | `string` | No longer used. *WARNING: Deprecated, will be removed in Lighthouse 3.0* | | ||
| | description | `string` | The brief description of the audit's successful state. | | ||
| | failureDescription | `string` | The brief description of the audit's failure state. | |
There was a problem hiding this comment.
this will always be description since failureDescription is copied over when the audit fails
There was a problem hiding this comment.
Oh right, I was coming at it from the audit author perspective too which is confusing to mix here. I'll just remove?
docs/understanding-results.md
Outdated
| | score | <code>boolean|number</code> | The scored value determined by the audit as either boolean or a number `0-100`. If the audit is a boolean, the implication is `score ? 100 : 0`. | | ||
| | rawValue | <code>boolean|number</code> | The unscored value determined by the audit. Typically this will match the score if there's no additional information to impart. For performance audits, this value is typically a number indicating the metric value. | | ||
| | displayValue | `string` | The string to display in the report alongside audit results. If empty, nothing additional is shown. This is typically used to explain additional information such as the number and nature of failing items. | | ||
| | scoringMode | `string` | A string identifying how granular the score is meant to be indicating, i.e. is the audit pass/fail or are there shades of gray 0-100. *NOTE: This does not necessarily mean `typeof audit.score === audit.scoringMode`, an audit can have a score of 40 with a scoringMode of `"binary"` meant to indicate failure.* | |
There was a problem hiding this comment.
mention scoringMode can be binary or numeric?
| | scoringMode | `string` | A string identifying how granular the score is meant to be indicating, i.e. is the audit pass/fail or are there shades of gray 0-100. *NOTE: This does not necessarily mean `typeof audit.score === audit.scoringMode`, an audit can have a score of 40 with a scoringMode of `"binary"` meant to indicate failure.* | | ||
| | details | `Object` | Extra information found by the audit necessary for display. The structure of this object varies from audit to audit. The structure of this object is somewhat stable between minor version bumps as this object is used to render the HTML report. | ||
| | extendedInfo | `Object` | Extra information found by the audit. The structure of this object varies from audit to audit and is generally for programmatic consumption and debugging, though there is typically overlap with `details`. *WARNING: The structure of this object is not stable and cannot be trusted to follow semver* | | ||
|
|
There was a problem hiding this comment.
what about debugString...and less importantly optimalValue, informative, and manual?
There was a problem hiding this comment.
done, though skipping optimalValue since we don't know what it means or that we want it
docs/understanding-results.md
Outdated
| | description | `string` | A brief description of the purpose of the category, supports markdown links. | | ||
| | score | `string` | The overall score of the category, the weighted average of all its audits. | | ||
| | weight | `string` | The weight of the category in the overall Lighthouse score. | | ||
| | audits | `AuditEntry[]` | An array of all the audit results that comprise the category. Each entry contains a copy of the audit's result in the top-level [audits](#audits) object. | |
There was a problem hiding this comment.
should we warn that the result copy is going away?
There was a problem hiding this comment.
s/comprise/compose again (or a different word if that sounds awkward)
docs/understanding-results.md
Outdated
| <a name="report-categories"></a> | ||
| ## `reportCategories` | ||
|
|
||
| An array containing the different categories, their scores, and the results of the audits that comprise them. |
docs/understanding-results.md
Outdated
| | Name | Type | Description | | ||
| | -- | -- | -- | | ||
| | id | `string` | The string identifier of the category. | | ||
| | score | `number` | The numeric score `0-100` of the audit, audits with a boolean score result are converted with `score ? 100 : 0`. | |
paulirish
left a comment
There was a problem hiding this comment.
nice stuff.
some suggestions, but nothing i would block on.
docs/understanding-results.md
Outdated
|
|
||
| The results object contains all the audit information Lighthouse determined about the page. In fact, everything you see in the HTML report, even the screenshots, is a rendering of information contained in the results object. You might need to work directly with the results object if you use [Lighthouse programmatically](https://github.com/GoogleChrome/lighthouse/blob/master/docs/readme.md#using-programmatically), consume the JSON output of the [CLI](https://github.com/GoogleChrome/lighthouse#using-the-node-cli), explore [Lighthouse results in HTTPArchive](https://github.com/GoogleChrome/lighthouse#lighthouse-integrations), or work on the report generation code that reads the Lighthouse JSON and outputs HTML. | ||
|
|
||
| ## Top-level Object |
There was a problem hiding this comment.
can we call this
Lighthouse Result (LHR) object
a unique name makes it a bit easier to discuss
There was a problem hiding this comment.
good call, I knew we had a name for it I was forgetting!
| | -- | -- | -- | | ||
| | name | `string` | The string identifier of the audit in kebab case. | | ||
| | category | `string` | No longer used. *WARNING: Deprecated, will be removed in Lighthouse 3.0* | | ||
| | description | `string` | The brief description of the audit's successful state. | |
There was a problem hiding this comment.
missing failureDescription. see also https://github.com/GoogleChrome/lighthouse/blob/master/docs/architecture.md#auditreport-terminology
There was a problem hiding this comment.
discussed offline, but not needed since failureDescription is just impl detail
docs/understanding-results.md
Outdated
| | description | `string` | The brief description of the audit's successful state. | | ||
| | helpText | `string` | A more detailed description that describes why the audit is important and links to Lighthouse documentation on the audit, markdown links supported. | | ||
| | debugString | <code>string|undefined</code> | A string indicating some additional information to the user explaining an unusual circumstance or reason for failure. | | ||
| | informative | `boolean` | Indicator used for display that the audit is intended to be informative only, not failable. | |
There was a problem hiding this comment.
Indicator used for display that the audit is intended to be informative only. It cannot be passed or failed.
| | displayValue | `string` | The string to display in the report alongside audit results. If empty, nothing additional is shown. This is typically used to explain additional information such as the number and nature of failing items. | | ||
| | scoringMode | <code>"binary"|"numeric"</code> | A string identifying how granular the score is meant to be indicating, i.e. is the audit pass/fail or are there shades of gray 0-100. *NOTE: This does not necessarily mean `typeof audit.score === audit.scoringMode`, an audit can have a score of 40 with a scoringMode of `"binary"` meant to indicate display should be failure.* | | ||
| | details | `Object` | Extra information found by the audit necessary for display. The structure of this object varies from audit to audit. The structure of this object is somewhat stable between minor version bumps as this object is used to render the HTML report. | ||
| | extendedInfo | `Object` | Extra information found by the audit. The structure of this object varies from audit to audit and is generally for programmatic consumption and debugging, though there is typically overlap with `details`. *WARNING: The structure of this object is not stable and cannot be trusted to follow semver* | |
There was a problem hiding this comment.
can you change the order of the properties here?
name
description
helpText
debugString
rawValue
displayValue
score
scoringMode
details
extendedInfo
manual
informative
category
docs/understanding-results.md
Outdated
| <a name="artifacts"></a> | ||
| ## `artifacts` | ||
|
|
||
| An object containing gatherer results keyed by gatherer class name. The structure varies by artifact and is not stable. The values of artifacts are subject to change. This property is only available when consuming Lighthouse results programmatically as the artifacts contain trace data and can be quite large. |
|
a rebase will make the tests green :) |
68a9f94 to
77bafe4
Compare
closes #3336