lighthouse-ci icon indicating copy to clipboard operation
lighthouse-ci copied to clipboard

Multiple levels for a single metric

Open MrFlashAccount opened this issue 4 years ago • 2 comments

Hello! You've made a great instrument! Thank you!

Is there any way to configure multiple levels for a single metric? I want to configure metric to warn at one threshold, and fail at another.

e.g:

 'largest-contentful-paint': ['error', { maxNumericValue: 3000 }],
 'largest-contentful-paint': ['warn', { maxNumericValue: 2000 }],

MrFlashAccount avatar Jan 28 '21 11:01 MrFlashAccount

Thanks for filing @MrFlashAccount!

There is not a way to do this currently without two separate configs (the example you provide would be invalid due to duplicate keys). If we were to support this I think we'd pursue something like

'largest-contentful-paint': [
  ['error', {maxNumericValue: 3000}],
  ['warn', {maxNumericValue: 2000}],
]

patrickhulce avatar Jan 28 '21 14:01 patrickhulce

Yes, I know about duplication, I wrote this example only to explain myself with code :) Thank you for your answer!

MrFlashAccount avatar Jan 28 '21 14:01 MrFlashAccount