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.
@@ -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" ]
} ]
} ]
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:output method="xml" version="1.0" encoding="UTF-8" indent="yes" xalan:indent-amount="4" standalone="no"/>
<xsl:strip-space elements="*"/> <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']"> <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"/> <socket-binding name="modcluster" interface="private" port="0" multicast-address="${{jboss.default.multicast.address:230.0.0.4}}" multicast-port="23364"/>
</xsl:template> </xsl:template>
Expand Down
154 changes: 100 additions & 54 deletions testsuite/integration-arquillian/servers/auth-server/jboss/pom.xml
Expand Up @@ -406,60 +406,60 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId> <artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version> <version>1.8</version>
<executions> <executions>
<execution> <execution>
<id>inject-truststore-into-keycloak-server-json</id> <id>inject-truststore-into-keycloak-server-json</id>
<phase>process-resources</phase> <phase>process-resources</phase>
<goals> <goals>
<goal>run</goal> <goal>run</goal>
</goals> </goals>
<configuration> <configuration>
<target> <target>
<ant antfile="../build-truststore.xml" inheritRefs="true"> <ant antfile="../build-truststore.xml" inheritRefs="true">
<target name="inject-truststore"/> <target name="inject-truststore"/>
</ant> </ant>
</target> </target>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>ant-contrib</groupId> <groupId>ant-contrib</groupId>
<artifactId>ant-contrib</artifactId> <artifactId>ant-contrib</artifactId>
<version>1.0b3</version> <version>1.0b3</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>ant</groupId> <groupId>ant</groupId>
<artifactId>ant</artifactId> <artifactId>ant</artifactId>
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.ant</groupId> <groupId>org.apache.ant</groupId>
<artifactId>ant-apache-bsf</artifactId> <artifactId>ant-apache-bsf</artifactId>
<version>1.9.3</version> <version>1.9.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.bsf</groupId> <groupId>org.apache.bsf</groupId>
<artifactId>bsf-api</artifactId> <artifactId>bsf-api</artifactId>
<version>3.1</version> <version>3.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>rhino</groupId> <groupId>rhino</groupId>
<artifactId>js</artifactId> <artifactId>js</artifactId>
<version>1.7R2</version> <version>1.7R2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.keycloak</groupId> <groupId>org.keycloak</groupId>
<artifactId>keycloak-core</artifactId> <artifactId>keycloak-core</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
</plugin> </plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>
</build> </build>
Expand Down Expand Up @@ -615,6 +615,12 @@
<session.cache.owners>1</session.cache.owners> <session.cache.owners>1</session.cache.owners>
<offline.session.cache.owners>1</offline.session.cache.owners> <offline.session.cache.owners>1</offline.session.cache.owners>
<login.failure.cache.owners>1</login.failure.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> </properties>
<build> <build>
<pluginManagement> <pluginManagement>
Expand Down Expand Up @@ -701,6 +707,12 @@
</includes> </includes>
<stylesheet>${common.resources}/mod_cluster.xsl</stylesheet> <stylesheet>${common.resources}/mod_cluster.xsl</stylesheet>
<outputDir>${auth.server.home}/standalone/configuration</outputDir> <outputDir>${auth.server.home}/standalone/configuration</outputDir>
<parameters>
<parameter>
<name>load.metric</name>
<value>${load.metric}</value>
</parameter>
</parameters>
</transformationSet> </transformationSet>
</transformationSets> </transformationSets>
</configuration> </configuration>
Expand All @@ -711,6 +723,40 @@
</pluginManagement> </pluginManagement>
</build> </build>
</profile> </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> <profile>
<id>auth-server-wildfly</id> <id>auth-server-wildfly</id>
Expand Down
Expand Up @@ -51,6 +51,7 @@ public static void pause(long millis) {
Thread.sleep(millis); Thread.sleep(millis);
} catch (InterruptedException ex) { } catch (InterruptedException ex) {
Logger.getLogger(WaitUtils.class.getName()).log(Level.SEVERE, null, ex); Logger.getLogger(WaitUtils.class.getName()).log(Level.SEVERE, null, ex);
Thread.currentThread().interrupt();
} }
} }


Expand Down
@@ -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.


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


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


</project> </project>

This file was deleted.

@@ -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;
}

}

0 comments on commit ef95510

Please sign in to comment.