Type in any any request below, or pick one up from the list of samples. All these requests map to controller/action implemented within TestServer.

In order to implement a page that uses our TestServer, we had to set its filter to the form of data/*/*, so that it does not activate when the request is for Index.html. To that end, each request for TestServer sent from this page is prepended with data/. Because of this a request from such page cannot demonstrate how SimpleRouter can handle prefix segments. You can only see how prefix segments are handled by debugging TestServer, and sending it direct requests from the browser.

This test uses a time-out loop to issue asynchronous Ajax requests to get the current date/time from TestServer, and produce the basic statistics.

Below is the list of performance figures ordered by their relevance during the test:


Calls per second: 

Total number of calls made:
Average call delay in milliseconds:
Text returned from the request:

Each transaction in this test consists of the following steps:

  1. A new time-out is set using function setTimeout, according to parameter Calls per second
  2. When the time-out is reached, we take start reading of the current time and issue the Ajax request.
    • Request data/simple/time gets the current time from the TestServer, where data/ is a filter segment to prevent calling HttpFilter when opening page Index.html
    • We append current time to each request to guarantee that each request is sent out, i.e. none cached by the browser.
    • Nothing else happens during the asynchronous request, which on a local PC takes at least 99.9% of the whole transaction time.
  3. Once the Ajax call is complete, we take the current time reading and calculate the average, plus the total.
  4. We set up another setTimeout to continue the loop.

This demo application was designed to accompany article Basic Routing for HttpHandler. It offers a simple example of using class SimpleRouter through even simpler TestServer.

The demo was built with help of jQuery 1.7.2 and jQuery UI 1.8.20

Thank you for checking out this demo ;)

And if you have any questions, please publish them in the Comments section of the article.

Regards,
Vitaly Tomilov
vitaly.tomilov@gmail.com