sitespeedio / sitespeed.io

sitespeed.io is an open-source tool for comprehensive web performance analysis, enabling you to test, monitor, and optimize your website’s speed using real browsers in various environments.
https://www.sitespeed.io/
MIT License
4.76k stars 603 forks source link

HAR Import #1384

Closed madhavajay closed 7 years ago

madhavajay commented 7 years ago

This is really awesome guys! I got everything set up, but I am wondering is there a way I can import existing HAR files into the graphite database, maybe using xray? It would be great since we are using TestArmada and some custom tweaks to do parallel load testing and this dashboard looks nicer than using HAR Storage to do time based comparisons.

Also is parallel load testing something you have considered, also using something like nightwatch to drive more specialised walk through and login etc tests?

soulgalore commented 7 years ago

Hey @madhavajay thank you for the kind words :)

About TestArmada would love to find a way to fit sitespeed.io into that but I haven't had time test it.

I'm not sure with the sending HAR data to Graphite data. With the release going out later today, there's a fix so that all requests can be sent to graphite (but only for the first run). It will not be turned on by default though because it can break Graphite (by overflooding it with data). I'm not 100% sure what you can spot with sending all request data to Graphite? If we can set it up with as little disturbance as possible, metrics SpeedIndex/firstVisualChange and navigation timing metrics should be able to detect a regression. Comparing individual requests I'm not sure how that will work?

Also is parallel load testing something you have considered

No I think the goal for sitespeed is to find front end regressions and best case that will not have something todo with load.

nightwatch to drive more specialised walk through and login etc tests

Tell me what do you wanna do precisely :)

Best Peter

madhavajay commented 7 years ago

I assume that sitespeed retrieves the HAR files from the chrome and firefox browsers in the docker container and then... does "magic" to them and they end up in Graphite? Is it possible to allow that step to be skipped and simply point sitespeed at a har file and have it ship it to graphite?

soulgalore commented 7 years ago

Yes so for Chrome we create the HAR from the event log and for Firefox we use the HAR Export. No you need to actually get the HAR from the browser. What you can do, use PageXray on the HAR and then send the data you want to Graphite (but you need to hack that last thing yourself).

The overall picture looks like this: sitespeed-universe

madhavajay commented 7 years ago

I have my own HAR files generated completely separately from sitespeed.io. Can I use sitespeed.io or the pagexray to ingest them into graphite. Seeing as this is already what is happening with sitespeed.io.

  1. Sitespeed.io runs
  2. Sitespeed.io collects HAR files from its browers
  3. Sitespeed.io magic...
  4. Sitespeed.io HAR data is now in Graphite

Is it possible I can skip steps 1 and 2 and simply do something like:

$ docker-compose run sitespeed.io ./my.har --graphite.host=graphite

ppcuenca commented 7 years ago

This is exactly what I was looking for as a possible solution to multi step or functional performance trending. I think alot of users would find great value in this. I for one wouldn't have to figure out another solution to get this functional performance data :) Or if Peter you can make any suggestions on the direction to go on how we might be able to do this, that would be greatly appreciated as well.

soulgalore commented 7 years ago

@madhavajay no you cannot feed with HARs today. So if you like the JSON you get from PageXray https://github.com/sitespeedio/pagexray you can run your HAR through that and then send the data you want yourself to Graphite. The Graphite implementation is not so complex: https://github.com/sitespeedio/sitespeed.io/tree/master/lib/plugins/graphite

soulgalore commented 7 years ago

@ppcuenca can you explain how you wanna use it? is to know if third party script is slow?

ppcuenca commented 7 years ago

@soulgalore Sitespeed.io already does a fantastic job of static pages with relatively little logic (landing pages, FAQs, informative pages like on the sitespeed.io site) but the other critical aspect as you know are functions (logins, logouts, create documents, etc..) with more business logic.

I can currently capture this information on chrome or firefox .har but I would love to send this data to the same place where the sitespeed metrics live as well to be trended.

I hope this makes it a bit clearer.

soulgalore commented 7 years ago

maybe :) when you have time @ppcuenca it would be super if you could create a new issue where you in detail explain exactly what you need/think is missing and with some examples of metrics you wanna catch, that would really help us out!

soulgalore commented 7 years ago

We will not actively work on this, but we happily accepts PRs :)