Main Thread Script Evaluation
This report lists URLs and the corresponding time taken for evaluating scripts on the main thread. The main thread script evaluation time measures the duration spent by the browser to execute JavaScript code during page load.
Priority: None
Impact: Neutral
How to fetch the data for this report template​
You will need to run a crawl for report template to generate report. When report has been generated and you have crawl id you can fetch data for the report using the following query:
- Query
- Variables
- cURL
query GetReportForCrawl($crawlId: ObjectID!, $reportTemplateCode: String!) {
getCrawl(id: $crawlId) {
reportsByCode(
input: {
reportTypeCodes: Basic
reportTemplateCodes: [$reportTemplateCode]
}
) {
rows {
nodes {
... on CrawlSiteSpeedAuditItems {
opportunityDigest
element
url
wastedSecs
pageviews
productOfWastedSecsAndPageviews
auditResult
}
}
}
}
}
}
{"crawlId":"TjAwNUNyYXdsNDAwMA","reportTemplateCode":"mainthread_script_evaluation_items"}
curl -X POST -H "Content-Type: application/json" -H "apollographql-client-name: docs-example-client" -H "apollographql-client-version: 1.0.0" -H "x-auth-token: YOUR_API_SESSION_TOKEN" --data '{"query":"query GetReportForCrawl($crawlId: ObjectID!, $reportTemplateCode: String!) { getCrawl(id: $crawlId) { reportsByCode( input: { reportTypeCodes: Basic reportTemplateCodes: [$reportTemplateCode] } ) { rows { nodes { ... on CrawlSiteSpeedAuditItems { opportunityDigest element url wastedSecs pageviews productOfWastedSecsAndPageviews auditResult } } } } } }","variables":{"crawlId":"TjAwNUNyYXdsNDAwMA","reportTemplateCode":"mainthread_script_evaluation_items"}}' https://api.lumar.io/graphql