How to use the webpagetest.defaultServer function in webpagetest

To help you get started, we’ve selected a few webpagetest examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sitespeedio / sitespeed.io / lib / plugins / webpagetest / index.js View on Github external
];

function addCustomMetric(result, filterRegistry) {
  const customMetrics = get(result, 'data.median.firstView.custom');
  if (customMetrics) {
    for (const customMetric of customMetrics) {
      filterRegistry.addFilterForType(
        'data.median.*.' + customMetric,
        'webpagetest.pageSummary'
      );
    }
  }
}

const defaultConfig = {
  host: WebPageTest.defaultServer,
  location: 'Dulles:Chrome',
  connectivity: 'Cable',
  runs: 3,
  pollResults: 10,
  timeout: 600,
  includeRepeatView: false,
  private: true,
  aftRenderingTime: true,
  video: true,
  timeline: false
};

function isPublicWptHost(address) {
  const host = /^(https?:\/\/)?([^/]*)/i.exec(address);
  return host && host[2] === urlParser.parse(WebPageTest.defaultServer).host;
}
github sitespeedio / sitespeed.io / lib / plugins / webpagetest / index.js View on Github external
function isPublicWptHost(address) {
  const host = /^(https?:\/\/)?([^/]*)/i.exec(address);
  return host && host[2] === urlParser.parse(WebPageTest.defaultServer).host;
}

webpagetest

WebPageTest API wrapper for NodeJS

MIT
Latest version published 20 days ago

Package Health Score

75 / 100
Full package analysis