Zippy Zeppoli
Zippy Zeppoli

Reputation: 6077

web performance testing that renders javascript

I would like to load test pages AND render javascript. It seems there are 3 categories of applications which might solve this problem, and all three miss the mark.

1) Jmeter, apachebench, tsung, Grinder, Iago Why it wont work: It doesn't render javascript. These are handy tools, but they won't work for this purpose.

2) Watir, Selenium These tools are excellent, they use real browsers and render javascript / ajax, but alas, they are designed mostly for functional testing, and not performance testing. You could create your own app to use these things for a load test, but it would be a massive pain in the ass to collect all of the performance metrics and aggregate them.

If only there was a combination of the first two types of web performance tests, that would be great.

The third option, solves this problem, but unfortunately you have to pay for it. 3) Web load testing services Services like Keynote Load Pro, BrowserMob and others are great, and they solve the problem of using real browsers and rendering JavaScript. The only problem is, I don't want to pay $300 ever time I run a damn load test (this is an exaggeration, but not really, depending on how many virtual users you use).

So that option won't work, unless I want to hemorrhage money.

Isn't there a test harness out there that solves this problem? It seems like a big gaping hole where there is a need for an open source tool that no one has solved yet. The commercial companies dominate this space (and those who want to employ a full time developer to write a selenium performance test framework).

Upvotes: 1

Views: 977

Answers (2)

Paras Dahal
Paras Dahal

Reputation: 685

Well you haven't mentioned what metrics you really want to measure. But I think you can test both server side and browser performance using two simple tools.

  1. PhantomJS and HAR file: PhantomJS is a webkit headless browser that has a Javascript API. You can script it using Javascript to do pretty much everything (including javascript rendering). Use it to generate HAR file so that you can analyze performance bottle necks in all the requests.

  2. Navigation Timing API : Modern browsers support navigation timing data which gives you details about timings in browser rendering, including all important metrics like domLoading, domInteractive etc.

Upvotes: 0

Michal Jezierski
Michal Jezierski

Reputation: 69

The good thing about jmeter, ab, tsung, etc. is they can give you aggregated metrics in relatively short time but they can't execute javascript. They can't measure how fast DOM has been created. They won't load external resources such as images, javascripts, styles. They are good for stress-testing which is not the case here.

When measuring web performance you need to know:

  • what do you really want to measure? - domLoading, domInteractive, domContentLoaded or maybe something else from Performance Timing Interface,
  • which statistical measure you want to use? - p95, median. Average is not the best choice.
  • when? - do it always at the same time to make tests comparable,
  • from which location? - the best you can do is to spawn dedicated server located closely to your production,
  • how confident you want to be about the results? - choose sample data size, for example if you accept 3% margin of error with 95% confidence interval then choose 1067.

For doing such Synthetic Performance Measurements you can use https://github.com/msn0/sweter. It measures timeToFirstByte, domInteractive and domComplete timings. It can be scheduled to run tests always at the same time. Sweter can report raw data to ElasticSearch, console, json file or wherever you want.

The different topic is Real User Measurements. There are good tools for that already, e.g. NewRelic.

Upvotes: 1

Related Questions