pwmetrics icon indicating copy to clipboard operation
pwmetrics copied to clipboard

Extend API data returned in by pwmetrics

Open denar90 opened this issue 5 years ago • 1 comments

After starting PWMertrics run, users are able to get data adapted and retrieved from Lighthouse. What if users might need to process expectations vs real results? Should we extend API with returned data included expectations mixed with real metrics values?

denar90 avatar Aug 31 '18 19:08 denar90

I've asked on twitter and couple people were interested. Other than that I think it will be handy to handle expectation erros manyally, probably stop CI process (since we don't throw exeption if expectations failed) or do smth other.

So I propose to extend object with result data and have smth like this:

'runs': [
    {
      'timings': [
        {
          'title': 'First Contentful Paint',
          'id': 'firstContentfulPaint',
          'timing': 3389,
          'color': 'green',
          'expectations': { // might be empty if not specified
            'timings': {
              'warn': '>=1500',
              'error': '>=2000'
            },
            'result': {
              'warn': true,
              'error': false,
            }
          }
        },
....

denar90 avatar Sep 08 '18 19:09 denar90