MCPcopy Create free account
hub / github.com/sitespeedio/sitespeed.io / run

Method run

lib/core/queueHandler.js:156–190  ·  view source on GitHub ↗
(sources)

Source from the content-addressed store, hash-verified

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);

Callers 15

runFunction · 0.95
preWarmServerFunction · 0.80
extraProfileRunFunction · 0.80
analyzeUrlFunction · 0.80
iFunction · 0.80
XaFunction · 0.80
iFunction · 0.80
XaFunction · 0.80
iFunction · 0.80
kbFunction · 0.80
iFunction · 0.80
XaFunction · 0.80

Calls 5

startProcessingQueuesMethod · 0.95
postMessageMethod · 0.95
drainAllQueuesMethod · 0.95
generateStatisticsFunction · 0.90
makeFunction · 0.85

Tested by

no test coverage detected