You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CONTRIBUTING.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ We'd love your help! This doc covers how to become a contributor and submit code
4
4
5
5
## Follow the coding style
6
6
7
-
The `.eslintrc` file defines all. We use [JSDoc](http://usejsdoc.org/)along with [closure annotations](https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler). Annotations are encouraged for all contributions.
7
+
The `.eslintrc` file defines all. We use [JSDoc](http://usejsdoc.org/) with [TypeScript](https://github.com/Microsoft/TypeScript/wiki/JSDoc-support-in-JavaScript). Annotations are encouraged for all contributions.
Copy file name to clipboardexpand all lines: docs/architecture.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -84,6 +84,6 @@ Tracing processor takes the output of trace of tab and identifies the top-level
84
84
85
85
## Audits
86
86
87
-
The return value of each audit [takes this shape](https://github.com/GoogleChrome/lighthouse/blob/b354890076f2c077c5460b2fa56ded546cca72ee/lighthouse-core/closure/typedefs/AuditResult.js#L23-L55).
87
+
The return value of each audit [takes this shape](https://github.com/GoogleChrome/lighthouse/blob/8f500e00243e07ef0a80b39334bedcc8ddc8d3d0/typings/audit.d.ts#L117-L130).
88
88
89
89
The `details` object is parsed in report-renderer.js. View other audits for guidance on how to structure `details`.
Copy file name to clipboardexpand all lines: docs/configuration.md
+24-27
Original file line number
Diff line number
Diff line change
@@ -11,20 +11,16 @@ You can specify a custom config file when using Lighthouse through the CLI or co
11
11
**custom-config.js**
12
12
```js
13
13
module.exports= {
14
-
passes: [{
15
-
recordTrace:true,
16
-
pauseAfterLoadMs:5000,
17
-
useThrottling:true,
18
-
gatherers: [],
19
-
}],
20
-
21
-
audits: [
22
-
'first-meaningful-paint',
23
-
'speed-index-metric',
24
-
'estimated-input-latency',
25
-
'first-interactive',
26
-
'consistently-interactive',
27
-
]
14
+
extends:'lighthouse:default',
15
+
settings: {
16
+
onlyAudits: [
17
+
'first-meaningful-paint',
18
+
'speed-index-metric',
19
+
'estimated-input-latency',
20
+
'first-interactive',
21
+
'consistently-interactive',
22
+
],
23
+
},
28
24
};
29
25
```
30
26
@@ -77,6 +73,8 @@ The settings property controls various aspects of running Lighthouse such as CPU
77
73
```
78
74
79
75
#### Options
76
+
For full list see [our default config settings](https://github.com/GoogleChrome/lighthouse/blob/8f500e00243e07ef0a80b39334bedcc8ddc8d3d0/lighthouse-core/config/constants.js#L30-L48).
77
+
80
78
| Name | Type | Description |
81
79
| -- | -- | -- |
82
80
| onlyCategories |`string[]`| Includes only the specified categories in the final report. Additive with `onlyAudits` and reduces the time to audit a page. |
@@ -89,22 +87,21 @@ The passes property controls how to load the requested URL and what information
89
87
90
88
Each `passes` entry defines basic settings such as how long to wait for the page to load and whether to record a trace file. Additionally a list of **gatherers** to use is defined per pass. Gatherers can read information from the page to generate artifacts which are later used by audits to provide you with a Lighthouse report. For more information on implementing a custom gatherer and the role they play in building a Lighthouse report, refer to the [recipes](https://github.com/GoogleChrome/lighthouse/blob/master/docs/recipes/custom-audit). Also note that `artifacts.devtoolsLogs` will be automatically populated for every pass. Gatherers also have access to this data within the `afterPass` as `traceData.devtoolsLog` (However, most will find the higher-level `traceData.networkRecords` more useful).
91
89
90
+
For list of default pass values, see [our config constants](https://github.com/GoogleChrome/lighthouse/blob/8f500e00243e07ef0a80b39334bedcc8ddc8d3d0/lighthouse-core/config/constants.js#L50-L61).
92
91
93
92
#### Example
94
93
```js
95
94
{
96
95
passes: [
97
96
{
98
97
passName:'fastPass',
99
-
recordTrace:true,
100
-
useThrottling:false,
101
-
networkQuietThresholdMs:0,
102
98
gatherers: ['fast-gatherer'],
103
99
},
104
100
{
105
101
passName:'slowPass',
106
102
recordTrace:true,
107
103
useThrottling:true,
104
+
networkQuietThresholdMs:5000,
108
105
gatherers: ['slow-gatherer'],
109
106
}
110
107
]
@@ -141,7 +138,7 @@ The audits property controls which audits to run and include with your Lighthous
141
138
142
139
### `categories: Object|undefined`
143
140
144
-
The categories property controls how to score and organize the audit results in the report. Each category defined in the config will have an entry in the `reportCategories` property of Lighthouse's output. The category output contains the child audit results along with an overall score for the category.
141
+
The categories property controls how to score and organize the audit results in the report. Each category defined in the config will have an entry in the `categories` property of Lighthouse's output. The category output contains the child audit results along with an overall score for the category.
145
142
146
143
**Note:** many modules consuming Lighthouse have no need to group or score all the audit results; in these cases, it's fine to omit a categories section.
147
144
@@ -150,9 +147,9 @@ The categories property controls how to score and organize the audit results in
150
147
{
151
148
categories: {
152
149
performance: {
153
-
name:'Performance',
150
+
title:'Performance',
154
151
description:'This category judges your performance',
Copy file name to clipboardexpand all lines: docs/lantern.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ Stats were collected using the [trace-evaluation](https://github.com/patrickhulc
29
29
We conclude that Lantern is ~6-13% more inaccurate than DevTools throttling. When evaluating rank performance, Lantern achieves correlations within ~.04-.07 of DevTools throttling.
30
30
31
31
* For the single view use case, our original conclusion that Lantern's inaccuracy is roughly equal to the inaccuracy introduced by expected variance seems to hold. The standard deviation of single observations from DevTools throttling is ~9-13%, and given Lantern's much lower variance, single observations from Lantern are not significantly more inaccurate on average than single observations from DevTools throttling.
32
-
* For the repeat view use case, we can conclude that Lantern is systematically off by ~6-13% more than DevTools throttling.
32
+
* For the repeat view use case, we can conclude that Lantern is systematically off by ~6-13% more than DevTools throttling.
33
33
34
34
### Metric Variability Conclusions
35
35
The reference stats demonstrate that there is high degree of variability with the user-centric metrics and strengthens the position that every load is just an observation of a point drawn from a distribution and to understand the entire experience, multiple draws must be taken, i.e. multiple runs are needed to have sufficiently small error bounds on the median load experience.
You can also craft your own config (e.g. [mixed-content-config.js](https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/config/mixed-content-config.js)) for custom runs. Also see the [basic custom audit recipe](https://github.com/GoogleChrome/lighthouse/tree/master/docs/recipes/custom-audit).
48
50
51
+
### Differences from CLI flags
52
+
53
+
Note that some flag functionality is only available to the CLI. The set of shared flags that work in both node and CLI can be found [in our typedefs](https://github.com/GoogleChrome/lighthouse/blob/8f500e00243e07ef0a80b39334bedcc8ddc8d3d0/typings/externs.d.ts#L68). In most cases, the functionality is not offered in the node module simply because it is easier and more flexible to do it yourself.
54
+
55
+
| CLI Flag | Differences in Node |
56
+
| - | - |
57
+
| `port` | Only specifies which port to use, Chrome is not launched for you. |
58
+
| `chromeFlags` | Ignored, Chrome is not launched for you. |
59
+
| `outputPath` | Ignored, output is returned as string in `.report` property. |
60
+
| `saveAssets` | Ignored, artifacts are returned in `.artifacts` property. |
61
+
| `view` | Ignored, use the `opn` npm module if you want this functionality. |
62
+
| `enableErrorReporting` | Ignored, error reporting is always disabled for node. |
63
+
| `listAllAudits` | Ignored, not relevant in programmatic use. |
64
+
| `listTraceCategories` | Ignored, not relevant in programmatic use. |
65
+
| `configPath` | Ignored, pass the config in as the 3rd argument to `lighthouse`. |
66
+
| `preset` | Ignored, pass the config in as the 3rd argument to `lighthouse`. |
67
+
| `verbose` | Ignored, use `logLevel` instead. |
68
+
| `quiet` | Ignored, use `logLevel` instead. |
49
69
50
70
### Turn on logging
51
71
@@ -56,7 +76,7 @@ the `logLevel` flag when calling `lighthouse`.
*Screenshot of the [scoring spreadsheet](https://docs.google.com/spreadsheets/d/1Cxzhy5ecqJCucdf1M0iOzM8mIxNc7mmx107o5nj38Eo/edit#gid=0)*
8
8
9
-
Note 2: if you receive a **score of 0** in any Lighthouse category, that usually indicates an error on our part. Please file an [issue](https://github.com/GoogleChrome/lighthouse/issues) so our team can look into it.
9
+
Note 2: receiving a **score of ?** in any Lighthouse categoryindicates an error occurred. Please file an [issue](https://github.com/GoogleChrome/lighthouse/issues) so our team can look into it.
10
10
11
11
# Performance
12
12
@@ -30,11 +30,12 @@ The performance score is determined from the **performance metrics only**. The O
30
30
31
31
The metric results are not weighted equally. Currently the weights are:
32
32
33
-
* 5X - first meaningful paint
34
-
* 5X - first interactive
33
+
* 3X - first contentful paint
34
+
* 1X - first meaningful paint
35
+
* 3X - first cpu idle
35
36
* 5X - consistently interactive
36
-
*1X - perceptual speed index
37
-
*1X - estimated input latency
37
+
*4X - speed index
38
+
*0X - estimated input latency
38
39
39
40
These weights are heuristics, and the Lighthouse team is working on formalizing the weighting system through more field data.
40
41
@@ -47,7 +48,7 @@ Once we finish computing the percentile equivalent of your raw performance score
47
48
- Green (good): 75-100.
48
49
49
50
### What can developers do to improve their performance score?
50
-
*Note: we've built [a little calculator](https://docs.google.com/spreadsheets/d/1dXH-bXX3gxqqpD1f7rp6ImSOhobsT1gn_GQ2fGZp8UU/edit?ts=59fb61d2#gid=283330180) that can help you understand what thresholds you should be aiming for achieving a certain Lighthouse performance score. *
51
+
*Note: we've built [a little calculator](https://docs.google.com/spreadsheets/d/1Cxzhy5ecqJCucdf1M0iOzM8mIxNc7mmx107o5nj38Eo/edit#gid=283330180) that can help you understand what thresholds you should be aiming for achieving a certain Lighthouse performance score. *
51
52
52
53
Lighthouse has a whole section in the report on improving your performance score under the “Opportunities” section. There are detailed suggestions and documentation that explains the different suggestions and how to implement them. Additionally, the diagnostics section lists additional guidance that developers can explore to further experiment and tweak with their performance.
Copy file name to clipboardexpand all lines: docs/throttling.md
+3-2
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,12 @@ This is the standard recommendation for 3G throttling:
7
7
- Throughput: 1.6Mbps down / 750 Kbps up.
8
8
- Packet loss: none.
9
9
10
-
These exact figures are used as the [WebPageTest "Mobile 3G - Fast" preset](https://github.com/WPO-Foundation/webpagetest/blob/master/www/settings/connectivity.ini.sample) and [Lighthouse's throttling default](https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/lib/emulation.js).
10
+
These exact figures are used as the [WebPageTest "Mobile 3G - Fast" preset](https://github.com/WPO-Foundation/webpagetest/blob/master/www/settings/connectivity.ini.sample) and [Lighthouse's throttling default](https://github.com/GoogleChrome/lighthouse/blob/8f500e00243e07ef0a80b39334bedcc8ddc8d3d0/lighthouse-core/config/constants.js#L19-L26).
11
11
12
12
## Throttling basics
13
13
14
-
1. The DevTools network throttling, which Lighthouse uses, is implemented within Chrome at the _request-level_. As a result, it has some downsides that are now summarized in this doc: [Network Throttling & Chrome - status](https://docs.google.com/document/d/1TwWLaLAfnBfbk5_ZzpGXegPapCIfyzT4MWuZgspKUAQ/edit). The TLDR: while it's a [decent approximation](https://docs.google.com/document/d/1uS9SH1KpVH31JAmf-iIZ61VazwAF9MrCVwETshBC4UQ/edit), it's not a sufficient model of a slow connection. The [multipliers used in Lighthouse](https://github.com/GoogleChrome/lighthouse/blob/3be483287a530fb560c843b7299ef9cfe91ce1cc/lighthouse-core/lib/emulation.js#L33-L39) attempt to correct for the differences.
14
+
1. Simulated throttling, which Lighthouse uses by default, is computed throttling _after a trace has been recorded_ which makes it very fast and deterministic. However, due to the imperfect nature of predicting alternate execution paths, there is inherent inaccuracy that is summarized in this doc: [Lighthouse Metric Variability and Accuracy](https://docs.google.com/document/d/1BqtL-nG53rxWOI5RO0pItSRPowZVnYJ_gBEQCJ5EeUE/edit). The TLDR: while it's roughly as accurate or better than DevTools throttling for most sites, it suffers from edge cases and a deep investigation to performance should use _Packet-level_ throttling tools.
15
+
1. The DevTools network throttling, which Lighthouse uses for `throttlingMethod='devtools'`, is implemented within Chrome at the _request-level_. As a result, it has some downsides that are now summarized in this doc: [Network Throttling & Chrome - status](https://docs.google.com/document/d/1TwWLaLAfnBfbk5_ZzpGXegPapCIfyzT4MWuZgspKUAQ/edit). The TLDR: while it's a [decent approximation](https://docs.google.com/document/d/1uS9SH1KpVH31JAmf-iIZ61VazwAF9MrCVwETshBC4UQ/edit), it's not a sufficient model of a slow connection. The [multipliers used in Lighthouse](https://github.com/GoogleChrome/lighthouse/blob/3be483287a530fb560c843b7299ef9cfe91ce1cc/lighthouse-core/lib/emulation.js#L33-L39) attempt to correct for the differences.
15
16
1._Proxy-level_ throttling tools do not affect UDP data, so they're not recommended.
16
17
1._Packet-level_ throttling tools are able to make the most accurate network simulation.
0 commit comments