Skip to content
Miguel Rodriguez edited this page Mar 5, 2016 · 21 revisions

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.

# Running Crystal

Cristal has 2 user interfaces:

1 - crystal-backoffice

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

2 - crystal

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.

3 - Alfresco

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"

4 - Firefox, Chrome and Selenium

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.

5 - Disable your CSRF Token Filter in share

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>

6 - Jenkins

To run a test via Jenkins go to http://localhost:6080. Then click on alfresco-jtests

Alfresco Project

Now click on Configure

Configure Test

Populate all parameters according to your installation.

Configure Test and Save changes

Save the changes and click on Build with Parameters

Ready to run the test

We are now ready to run the test. Double check the parameters are correct and click on Build

Start the test

The test will start running, to check on progress click on the build number i.e.

Select build number

Then click on Console Output to monitor test progress

Console Output

7 - Running DB test plan

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.

JDBC Connections details

Next enter the path to the results.sql file.

Path to SQL file

Finally start the test and monitor the progress.

Statements being executed

You can always increase the load by increasing the number of concurrent threads.

Increasing the load