sitespeed.io icon indicating copy to clipboard operation
sitespeed.io copied to clipboard

sitespeedio - reports - urlAlias in Budget file

Open shaqb opened this issue 3 years ago • 8 comments

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

shaqb avatar Feb 18 '22 13:02 shaqb

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.

soulgalore avatar Feb 18 '22 14:02 soulgalore

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 ?

soulgalore avatar Feb 19 '22 13:02 soulgalore

No that was a stupid idea, let me have a look for a better fix :)

soulgalore avatar Feb 19 '22 13:02 soulgalore

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

shaqb avatar Feb 21 '22 06:02 shaqb

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 ?

soulgalore avatar Feb 24 '22 20:02 soulgalore

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

shaqb avatar Feb 24 '22 21:02 shaqb

Yes then I think I understand :)

soulgalore avatar Feb 24 '22 22:02 soulgalore

Thanks @soulgalore !

shaqb avatar Feb 25 '22 14:02 shaqb

This was fixed.

soulgalore avatar Dec 29 '23 06:12 soulgalore