macbre / phantomas

Headless Chromium-based web performance metrics collector and monitoring tool
https://www.npmjs.com/package/phantomas
BSD 2-Clause "Simplified" License
2.25k stars 141 forks source link

Improve timeouts handling #380

Closed ghost closed 9 years ago

ghost commented 10 years ago

I have a few company sites I am running this on and all are fine except for one where the first command line response is "phantomas: (252) Timeout". The difference with this site compared to the others is that it's an api driven site (json, js framework, client-side templates, etc.). Unfortunately I can't post a url but here are the results. Any ideas about what is causing the timeout would be great appreciated.

$ phantomas http://xxxxxx.com phantomas: (252) Timeout phantomas v1.5.0 metrics for http://xxxxxx.com/:

Offenders for gzipRequests (6):

Offenders for postRequests (1):

Offenders for ajaxRequests (10):

Offenders for htmlCount (5):

Offenders for cssCount (2):

Offenders for jsCount (8):

Offenders for jsonCount (1):

Offenders for imageCount (1):

Offenders for cachingNotSpecified (1):

Offenders for cachingTooShort (10):

Offenders for oldCachingHeaders (10):

Offenders for domainsWithCookies (1):

Offenders for domains (2):

Offenders for DOMqueriesByClassName (20):

Offenders for DOMqueriesByTagName (18):

Offenders for DOMinserts (5):

Offenders for DOMqueriesDuplicated (12):

Offenders for eventsBound (11):

Offenders for globalVariables (15):

Offenders for headersBiggerThanContent (1):

Offenders for jsErrors (5):

Offenders for assetsNotGzipped (10):

Offenders for assetsWithCookies (1):

Offenders for smallImages (1):

Offenders for timeToFirstCss (431):

Offenders for timeToFirstJs (398):

Offenders for timeToFirstImage (1013):

Offenders for smallestResponse (215):

Offenders for biggestResponse (414235):

Offenders for fastestResponse (113):

Offenders for slowestResponse (2560):

Offenders for smallestLatency (109):

Offenders for biggestLatency (2549):

macbre commented 10 years ago

Thanks for the report, @devilmike

Did you try running phantomas in verbose mode (--verbose)? It should give you the list of requests phantomas was waiting for to complete when it timed out.

ghost commented 10 years ago

Ran it in verbose mode and the only time out I see is:

Timeout of 1000 sec was reached! Event timeout emitted Timeout: gave up waiting for 5 HTTP response(s): http://xxxxxx.com/rwd/views/header.ejs, http://xxxxxx.com/rwd/views/catlist.ejs, http://xxxxxx.com/rwd/views/nav.ejs, http://xxxxxx.com/rwd/views/tos.ejs, http://xxxxxx.com/rwd/views/pers.ejs Event report emitted Event metric emitted

These files are being loaded via ajax and are loading in browser.

macbre commented 10 years ago

It's pretty hard to debug this issue with an access to the page, but let's try the following - please run phantomas with --debug --verbose flags, paste the output into pastebin or gist and provide the link.

ghost commented 10 years ago

http://pastebin.com/mndsPu1s

Heidistein commented 9 years ago

I appear to have the same issue on here: https://www.transavia.com/de-DE/startseite

when changing URL to this it works: https://www.transavia.com/de-DE/startseite/

tufandevrim commented 9 years ago

I have the same issue. I especially get this frequently when I run multiple tests with --run option. Ideally phantomas should not exit with "phantomas: (252) Timeout" and should return available metrics with appropriate status code like: partially complete for run array item in the runs object. stats should not include the the failed or partially completed tests

macbre commented 9 years ago

I think the best option here would be to simply skip the failed tests (when in multiple runs mode) and only include the successful ones in the stats. @tufandevrim, sounds fine?

tufandevrim commented 9 years ago

yes it would be perfect.