(sources)
| 154 | }); |
| 155 | } |
| 156 | async run(sources) { |
| 157 | /* |
| 158 | setup - plugins chance to talk to each other or setup what they need. |
| 159 | url - urls passed around to analyse |
| 160 | summarize - all analyse is finished and we can summarize all data |
| 161 | prepareToRender - prepare evertything to render, send messages after things been summarized etc |
| 162 | render - plugin store data to disk |
| 163 | final - is there anything you wanna do before sitespeed exist? upload files to the S3? |
| 164 | */ |
| 165 | return this.startProcessingQueues() |
| 166 | .then(() => this.postMessage(make('sitespeedio.setup'))) |
| 167 | .then(() => this.drainAllQueues()) |
| 168 | .then(async () => { |
| 169 | for (let source of sources) { |
| 170 | await source.findUrls(this, this.options); |
| 171 | } |
| 172 | }) |
| 173 | .then(() => this.drainAllQueues()) |
| 174 | .then(() => this.postMessage(make('sitespeedio.summarize'))) |
| 175 | .then(() => this.drainAllQueues()) |
| 176 | .then(() => this.postMessage(make('sitespeedio.prepareToRender'))) |
| 177 | .then(() => this.drainAllQueues()) |
| 178 | .then(() => this.postMessage(make('sitespeedio.render'))) |
| 179 | .then(() => this.drainAllQueues()) |
| 180 | .then(() => { |
| 181 | if (this.options.queueStats) { |
| 182 | log.info(JSON.stringify(generateStatistics(), undefined, 2)); |
| 183 | } |
| 184 | return { |
| 185 | errors: this.errors, |
| 186 | browsertime: this.browsertimePageSummaries, |
| 187 | browsertimeHAR: this.browsertimeHAR |
| 188 | }; |
| 189 | }); |
| 190 | } |
| 191 | |
| 192 | postMessage(message) { |
| 193 | validateMessageFormat(message); |
no test coverage detected