JavaScript Rules


Web Metrics Framework

Recently Google Web Metrics report came across and inspired by my co-worker Stoyan Stefanov’s WTF - Web Testing Framework I decided to build my own ruleset for YSlow using these metrics to check how good or bad pages are compared to Top and All Sites averages.

Last edition of O’Reilly Velocity Conference, Stoyan demonstrated how easy is to build your own YSlow ruleset and following his post and source code I was able to make it. This first release of this extension of extension of extension features:

  • Google Web Metrics from 2010-05-26
  • Top and All Sites metrics rulesets
  • Use percentile to score when available
  • Use SSH metrics for HTTPS pages

Screenshot: Web Metrics Framework for YSlow for Firebug for Firefox



After installing this extension you will see 2 new rulesets in the YSlow rulesets drop down list:

  1. Web Metrics Framework - Top Sites
  2. Web Metrics Framework - All Sites

Choose one of these rulesets and click Run Test button. The current page will be evaluated using the Google web metrics data.


The metrics provided by Google on its article are mainly averages with some percentiles and SSL data. YSlow rules need a lint function that evaluates an input returning a score from 0 to 100 which is later used to give the F to A score system using weights.
Since not all metrics have percentiles I had to compare the page metrics with the average multiplied by a magic number (4) to create a range from 0 to 4 * average (if any statistic savvy here has comments on it please help me out to find a better way to evaluate) which is good enough to have an outcome where being in the average deserves a C. Perhaps Google releases new reports in future updates with all metrics percentiles, this extension could benefit from those numbers and become more accurate.
If the page being checked is secure (HTTPS), the SSL data available on the report is used instead. The weighting distribution was given by:

  1. Every metric starts with 1
  2. Metrics with percentile get 1 more
  3. Metrics directly related to wire traffic payload or number of requests also get 1 more

Again: statistics savvy, help me improving this extension with your valuable feedback


Although these metrics aren’t 100% accurate (see Caveats section on Google’s article) it’s a good resource to compare your site with a sample of several billion pages crawled by Googlebot. Have fun!

WARNING: Like JSLint, Web Metrics Framework might hurt your feelings :-)

DISCLAIMER: This extension is not related with Google Inc. or Yahoo! Inc.

Disclaimer: Any viewpoints and opinions expressed herein are those of the authors and do not, in any way, reflect those of Twitter, Yahoo! or anyone else.