dreamzmaster / gulp-sitespeedio

Test performance budgets and performance best practice rules using sitespeed.io http://www.sitespeed.io
MIT License
37 stars 14 forks source link

Setting up the task #10

Closed custa1200 closed 8 years ago

custa1200 commented 8 years ago

I have created a gulp task as per the following:

gulp.task('sitespeedio', function() {
    sitespeedio({
        url: 'http://localhost/',
        deepth: 5,
        resultBaseDir: './sitespeedio/',
        browser: 'chrome',
        connection: 'cable',
        no: 11,
        headless: 'slimerjs',
        showFailedOnly: false,
        graphiteHost: 'localhost',
        graphitePort: 2003,
        graphiteNamespace: 'sitespeed',
        budget: {
            rules: {
                default: 90
            },
            page: {
                image: 10,
                css: 1,
                requests: 7,
                pageWeight:300000,
                jsWeight: 0
            },

            timings: {
                speedIndex: 1000,
                headerTime: 800,
                logoTime: 500,
                domContentLoadedTime: 900
            }
        }
    })
});

And I have set up a graphite server using Docker using that port but when I run the task it just completes in a short amount of time with no results. Is there something I am doing incorrectly?

dreamzmaster commented 8 years ago

@custa1200 are you getting the results in? resultBaseDir: './sitespeedio/',

jobetdelima commented 8 years ago

Hello,

I'm running into a similar issue. My gulp task is even simpler as I'm trying things out for the first time. See below:

gulp.task('sitespeedio', function () { sitespeedio({ urls:['http://localhost:8080'], browser: 'chrome', connection: 'cable', resultBaseDir: './speed/' }) });

I get something like this as output: 14:44:05] Starting 'sitespeedio'... [14:44:05] Finished 'sitespeedio' after 913 μs

But is not really getting results. I'm not seeing that 'speed' folder get created. Manually adding that folder still does not make results show up in it.

Thanks!

jobetdelima commented 8 years ago

Re-wrote the gulp task like below and it worked :)

gulp.task('speed-test', sitespeedio({ urls: ['http://127.0.0.1/8080'], resultBaseDir: 'test-results', browser: 'chrome', connection: 'desktop', html: true, budget: { gpsi: { score: 96 } } }));

acierto commented 8 years ago

That's actually due to not waiting when gulp task will be finished, that's what I missed in the documentation. That's why I created the doc issue and PR for that. Hope that it will help for others! :)