1.11.0 • Published 5 years ago

@s-ui/web-performance-metrics v1.11.0

Weekly downloads
28
License
ISC
Repository
-
Last release
5 years ago

## 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.

1.11.0

5 years ago

1.10.0

5 years ago

1.9.0

5 years ago

1.8.0

6 years ago

1.7.0

6 years ago

1.6.0

6 years ago

1.5.0

6 years ago

1.4.0-beta.2

6 years ago

1.4.0-beta.1

6 years ago

1.4.0-beta.0

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

1.0.0-beta.0

6 years ago