Skip to content

Commit

Permalink
Updates to the performance tests.
Browse files Browse the repository at this point in the history
Conflicts:
	testsuite/integration-arquillian/tests/other/adapters/jboss/remote/pom.xml
	testsuite/integration-arquillian/tests/other/clean-start/pom.xml
  • Loading branch information
tkyjovsk committed Jun 1, 2016
1 parent 2343e51 commit ef95510
Show file tree
Hide file tree
Showing 34 changed files with 815 additions and 536 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[ {
"realm" : "master",
"users" : [ {
"username" : "admin",
"enabled" : true,
"credentials" : [ {
"type" : "password",
"hashedSaltedValue" : "dqalJHLkWhUJZO/q6+z1fvXOohTcGCXcvoU8xCEyvTxGN4wmLx7DtyhKuefggh6Bkx1I2eBTEX4tiWggwyXMDw==",
"salt" : "3fBAt5GAGGxFrV9fznpZHQ==",
"hashIterations" : 100000,
"algorithm" : "pbkdf2"
} ],
"realmRoles" : [ "admin" ]
} ]
} ]
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,26 @@

<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" xalan:indent-amount="4" standalone="no"/>
<xsl:strip-space elements="*"/>

<!--add socket binding-->

<xsl:param name="load.metric" select="'simple'" />\

<!-- mod-cluster-config -->
<xsl:template match="//*[local-name()='mod-cluster-config']">
<mod-cluster-config advertise-socket="modcluster" connector="ajp">
<xsl:choose>
<xsl:when test="$load.metric='simple'">
<simple-load-provider factor="1"/>
</xsl:when>
<xsl:otherwise>
<dynamic-load-provider>
<load-metric type="{$load.metric}"/>
</dynamic-load-provider>
</xsl:otherwise>
</xsl:choose>
</mod-cluster-config>
</xsl:template>

<!--add socket-binding-->
<xsl:template match="//*[local-name()='socket-binding-group' and @name='standard-sockets']/*[local-name()='socket-binding' and @name='modcluster']">
<socket-binding name="modcluster" interface="private" port="0" multicast-address="${{jboss.default.multicast.address:230.0.0.4}}" multicast-port="23364"/>
</xsl:template>
Expand Down
154 changes: 100 additions & 54 deletions testsuite/integration-arquillian/servers/auth-server/jboss/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -406,60 +406,60 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>inject-truststore-into-keycloak-server-json</id>
<phase>process-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<ant antfile="../build-truststore.xml" inheritRefs="true">
<target name="inject-truststore"/>
</ant>
</target>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>ant-contrib</groupId>
<artifactId>ant-contrib</artifactId>
<version>1.0b3</version>
<exclusions>
<exclusion>
<groupId>ant</groupId>
<artifactId>ant</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-apache-bsf</artifactId>
<version>1.9.3</version>
</dependency>
<dependency>
<groupId>org.apache.bsf</groupId>
<artifactId>bsf-api</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>rhino</groupId>
<artifactId>js</artifactId>
<version>1.7R2</version>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-core</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>inject-truststore-into-keycloak-server-json</id>
<phase>process-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<ant antfile="../build-truststore.xml" inheritRefs="true">
<target name="inject-truststore"/>
</ant>
</target>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>ant-contrib</groupId>
<artifactId>ant-contrib</artifactId>
<version>1.0b3</version>
<exclusions>
<exclusion>
<groupId>ant</groupId>
<artifactId>ant</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-apache-bsf</artifactId>
<version>1.9.3</version>
</dependency>
<dependency>
<groupId>org.apache.bsf</groupId>
<artifactId>bsf-api</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>rhino</groupId>
<artifactId>js</artifactId>
<version>1.7R2</version>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-core</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down Expand Up @@ -615,6 +615,12 @@
<session.cache.owners>1</session.cache.owners>
<offline.session.cache.owners>1</offline.session.cache.owners>
<login.failure.cache.owners>1</login.failure.cache.owners>

<load.metric>simple</load.metric>
<!-- The default value 'simple' configures mod-cluster with simple-load-provider.
Any other value configures it with dynamic-load-provider using the particular `load.metric`.
Supported metrics: https://docs.jboss.org/mod_cluster/1.2.0/html/java.AS7config.html#LoadMetric -->

</properties>
<build>
<pluginManagement>
Expand Down Expand Up @@ -701,6 +707,12 @@
</includes>
<stylesheet>${common.resources}/mod_cluster.xsl</stylesheet>
<outputDir>${auth.server.home}/standalone/configuration</outputDir>
<parameters>
<parameter>
<name>load.metric</name>
<value>${load.metric}</value>
</parameter>
</parameters>
</transformationSet>
</transformationSets>
</configuration>
Expand All @@ -711,6 +723,40 @@
</pluginManagement>
</build>
</profile>

<profile>
<id>admin</id>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-keycloak-add-user-json</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${auth.server.home}/standalone/configuration</outputDirectory>
<resources>
<resource>
<directory>${common.resources}</directory>
<includes>
<include>keycloak-add-user.json</include>
</includes>
</resource>
</resources>
<overwrite>true</overwrite>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>

<profile>
<id>auth-server-wildfly</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public static void pause(long millis) {
Thread.sleep(millis);
} catch (InterruptedException ex) {
Logger.getLogger(WaitUtils.class.getName()).log(Level.SEVERE, null, ex);
Thread.currentThread().interrupt();
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,65 @@
#
# Keycloak Adapter Tests - JBoss Remote

## Performance Tests

### Parameters

* Warmup phase
- `warmup.load` Load during warmup phase (# of clients).
- `warmup.duration` Duration of warmup phase in seconds.
* Measuremet iterations
- `initial.load` Load for the initial measurement iteration (# of clients).
- `load.increase` How many clients to add after each iteration.
- `load.increase.rate` How many clients to add per second.
- `measurement.duration` Duration of measurement iteration (in seconds).
* Limits
- `max.iterations`
- `max.threads`
* Other
- `sleep.between.loops` Sleep period between scenario loops.

### Generated Load

Warmup phase and measurement iterations with load-increase phases in between.

load

^
│ /
│ _________/
│ /| |
│ / | |
│ _________/ | |
│ /| | | |
│ / | | | |
│ _________/ | | | |
│ /│ | | | | |
│ / | | | | | |
│ _________/ | | | | | |
│ /| | | | | | | |
│ ____________/ | | | | | | | |
│ /| | | | | | | | | |
│/ | | | | | | | | | |
└──|────────────|─|─────────|──|─────────|──|─────────|──|─────────|───────> time

<--warmup--> <--it.1-> <--it.2-> <--it.3-> <--it.4->


### Login-Logout Test Scenario

#### Collected Statistics

- ACCESS_REQUEST_TIME
- LOGIN_REQUEST_TIME
- LOGIN_VERIFY_REQUEST_TIME
- LOGOUT_REQUEST_TIME
- LOGOUT_VERIFY_REQUEST_TIME

#### Parameters

* Limits
- `max.login.time.average` Maximum accepted average value of LOGIN_REQUEST_TIME.
- `max.logout.time.average` Maximum accepted average value of LOGOUT_REQUEST_TIME.
- `max.timeout.percentage` Maximum accepted timeout percentage for all statistics.

Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.2</version>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -157,7 +162,7 @@
<warmup.load>1</warmup.load>
<warmup.duration>10</warmup.duration>
<max.iterations>0</max.iterations>
<sleep.between.repeats>30</sleep.between.repeats>
<sleep.between.loops>30</sleep.between.loops>
</systemPropertyVariables>
</configuration>
</plugin>
Expand All @@ -166,4 +171,4 @@
</profile>
</profiles>

</project>
</project>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package org.keycloak.testsuite.performance;

/**
*
* @author tkyjovsk
*/
public class LoginLogoutTestParameters {

// Statistics
public static final String ACCESS_REQUEST_TIME = "ACCESS_REQUEST";
public static final String LOGIN_REQUEST_TIME = "LOGIN_REQUEST";
public static final String LOGIN_VERIFY_REQUEST_TIME = "LOGIN_VERIFY_REQUEST";
public static final String LOGOUT_REQUEST_TIME = "LOGOUT_REQUEST";
public static final String LOGOUT_VERIFY_REQUEST_TIME = "LOGOUT_VERIFY_REQUEST";

// Limits
public static final Integer MAX_LOGIN_TIME_AVERAGE = Integer.parseInt(System.getProperty("max.login.time.average", "500"));
public static final Integer MAX_LOGOUT_TIME_AVERAGE = Integer.parseInt(System.getProperty("max.logout.time.average", "500"));
public static final double MAX_TIMEOUT_PERCENTAGE = Double.parseDouble(System.getProperty("max.timeout.percentage", "0"));

// Other
public static final Integer PASSWORD_HASH_ITERATIONS = Integer.parseInt(System.getProperty("password.hash.iterations", "1"));

public static boolean isMeasurementWithinLimits(PerformanceMeasurement measurement) {
return isTimeoutPercentageWithinLimits(measurement)
&& measurement.getStatistics().get(LOGIN_REQUEST_TIME).getAverage() < MAX_LOGIN_TIME_AVERAGE
&& measurement.getStatistics().get(LOGOUT_REQUEST_TIME).getAverage() < MAX_LOGOUT_TIME_AVERAGE;
}

public static boolean isTimeoutPercentageWithinLimits(PerformanceMeasurement measurement) {
boolean withinLimits = true;
for (String statistic : measurement.getStatistics().keySet()) {
withinLimits = withinLimits && measurement.getTimeoutPercentage(statistic) <= MAX_TIMEOUT_PERCENTAGE;
}
return withinLimits;
}

}
Loading

0 comments on commit ef95510

Please sign in to comment.