Skip to content

Instantly share code, notes, and snippets.

@arijitMondal
Created August 26, 2020 03:53
Show Gist options
  • Save arijitMondal/62831ea28df9b67094e0319efb5fa1c0 to your computer and use it in GitHub Desktop.
Save arijitMondal/62831ea28df9b67094e0319efb5fa1c0 to your computer and use it in GitHub Desktop.
function instertDataToSheet(deviceInfo, deviceType){
sheet.appendRow([
// GMT+8:00 is for singapore
Utilities.formatDate(new Date(), "GMT+8:00", "yyyy-MM-dd'T'HH:mm:ss"),
deviceType,
deviceInfo.lighthouseResult.categories.performance.score * 100,
deviceInfo.lighthouseResult.audits['first-contentful-paint'].numericValue,
deviceInfo.lighthouseResult.audits['largest-contentful-paint'].numericValue,
deviceInfo.lighthouseResult.audits['cumulative-layout-shift'].numericValue,
deviceInfo.lighthouseResult.audits['interactive'].numericValue,
deviceInfo.lighthouseResult.audits['total-blocking-time'].numericValue,
deviceInfo.lighthouseResult.audits['speed-index'].numericValue,
]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment