@s-ui/web-performance-metrics

1.11.0 • Public • Published

## sui-web-performance-metrics

Library for extracing performance metrics.

This library exports a set of types in order to be used for creating the object you need pass to the method with the checks you want to perform.

How to use

const { getWebPerformanceMetrics, types } = require('@s-ui/web-performance-metrics')
const { NETWORK_CONDITIONS, JOURNEY_ACTIONS, VIEWPORTS } = types

const checkSuite = {
  extraHeaders: {
    headerName: 'Header String Value'
  },
  networkCondition: NETWORK_CONDITIONS.GOOD_3G,
  viewport: VIEWPORTS.MOBILE,
  hardLoadUrls: [
    'https://google.es',
    'https://google.com',
    'https://google.co.uk'
  ],
  funnelJourney: {
    steps: [
      [JOURNEY_ACTIONS.GO_TO, 'https://www.google.com'],
      [JOURNEY_ACTIONS.WAIT_FOR, '#lst-ib'],
      [JOURNEY_ACTIONS.FOCUS, '#lst-ib'],
      [JOURNEY_ACTIONS.TYPE, 'Barcelona'],
      [JOURNEY_ACTIONS.CLICK, '.jsb input:first-child'],
      [JOURNEY_ACTIONS.WAIT_FOR, '#rso'],
      [JOURNEY_ACTIONS.CLICK, 'a[ping]']
    ]
  }
}

const { hardLoadUrls, funnelJourney: funnelJourneyResults } = await getWebPerformanceMetrics({
  checkSuite,
  googlePageSpeedApiKey: GOOGLE_PAGESPEED_API_KEY
}).catch(handleError)

Parameters

checkSuite {Object} An object with all the information of the check that you want to perform. extraHeaders {Object} An object containing additional http headers to be sent with every request. All header values must be strings. networkCondition {Object} Object with all the info of the network condition to be used while navigating. viewport {Object} Object with all the info about the viewport of the browser to be used while navigating. hardLoadUrls {Array} Urls to check using hardload strategy. funnelJourney {Object} steps `{Array} An list of steps to perform while navigating the page.

Response

The method returns a Promise that, when resolved returns an object with two keys hardLoadUrls and funnelJourney. Each one has all the results and metrics of each test.

Readme

Keywords

none

Package Sidebar

Install

npm i @s-ui/web-performance-metrics

Weekly Downloads

1

Version

1.11.0

License

ISC

Unpacked Size

20.2 kB

Total Files

11

Last publish

Collaborators

  • victoria.pasichnyk.ext
  • daniel.perez.ext
  • albert.peiro
  • frandelacasa-adevinta
  • mariapaula.forero.ext
  • hpintos_adevinta
  • sziauberyte
  • victor.perez.adevinta
  • oscar-raig-adevinta
  • carlos.gonzalezl
  • carolina.mallo.ext
  • david.nieto
  • ferran.simon
  • xavi_conejo
  • sergi.quintela
  • jamile.radloff
  • xavi_ballestar
  • luz_adv
  • ignacio.rodriguez
  • carlosvillu-adevinta
  • diegomr
  • arturo.vicente
  • adria.velardos
  • emiliovz
  • dann41
  • ruben-martin
  • pol.valls
  • cristina.rodriguez.duque
  • sergio.escano
  • marc.benito
  • azahara
  • patricio.sartore
  • giovanny.sayas.ext
  • david.cuadrado.ext
  • alex.castells
  • beatrizip
  • pablo.rey-adevinta
  • sergiocollado
  • mango.sanchezredondo
  • cristhianb
  • alisa_bayanova
  • davidmartin2108
  • ferrangbtw
  • estefania_garcia
  • belen.santos
  • alfredo.arronte
  • joanleon-adv
  • giodelabarrera.adevinta
  • luis-garrido
  • aitor.rodriguez
  • jordi.munoz
  • oscar_ramirez
  • ignacio_navarro
  • a.ferrer
  • gfabregoadv
  • izeller
  • salvador.juan
  • oriol.egea
  • ivanmlaborda
  • alejandro.ferrante
  • pa.chruscinski.ext
  • isabelgomez87
  • jenifer.lopez
  • daniela.aguilera
  • pablogs
  • javier.miguel
  • oscar.gomez
  • marian.lucaci
  • alverd004
  • oriol.puig
  • nacho_torrella
  • xavi.murcia
  • chloe.leteinturier
  • javiauso
  • alfredo.zimperz
  • francisco.ruiz.lloret
  • fermin.adevinta
  • andresadv
  • schibstedspain