The rise of the software-as-a-service paradigm has led to the development
of a new breed of sophisticated, interactive applications
often called Web 2.0. While web applications have become larger
and more complex, web application developers today have little
visibility into the end-to-end behavior of their systems. This paper
presents AjaxScope, a dynamic instrumentation platform that
enables cross-user monitoring and just-in-time control of web application
behavior on end-user desktops. AjaxScope is a proxy
that performs on-the-fly parsing and instrumentation of JavaScript
code as it is sent to users’ browsers. AjaxScope provides facilities
for distributed and adaptive instrumentation in order to reduce
the client-side overhead, while giving fine-grained visibility into
the code-level behavior of web applications. We present a variety
of policies demonstrating the power of AjaxScope, ranging from
simple error reporting and performance profiling to more complex
memory leak detection and optimization analyses. We also apply
our prototype to analyze the behavior of over 90 Web 2.0 applications
and sites that use large amounts of JavaScript.