sitespeedio - reports - urlAlias in Budget file
Feature/improvement
We use aliases for our urls in a url file. For example https://www.google.com Homepage https://www.google.com/search?q=hello+world Search_Results_Page
and we have a budget.json file with 10 budgets in it.
When we get the output as json we get something like this for an individual URL:
{
"working":{
"https://www.google.com/":[
{
"metric":"Largest Contentful Paint",
"type":"googleWebVitals",
"value":1706,
"friendlyValue":"1.706 s",
"limit":5000,
"friendlyLimit":"5.000 s",
"limitType":"max",
"status":"working"
}
]
}
}
We have over 70 urls we are testing and some of the URLs are quite long. Would it be possible to include the urlAlias into the budget output so it makes it easier for us to read?
Thanks
Shaq
Hi @shaqb yes that should be easy, I added alias support before but I guess then that it's only in the budget HTML, I don't fully remember. I'll check if its easy before the next release sometimes next week.
Looked at the code and the easiest way would be to just use alias (when you have an alias) instead of the URL. That's how it works in the most places today. Would that work for you @shaqb ?
No that was a stupid idea, let me have a look for a better fix :)
Hi @soulgalore - thanks for looking into this so quickly! We currently specify the urlAlias in our tests but they don't filter through to the budget report. We have an over-arching budget file like this:
{
"budget": {
"googleWebVitals": {
"firstContentfulPaint": 1000,
"largestContentfulPaint": 5000,
"totalBlockingTime": 1000,
"cumulativeLayoutShift": 0.1
},
"timings": {
"backEndTime": 500,
"VisualComplete95": 6000
},
"requests": {
"total": 120
},
"transferSize": {
"total": 2500000,
"html": 100000,
"javascript": 1000000,
"image": 1000000
},
"contentSize": {
"total": 4000000,
"html": 300000,
"javascript": 2000000,
"image": 1000000
},
"pageinfo": {
"domElements": 5000
}
}
}
We want that applied to every url that runs from our url file which has the urlAlias in it. That file can have up to 70 urls.
Does that make sense? If not I can send some more examples over to you.
Thanks,
Shahil
I see, so instead on matching on the URL, you need to match on the alias but that do not work at the moment. Let me start with it the coming weekend. As it is now the simplest way is that the matching can happen either by URL or alias, but the result JSON can only she URL or ALIAS. Would that work for you @shaqb ?
Hey @soulgalore - I think so yeah. So just to be clear, if we supply a budget file with a file full of ALIAS it would be great if the budget output json show the ALIAS instead of the URL
Yes then I think I understand :)
Thanks @soulgalore !
This was fixed.