Package org.ow2.clif.analyze.lib.report
Class Chart
- java.lang.Object
-
- org.ow2.clif.analyze.lib.report.Chart
-
public class Chart extends java.lang.Object- Author:
- Tomas Perez Segovia, Bruno Dillenseger
-
-
Constructor Summary
Constructors Constructor Description Chart(java.lang.String title, Section.ChartRepresentation representation)Chart(Section section, java.lang.String title, Section.ChartRepresentation representation)Chart(Section section, java.lang.String title, Section.ChartRepresentation representation, long startTime, long endTime, int numberOfSlices, int quantilesNumber)Chart(Section section, java.lang.String title, Section.ChartRepresentation representation, long startTime, long endTime, int numberOfSlices, int quantilesNumber, org.jfree.chart.JFreeChart jfChart)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChartDataValues(java.util.List<ChartDataValues> values)voidclearChartDataValues()java.lang.Stringdump()java.lang.StringexportToHtml(int tabsMem, java.io.File directory, java.lang.String sectionName, Report.imageFormats imageFormat)java.lang.StringexportToTxt(int nbTabs, java.io.File directory, java.lang.String sectionName, Report.imageFormats imageFormat)voidexportToXML(int tabsMem, java.io.File directory, java.lang.String sectionName, Report.imageFormats imageFormat)org.jfree.chart.JFreeChartgenerateGraphics()longgetDefaultEndTime()Gets the default chart ending time, i.e.longgetDefaultStartTime()Gets the default chart starting time, i.e.longgetEndTime()Gets the forced chart ending time.longgetFinalTime()longgetInitialTime()org.jfree.chart.JFreeChartgetJfChart()double[][]getMovingAverages(double initialTime, double[] values, int[] splitTime, int timeWindow, int step)Computes the moving average of values, according to a given time window and progression step.double[][]getMovingMaximum(double initialTime, double[] values, int[] splitTime, int timeWindow, int step)Computes the moving maximum of values, according to a given time window and progression step.double[][]getMovingMedians(double initialTime, double[] values, int[] splitTime, int timeWindow, int step)Computes the moving median of values, according to a given time window and progression step.double[][]getMovingMinimum(double initialTime, double[] values, int[] splitTime, int timeWindow, int step)Computes the moving minimum of values, according to a given time window and progression step.double[][]getMovingStandardDeviations(double initialTime, double[] values, int[] splitTime, int timeWindow, int step)Computes the moving standard deviation of values, according to a given time window and progression step.double[][]getMovingThroughput(double initialTime, int[] splitTime, int timeWindow, int step)Computes the moving throughput of event occurrences, according to a given time window and progression step.intgetNumberOfQuantils()intgetNumberOfSlices()Section.ChartRepresentationgetRepresentation()SectiongetSection()longgetStartTime()Gets the forced chart starting time.java.lang.StringgetTitle()double[]quantiles(int n, double[] values)Get quantilesvoidsetEndTime(long endTime)Forces the chart ending time, or leaves it to its defaultvoidsetJfChart(org.jfree.chart.JFreeChart jfChart)voidsetNumberOfQuantils(int i)voidsetNumberOfSlices(int numberOfSlices)voidsetRepresentation(Section.ChartRepresentation representation)voidsetStartTime(long startTime)Forces the chart starting time, or leaves it to its defaultvoidsetTitle(java.lang.String title)java.lang.StringtoText(double[] vect)
-
-
-
Constructor Detail
-
Chart
public Chart(Section section, java.lang.String title, Section.ChartRepresentation representation, long startTime, long endTime, int numberOfSlices, int quantilesNumber, org.jfree.chart.JFreeChart jfChart)
-
Chart
public Chart(Section section, java.lang.String title, Section.ChartRepresentation representation, long startTime, long endTime, int numberOfSlices, int quantilesNumber)
-
Chart
public Chart(java.lang.String title, Section.ChartRepresentation representation)
-
Chart
public Chart(Section section, java.lang.String title, Section.ChartRepresentation representation)
-
-
Method Detail
-
generateGraphics
public org.jfree.chart.JFreeChart generateGraphics()
-
quantiles
public double[] quantiles(int n, double[] values)Get quantiles- Parameters:
n-values-- Returns:
- array that contains the quantiles
-
getMovingMinimum
public double[][] getMovingMinimum(double initialTime, double[] values, int[] splitTime, int timeWindow, int step)Computes the moving minimum of values, according to a given time window and progression step.- Parameters:
initialTime- starting time (in ms) of the first time stepvalues- array of all values on which moving statistics are computedsplitTime- indexes of starting/ending values for each step. For example, the first value in step i is located at index splitTime[2*i] in the values parameter, and the last one is located at index splitTime[2*i+1].timeWindow- the width (in ms) of the time window over which moving statistics are computedstep- the progression step (in ms) for moving statistics- Returns:
- moving minimum of the given values, as an array of two series of numbers: [0] contains the array of dates (of type int, in ms), defined for each step by the middle date between i*step and i*step + time window [1] contains the array of values minimum over the time window through all steps
-
getMovingMaximum
public double[][] getMovingMaximum(double initialTime, double[] values, int[] splitTime, int timeWindow, int step)Computes the moving maximum of values, according to a given time window and progression step.- Parameters:
initialTime- starting time (in ms) of the first time stepvalues- array of all values on which moving statistics are computedsplitTime- indexes of starting/ending values for each step. For example, the first value in step i is located at index splitTime[2*i] in the values parameter, and the last one is located at index splitTime[2*i+1].timeWindow- the width (in ms) of the time window over which moving statistics are computedstep- the progression step (in ms) for moving statistics- Returns:
- moving maximum of the given values, as an array of two series of numbers: [0] contains the array of dates (of type int, in ms), defined for each step by the middle date between i*step and i*step + time window [1] contains the array of values maximum over the time window through all steps
-
getMovingAverages
public double[][] getMovingAverages(double initialTime, double[] values, int[] splitTime, int timeWindow, int step)Computes the moving average of values, according to a given time window and progression step.- Parameters:
initialTime- starting time (in ms) of the first time stepvalues- array of all values on which moving statistics are computedsplitTime- indexes of starting/ending values for each step. For example, the first value in step i is located at index splitTime[2*i] in the values parameter, and the last one is located at index splitTime[2*i+1].timeWindow- the width (in ms) of the time window over which moving statistics are computedstep- the progression step (in ms) for moving statistics- Returns:
- moving average of the given values, as an array of two series of numbers: [0] contains the array of dates (of type int, in ms), defined for each step by the middle date between i*step and i*step + time window [1] contains the array of values average over the time window through all steps
-
getMovingMedians
public double[][] getMovingMedians(double initialTime, double[] values, int[] splitTime, int timeWindow, int step)Computes the moving median of values, according to a given time window and progression step.- Parameters:
initialTime- starting time (in ms) of the first time stepvalues- array of all values on which moving statistics are computedsplitTime- indexes of starting/ending values for each step. For example, the first value in step i is located at index splitTime[2*i] in the values parameter, and the last one is located at index splitTime[2*i+1].timeWindow- the width (in ms) of the time window over which moving statistics are computedstep- the progression step (in ms) for moving statistics- Returns:
- moving median of the given values, as an array of two series of numbers: [0] contains the array of dates (of type int, in ms), defined for each step by the middle date between i*step and i*step + time window [1] contains the array of values median over the time window through all steps
-
getMovingStandardDeviations
public double[][] getMovingStandardDeviations(double initialTime, double[] values, int[] splitTime, int timeWindow, int step)Computes the moving standard deviation of values, according to a given time window and progression step.- Parameters:
initialTime- starting time (in ms) of the first time stepvalues- array of all values on which moving statistics are computedsplitTime- indexes of starting/ending values for each step. For example, the first value in step i is located at index splitTime[2*i] in the values parameter, and the last one is located at index splitTime[2*i+1].timeWindow- the width (in ms) of the time window over which moving statistics are computedstep- the progression step (in ms) for moving statistics- Returns:
- moving standard deviation of the given values, as an array of two series of numbers: [0] contains the array of dates (of type int, in ms), defined for each step by the middle date between i*step and i*step + time window [1] contains the array of values standard deviation over the time window through all steps
-
getMovingThroughput
public double[][] getMovingThroughput(double initialTime, int[] splitTime, int timeWindow, int step)Computes the moving throughput of event occurrences, according to a given time window and progression step.- Parameters:
initialTime- starting time (in ms) of the first time stepsplitTime- indexes of starting/ending event occurrences for each step. For example, the first occurrence in step i is occurrence number splitTime[2*i], and the last one is occurrence number splitTime[2*i+1].timeWindow- the width (in milliseconds) of the time window over which moving statistics are computedstep- the progression step (in milliseconds) for moving statistics- Returns:
- moving throughput of the given measurements, as an array of two series of numbers: [0] contains the array of dates (of type int, in milliseconds), defined by the middle dates between i*step and i*step + time window [1] contains the array of event throughput over the time window through all steps
-
getJfChart
public org.jfree.chart.JFreeChart getJfChart()
-
setJfChart
public void setJfChart(org.jfree.chart.JFreeChart jfChart)
-
getRepresentation
public Section.ChartRepresentation getRepresentation()
-
setRepresentation
public void setRepresentation(Section.ChartRepresentation representation)
-
addChartDataValues
public void addChartDataValues(java.util.List<ChartDataValues> values)
-
clearChartDataValues
public void clearChartDataValues()
-
getTitle
public java.lang.String getTitle()
-
setTitle
public void setTitle(java.lang.String title)
-
getStartTime
public long getStartTime()
Gets the forced chart starting time.- Returns:
- -1 if there is no forced starting time, or the forced chart starting time in ms.
-
setStartTime
public void setStartTime(long startTime)
Forces the chart starting time, or leaves it to its default- Parameters:
startTime- a positive chart starting time in ms for all datasets, or -1 to use the default starting time.
-
getEndTime
public long getEndTime()
Gets the forced chart ending time.- Returns:
- -1 if there is no forced ending time, or the forced chart ending time in ms.
-
setEndTime
public void setEndTime(long endTime)
Forces the chart ending time, or leaves it to its default- Parameters:
endTime- a positive chart ending time in ms for all datasets, or -1 to use the default ending time.
-
getDefaultStartTime
public long getDefaultStartTime()
Gets the default chart starting time, i.e. the minimum time through all values of all datasets with a time-based chart enabled (scatter plot and/or moving statistics).- Returns:
- the default chart starting time, or -1 if there is no time-based chart at all.
-
getDefaultEndTime
public long getDefaultEndTime()
Gets the default chart ending time, i.e. the maximum time through all values of all datasets with a time-based chart enabled (scatter plot and/or moving statistics).- Returns:
- the default chart ending time, or -1 if there is no time-based chart at all.
-
getInitialTime
public long getInitialTime()
-
getFinalTime
public long getFinalTime()
-
getNumberOfSlices
public int getNumberOfSlices()
-
setNumberOfSlices
public void setNumberOfSlices(int numberOfSlices)
-
getNumberOfQuantils
public int getNumberOfQuantils()
-
setNumberOfQuantils
public void setNumberOfQuantils(int i)
-
exportToTxt
public java.lang.String exportToTxt(int nbTabs, java.io.File directory, java.lang.String sectionName, Report.imageFormats imageFormat)
-
exportToHtml
public java.lang.String exportToHtml(int tabsMem, java.io.File directory, java.lang.String sectionName, Report.imageFormats imageFormat)
-
exportToXML
public void exportToXML(int tabsMem, java.io.File directory, java.lang.String sectionName, Report.imageFormats imageFormat)
-
toText
public java.lang.String toText(double[] vect)
-
getSection
public Section getSection()
-
dump
public java.lang.String dump()
-
-