-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Welcome to the crystal wiki!
Pre-Requirements
- Maven - Jdk 8
Those are the only pre-requirements to be able to run and compile crystal, you only need to define your alfresco node or load-balancer as the target for crystal.
Cristal has 2 user interfaces:
A Jenkins instance pre-configured with Jmeter plugins) where you can issue or schedule the execution of the performance-tests. Crystal backoffice is configured to run on port 6080.
To start the backoffice application # ./startCrystalBo.sh
The main front-end is a business intelligence application based on the Pentaho BA Server (v6.0.1-386).
To start the server simply run ./startCrystalBi.sh
.
You can check the log trail executing tailf ./Dependencies/biserver-ce/tomcat/logs/catalina.out
.
Please remember that the Pentaho BA Server requires 4Gb of RAM for its execution.
The Pentaho BA Server is available at port 9090 (http://localhost:9090/pentaho
).
After the server has been started you can access to the Crystal dashboards using the URL http://localhost:9090/crystal
.
To stop the server you can simply execute ./stopCrystalBi.sh
from a terminal.
To sucessfully run your tests you need to have the rmi server hostname specified on your catalina OPTS. This is because jmeter relies on RMI communication with alfresco to extract the mbeans jmx information. See example below.
CATALINA_OPTS="${CATALINA_OPTS} -Djava.rmi.server.hostname=<your_alfresco_hostname_or_ip> -Xms3G -Xmx3G -XX:MaxPermSize=512m -Dcom.sun.management.jmxremote"
Depending on your browser version of Firefox (or chrome) you may need to update your selenium-driver. Currently Crystal ships with the latest version of the firefox driver 2.48.2 that is suitable for Firefox 43.0.3. If you need to update your selenium driver, simply replace the jar file (selenium-firefox-driver-2.48.2.jar) with a newer version. This file is located under dependecies/jmeter/lib.
Some of the Jmeter requests can be wrongly seen as attacks by share CSRFPolicy Filter. Before running the share automation tests make sure you disable the CSRF Token Filter on your share-config-custom.xml.
<config evaluator="string-compare" condition="CSRFPolicy" replace="true">
<filter/>
</config>
To run a test via Jenkins go to http://localhost:6080
. Then click on alfresco-jtests
Now click on Configure
Populate all parameters according to your installation.
Save the changes and click on Build with Parameters
We are now ready to run the test. Double check the parameters are correct and click on Build
The test will start running, to check on progress click on the build number i.e.
Then click on Console Output
to monitor test progress
Alfresco heavily depends on the underlying database engine. This test is collecting the most common queries sent by Alfresco to the database (only select statements). We achieve that by parsing the query log. The goal is to build a stress test that uses a thread group to stress the target database using the parsed queries.
The first thing to do is to enable the query logs on your Alfresco installation and redirect their output into a specific file that will be parsed.
Activiti queries logger
log4j.logger.org.activiti.engine.impl.persistence.entity=debug,sqlTestAppender log4j.additivity.org.activiti.engine.impl.persistence.entity=false
log4j.logger.alfresco.lock=debug,sqlTestAppender log4j.additivity.alfresco.lock=false log4j.logger.alfresco.solr=debug,sqlTestAppender log4j.additivity.alfresco.solr=false log4j.logger.alfresco.permissions=debug,sqlTestAppender log4j.additivity.alfresco.permissions=false log4j.logger.alfresco.node=debug,sqlTestAppender log4j.additivity.alfresco.node=false log4j.logger.alfresco.activities=debug,sqlTestAppender log4j.additivity.alfresco.activities=false
log4j.appender.sqlTestAppender=org.apache.log4j.DailyRollingFileAppender log4j.appender.sqlTestAppender.datePattern='-'dd'.log' log4j.appender.sqlTestAppender.File=log/sqlExtracts.log log4j.appender.sqlTestAppender.layout=org.apache.log4j.PatternLayout log4j.appender.sqlTestAppender.layout.ConversionPattern=%-6r %d{ISO8601} %-5p %40.40c %x - %m\n
The next step is to generate many database queries by running multiple tests i.e. crystal CMIS and Share tests.
Once we have the query logs (referring to your alfresco installation and your specific use cases) we use the parsing utility script to extract only the queries we are interested in (removing the insert, update and delete queries)
./parse.sh sqlqueries.log > results.sql
We now have a file containing just "select" statements. We can now use a jmeter test plan that can consumes those queries and send them directly to the database.
First copy the jdbc jar file for your database type to Dependencies/jmeter/lib folder. Then run jmeter from Dependencies/jmeter/bin
folder i.e. ./jmeter.sh
Open the test plan named alfresco-db-test-plan.jmx
. Configure the JDBC connection by entering the details of our Alfresco database i.e.
Next enter the path to the results.sql
file.
Finally start the test and monitor the progress.
You can always increase the load by increasing the number of concurrent threads.