Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions config/reportgenerator.properties
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ com.xceptance.xlt.reportgenerator.charts.height = 300

#com.xceptance.xlt.reportgenerator.charts.cappingMode = always

## The percentage of values taken when calculating the moving average series.
com.xceptance.xlt.reportgenerator.charts.movingAverage.percentageOfValues = 5
## The percentage of values taken when calculating the moving average series
## (default: 5.0).
com.xceptance.xlt.reportgenerator.charts.movingAverage.percentageOfValues = 5.0

## Whether dynamic/interactive charts are enabled in addition to the regular
## WEBP image charts (default: true).
Expand Down
4 changes: 2 additions & 2 deletions doc/internal-doc/api.sig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Signature file v4.1
#Version 9.2.0-SNAPSHOT
#Version 9.2.2

CLSS public abstract com.xceptance.xlt.api.actions.AbstractAction
cons protected init(com.xceptance.xlt.api.actions.AbstractAction,java.lang.String)
Expand Down Expand Up @@ -1666,9 +1666,9 @@ meth public boolean wantsDataRecords()

CLSS public abstract interface com.xceptance.xlt.api.report.ReportProviderConfiguration
meth public abstract boolean shouldChartsGenerated()
meth public abstract double getMovingAveragePercentage()
meth public abstract int getChartHeight()
meth public abstract int getChartWidth()
meth public abstract int getMovingAveragePercentage()
meth public abstract java.io.File getChartDirectory()
meth public abstract java.io.File getCsvDirectory()
meth public abstract java.io.File getReportDirectory()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public interface ReportProviderConfiguration
*
* @return the percentage
*/
public int getMovingAveragePercentage();
public double getMovingAveragePercentage();

/**
* Returns all the settings from the file "xlt/config/reportgenerator.properties" as raw properties. Use these
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public enum ChartCappingMode

private final File homeDirectory;

private final int movingAveragePoints;
private final double movingAveragePoints;

private final List<String> outputFileNames;

Expand Down Expand Up @@ -491,7 +491,7 @@ public ReportGeneratorConfiguration(Properties xltProperties, final File overrid
chartsCompressionFactor = (float) getDoubleProperty(PROP_CHARTS_COMPRESSION_FACTOR, 0.0f);
chartsWidth = getIntProperty(PROP_CHARTS_WIDTH, 900);
chartsHeight = getIntProperty(PROP_CHARTS_HEIGHT, 300);
movingAveragePoints = getIntProperty(PROP_CHARTS_MOV_AVG_PERCENTAGE, 5);
movingAveragePoints = getDoubleProperty(PROP_CHARTS_MOV_AVG_PERCENTAGE, 5.0);

dynamicChartsEnabled = getBooleanProperty(PROP_DYNAMIC_CHARTS_ENABLED, true);

Expand Down Expand Up @@ -767,7 +767,7 @@ public File getHomeDirectory()
* {@inheritDoc}
*/
@Override
public int getMovingAveragePercentage()
public double getMovingAveragePercentage()
{
return movingAveragePoints;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public abstract class AbstractDataProcessor

private File csvDir;

private int movingAveragePercentage;
private double movingAveragePercentage;

private ChartCappingInfo chartCappingInfo;

Expand Down Expand Up @@ -140,7 +140,7 @@ public long getEndTime()
*
* @return the value of movingAveragePercentage
*/
public int getMovingAveragePercentage()
public double getMovingAveragePercentage()
{
return movingAveragePercentage;
}
Expand Down Expand Up @@ -248,7 +248,7 @@ public void setCsvDir(final File csvDir)
* @param movingAveragePercentage
* the new movingAveragePercentage value
*/
public void setMovingAveragePercentage(final int movingAveragePercentage)
public void setMovingAveragePercentage(final double movingAveragePercentage)
{
this.movingAveragePercentage = movingAveragePercentage;
}
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/com/xceptance/xlt/report/util/JFreeChartUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,14 @@ public int size()
*/
public enum MoreColors
{
BROWN(0xB97A57),
GRAY(0xAAAAAA),
GREEN(0x00AA00),
LIGHT_GRAY(0x757575),
LIGHT_GREEN(0xB5E61D),
LILAC(0xC8BFE7),
ORANGE(0xFF9900),
STEEL_BLUE(0x7092BE);
BROWN(0xB97A57),
GRAY(0xAAAAAA),
GREEN(0x00AA00),
LIGHT_GRAY(0x757575),
LIGHT_GREEN(0xB5E61D),
LILAC(0xC8BFE7),
ORANGE(0xFF9900),
STEEL_BLUE(0x7092BE);

private final Color color;

Expand Down Expand Up @@ -672,7 +672,7 @@ public static XYPlot createHistogramPlot(final XYIntervalSeries histogramSeries,
*/
public static JFreeChart createLineChart(final String chartTitle, final String rangeAxisTitle, final TimeSeries series,
final long startTime, final long endTime, final boolean includeMovingAverage,
final int percentage)
final double percentage)
{
return createLineChart(chartTitle, rangeAxisTitle, series, startTime, endTime, includeMovingAverage, percentage, true);
}
Expand Down Expand Up @@ -700,7 +700,7 @@ public static JFreeChart createLineChart(final String chartTitle, final String r
*/
public static JFreeChart createLineChart(final String chartTitle, final String rangeAxisTitle, final TimeSeries series,
final long startTime, final long endTime, final boolean includeMovingAverage,
final int percentage, final boolean showDots)
final double percentage, final boolean showDots)
{
final TimeSeries movingAverageSeries = includeMovingAverage ? createMovingAverageTimeSeries(series, percentage) : null;

Expand Down Expand Up @@ -934,10 +934,10 @@ public static XYLineAndShapeRenderer createLineRenderer(final Color color)
* the percentaged amount of values for building the moving average
* @return the time series
*/
public static TimeSeries createMovingAverageTimeSeries(final TimeSeries series, final int percentage)
public static TimeSeries createMovingAverageTimeSeries(final TimeSeries series, final double percentage)
{
// take the last X percent of the values
final int samples = Math.max(2, series.getItemCount() * percentage / 100);
final int samples = Math.max(2, (int) (series.getItemCount() * percentage / 100.0));

// derive the name from the source series
final String avgSeriesName = series.getKey() + " (Moving Average)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public File getCsvDirectory()
}

@Override
public int getMovingAveragePercentage()
public double getMovingAveragePercentage()
{
return 0;
}
Expand Down