Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commands for Coach and Browsertime #339

Open
leem32 opened this issue Aug 4, 2019 · 4 comments
Open

Commands for Coach and Browsertime #339

leem32 opened this issue Aug 4, 2019 · 4 comments

Comments

@leem32
Copy link

leem32 commented Aug 4, 2019

I've had a good read of the docs, but I'm still not certain on something.

I would like to use Coach to get all the advice and best practice recommendations in JSON format. And I would also like to use Browsertime to take a screenshot of the webpage and possibly take a video of the web page load.

I don't need to use the dashboard/grafana and I don't need any UI stuff. I only need the above data.

I'm on a Linux server.
The requests for this information would be from a user request.
What commands would I need to run to get the Coach data and Browsertime data?
What I mean is, do I need 2 separate commands? One command for Coach and a second for Browsertime?

Also because the commands will be from user requests, do you think I'd be better off with using docker to install and run Coach/Browsertime or installing with NodeJS. and running from a script.

Thanks

@soulgalore
Copy link
Member

Hi @leem32 I would run sitespeed.io directly and then cherry pick the data you need. Either you can use the analysis storer plugin, it will store all the JSONs from different tools per run, so then you will have a JSON file with all Browsertime data and Coach. Or you can write your own sitespeed.io plugin that take the metrics you need. All data that is collected from different plugins is passed around in a message queue, so you can write your plugin to listen to browsertime and coach data.

Or you can use Browsertime directly in NodeJS and feed it with Coach scripts to Browsertime as we do in sitespeed.io: https://github.com/sitespeedio/sitespeed.io/blob/master/lib/plugins/browsertime/analyzer.js#L34-L39

I would run Docker. A couple of years ago I built a user frontend see https://github.com/sitespeedio/run.sitespeed.io that you can use for inspiration. And there are others that also built the same, the important thing is to have a good queue.

Hope that helps!
Best
Peter

@leem32 leem32 changed the title Coomands for Coach and Browsertime Commands for Coach and Browsertime Aug 4, 2019
@leem32
Copy link
Author

leem32 commented Aug 5, 2019

OK, thanks, I'm going to spend some time refamiliarising myself with NodeJS as I haven't used it for a while and then I'll give your suggestions a try.

Quick question. If I use docker then I'd need to call Docker run with every user request?

Also, does the Lighthouse plugin give the data with advice and recommendations or just the score for each category like in the screenshot on the Lighthouse plugin page?

EDIT: Just found https://www.sitespeed.io/sitespeed.io-7.5/ and can see the lighthouse plugin does give the recommendations.

Thanks

@soulgalore
Copy link
Member

Quick question. If I use docker then I'd need to call Docker run with every user request?

Yes.

just the score for each category like in the screenshot on the Lighthouse plugin page?

You can get the full JSON from Lighthouse and cherry-pick what you need if you want.

@leem32
Copy link
Author

leem32 commented Aug 5, 2019

In that case, I guess I'd have to call docker from a NodeJS script. If it's from a user request I would want to sanitize and filter the input before I make the Docker request to sitespeed.io.

Thanks for your help :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants