rhusar/clusterbench — pull request #1 by Karm (2011-12-13 16:37:43+00:00)
Title: AverageSystemLoadServlet

I suggest this approach as a prototype for the other load metrics as well. Simple servtlet + stateful session bean.

This simple servlet is used for stressing the server's CPU.

Usage
=====
You may GET e.g. this URL:
```http://localhost:8080/clusterbench/averagesystemload?milliseconds=20000&threads=4```
By doing so, there will be 4 threads with evil active-loops created. These threads will be running for 20000 milliseconds.
There are two responses you can receive:

* If there are no active load runners at the moment:
```LoadRunner #0 has been created.
LoadRunner #1 has been created.
LoadRunner #2 has been created.
LoadRunner #3 has been created.
```

* If there are active runners (CPU is being stressed at the moment):
```INFO:There are still 4 active runners that have been running for 700 milliseconds.```

That's it. No more functionality is needed for a simple CPU stressing.