Skip to content

Commit

Permalink
Exclude the Highcharts dependency and provide a minimal replacement
Browse files Browse the repository at this point in the history
Relates to #809

Signed-off-by: Alexander Schwartz <[email protected]>
  • Loading branch information
ahus1 authored and ryanemerson committed May 23, 2024
1 parent 07e7182 commit dce7196
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 5 deletions.
9 changes: 7 additions & 2 deletions benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<version>${scala.version}</version>
</dependency>
<dependency>
<groupId>io.gatling.highcharts</groupId>
<artifactId>gatling-charts-highcharts</artifactId>
<groupId>io.gatling</groupId>
<artifactId>gatling-app</artifactId>
<version>${gatling.version}</version>
<exclusions>
<exclusion>
Expand All @@ -41,6 +41,11 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.gatling</groupId>
<artifactId>gatling-recorder</artifactId>
<version>${gatling.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.janino</groupId>
<artifactId>janino</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package org.keycloak.benchmark.gatling.chart;

import io.gatling.charts.component.Component;
import scala.collection.immutable.Seq;
import scala.jdk.javaapi.CollectionConverters;

import java.util.Collections;

/**
* This is a dummy component which will show up as empty in Gatling's HTML report.
* It is a minimal replacement for the Highcharts library which is excluded for licensing restrictions.
* @author Alexander Schwartz
*/
public class ComponentDummy implements Component {
@Override
public String html() {
return "";
}

@Override
public String js() {
return "";
}

@Override
public Seq<String> jsFiles() {
return CollectionConverters.asScala(Collections.<String>emptyIterator()).toSeq();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package org.keycloak.benchmark.gatling.chart;

import io.gatling.charts.component.Component;
import io.gatling.charts.component.ComponentLibrary;
import io.gatling.charts.stats.CountsVsTimePlot;
import io.gatling.charts.stats.IntVsTimePlot;
import io.gatling.charts.stats.PercentVsTimePlot;
import io.gatling.charts.stats.PercentilesVsTimePlot;
import io.gatling.charts.stats.PieSlice;
import io.gatling.charts.stats.Series;
import scala.collection.immutable.Seq;

/**
* This is a dummy component which will show up as empty in Gatling's HTML report.
* It is a minimal replacement for the Highcharts library which is excluded for licensing restrictions.
*
* @author Alexander Schwartz
*/
public class ComponentLibraryDummy implements ComponentLibrary {
@Override
public String getAllUsersJs(long runStart, Series<IntVsTimePlot> series) {
return "";
}

@Override
public Component getActiveSessionsComponent(long runStart, Seq<Series<IntVsTimePlot>> series) {
return new ComponentDummy();
}

@Override
public Component getRangesComponent(String chartTitle, String eventName, boolean large) {
return new ComponentDummy();
}

@Override
public Component getRequestCountPolarComponent() {
return new ComponentDummy();
}

@Override
public Component getDistributionComponent(String title, String yAxisName, Series<PercentVsTimePlot> durationsSuccess, Series<PercentVsTimePlot> durationsFailure) {
return new ComponentDummy();
}

@Override
public Component getPercentilesOverTimeComponent(String yAxisName, long runStart, Series<PercentilesVsTimePlot> successSeries) {
return new ComponentDummy();
}

@Override
public Component getRequestsComponent(long runStart, Series<CountsVsTimePlot> counts, Series<PieSlice> pieSeries) {
return new ComponentDummy();
}

@Override
public Component getResponsesComponent(long runStart, Series<CountsVsTimePlot> counts, Series<PieSlice> pieSeries) {
return new ComponentDummy();
}

@Override
public Component getResponseTimeScatterComponent(Series<IntVsTimePlot> successData, Series<IntVsTimePlot> failuresData) {
return new ComponentDummy();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.keycloak.benchmark.gatling.chart.ComponentLibraryDummy
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
5 changes: 2 additions & 3 deletions doc/benchmark/modules/ROOT/pages/report/standard-report.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ Gatling creates the report automatically at the end of a performance run in the

The report provides information about the overall scenario and the individual steps performed in the run.

NOTE: Due to the licensing restrictions of the Highcharts library, the reports contain only a subset of the widgets you would see when running it with the standard Gatling version.

.Summary of a run with response times
[.shadow]
image::report/gatling-standard-report/overview.png[]

.Summary of response times and requests per seconds
[.shadow]
image::report/gatling-standard-report/response-times-and-requests-per-second.png[]

0 comments on commit dce7196

Please sign in to comment.