Class AverageSystemLoadServlet
- java.lang.Object
-
- jakarta.servlet.GenericServlet
-
- jakarta.servlet.http.HttpServlet
-
- org.jboss.test.clusterbench.web.load.AverageSystemLoadServlet
-
- All Implemented Interfaces:
jakarta.servlet.Servlet,jakarta.servlet.ServletConfig,Serializable
@WebServlet(name="AverageSystemLoadServlet", urlPatterns="/averagesystemload") public class AverageSystemLoadServlet extends jakarta.servlet.http.HttpServletAverageSystemLoadServlet 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.
After the aforementioned time, you shall receive a response saying something like:
DONE, I was stressing CPU with 4 evil threads for 20000 milliseconds (including warm-up).
NOTE: Do not forget to set some reasonable time-out on your client... That's it. No more functionality.
- Author:
- Michal Babacek
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AverageSystemLoadServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)StringgetServletInfo()-
Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, init, service, service
-
-
-
-
Method Detail
-
doGet
protected void doGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException, IOException- Overrides:
doGetin classjakarta.servlet.http.HttpServlet- Throws:
jakarta.servlet.ServletExceptionIOException
-
getServletInfo
public String getServletInfo()
- Specified by:
getServletInfoin interfacejakarta.servlet.Servlet- Overrides:
getServletInfoin classjakarta.servlet.GenericServlet
-
-