Performance TestingCurrent performance testing is done in an ad-hoc fashion meaning that servers are deployed and loaded with data to see how the system is working. There exists a perf test environment where a server is running a long time and gets data from spawned agents running the perf test plugin. While this is a good simulation of the real world, it still has the issue that it is not easy to measure effects of changes to the code base of RHQ. The following areas need to be tested (separately):
Key points:
Pre-population of databaseThere are several possible ways of doing this
From this comparison 4) looks like the most promising approach: Table driven setupNote: This has been reworked to use Entity Driven Database Setup but the principle still stays the same. Data for agents, plugins, resource types, resources are taken from CSV files that are created from a dump of an existing setup. Then the test setup reads those files, created the appropriate resources. Within a loop additional resources of the same type can be created in order to simulate more resources e.g. in a clustered environment. The test execution first does a DBsetup in a clean state and then reads the csv files to populate the database. One trick needs to be applied though, as the references to other objects are kept using foreign key ids and those are most likely to change while importing, translation tables need to be created which then keep track of the original ID and the new one, thus allowing to link the correct objects together. If it is desired to set up more resources than from the original database dump, the "Setup DB data" step can repeat reading Agents and Resources files as the translation tables will keep track of the correct wiring. This way it is possible to create scenarios with multiple agents -- see also "Parallel Tests". Of course agent names and resource uuids need to be changed on the fly too. Parallel TestsTestNG which we are using allows to run tests in parallel. This way it is possible to e.g. simulate multiple agents sending measurement data or availability reports. This parallel execution can be used in multiple scenarios:
Server subsystemsPerformance testing server subsystems allows to test all subsystems that can be unit tested. Test code can send data in parallel threads to simulate situations with multiple agents. HA Failover stress testingFor this to take place, we need at least two servers and multiple agents. Here we could use the perf env. Agents need to be modified to switch servers every x seconds. Also agent spawning needs to be set up to ramp up spawning new agents so that for a given number of agents the test can run for a given duration of e.g. 5 minutes and then the next batch of agents (e.g. 10 at a time) are spawned until the maximum number is reached. If more computers are available, it may make sense to set up scenarios with the help of SmartFrog, like the JBossAS performance guys are doing. Agent server communication testingThere are already agent server comm unit tests. Performance tests can follow those and
Tests need to be equipped to fail at some given durations - e.g. "it may at most take 1s for an availability report to be acknowledged" Agent stress testingAgent stress testing basically consists of two parts:
For the latter one would write plugins that e.g.
UI Load testingstart one browser per thread and have them using a separate user account to do the click streams through the application. If possible, one can also set up multiple agents here, so that each simulated user gets "its agent" and can even trigger write operations like modifying schedules on resources of "its agent". What can be (automatically) testedTODO
|
