Modified: jmeter/trunk/src/core/org/apache/jmeter/report/processor/ApdexSummaryConsumer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/ApdexSummaryConsumer.java?rev=1719185&r1=1719184&r2=1719185&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/ApdexSummaryConsumer.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/ApdexSummaryConsumer.java Thu Dec 10 19:10:06 2015
@@ -1,176 +1,176 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.jmeter.report.processor;
-
-import org.apache.jmeter.report.core.Sample;
-import org.apache.jmeter.util.JMeterUtils;
-
-/**
- * <p>
- * The class ApdexSummaryConsumer provides a consumer that calculates Apdex for
- * each sample name.
- * </p>
- *
- * <p>
- * T and F thresholds for each sample is defined by the thresholds selector
- * field.
- * </p>
- *
- * @since 2.14
- */
-public class ApdexSummaryConsumer extends
- AbstractSummaryConsumer<ApdexSummaryData> {
-
- private ThresholdSelector thresholdSelector;
-
- /**
- * Gets the APDEX threshold selector.
- *
- * @return the threshold selector
- */
- public final ThresholdSelector getThresholdSelector() {
- return thresholdSelector;
- }
-
- /**
- * Sets the APDEX threshold selector.
- *
- * @param thresholdSelector
- * the APDEX threshold selector to set
- */
- public final void setThresholdSelector(ThresholdSelector thresholdSelector) {
- this.thresholdSelector = thresholdSelector;
- }
-
- public ApdexSummaryConsumer() {
- super(true);
- }
-
- @Override
- protected ListResultData createDataResult(String key, ApdexSummaryData data) {
- ListResultData result = new ListResultData();
- result.addResult(new ValueResultData(getApdex(data)));
- ApdexThresholdsInfo thresholdsInfo = data.getApdexThresholdInfo();
- result.addResult(new ValueResultData(thresholdsInfo
- .getSatisfiedThreshold()));
- result.addResult(new ValueResultData(thresholdsInfo
- .getToleratedThreshold()));
- result.addResult(new ValueResultData(key != null ? key : JMeterUtils
- .getResString("reportgenerator_summary_total")));
-
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.apache.jmeter.report.processor.AbstractSummaryConsumer#getKeyFromSample
- * (org.apache.jmeter.report.core.Sample)
- */
- @Override
- protected String getKeyFromSample(Sample sample) {
- return sample.getName();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.apache.jmeter.report.processor.AbstractSummaryConsumer#updateData
- * (org.apache.jmeter.report.processor.AbstractSummaryConsumer.SummaryInfo,
- * org.apache.jmeter.report.core.Sample)
- */
- @Override
- protected void updateData(SummaryInfo info, Sample sample) {
-
- // Initialize overall data if they don't exist
- SummaryInfo overallInfo = getOverallInfo();
- ApdexSummaryData overallData = overallInfo.getData();
- if (overallData == null) {
- overallData = new ApdexSummaryData(getThresholdSelector().select(
- null));
- overallInfo.setData(overallData);
- }
-
- // Initialize info data if they don't exist
- ApdexSummaryData data = info.getData();
- if (data == null) {
- data = new ApdexSummaryData(getThresholdSelector().select(
- sample.getName()));
- info.setData(data);
- }
-
- // Increment the total count of samples with the current name
- data.IncTotalCount();
-
- // Increment the total count of samples
- overallData.IncTotalCount();
-
- // Process only succeeded samples
- if (sample.getSuccess()) {
- long elapsedTime = sample.getElapsedTime();
-
- // Increment the counters depending on the elapsed time.
- ApdexThresholdsInfo thresholdsInfo = data.getApdexThresholdInfo();
- if (elapsedTime <= thresholdsInfo.getSatisfiedThreshold()) {
- data.IncSatisfiedCount();
- } else if (elapsedTime <= thresholdsInfo.getToleratedThreshold()) {
- data.IncToleratedCount();
- }
-
- // Increment the overall counters depending on the elapsed time.
- ApdexThresholdsInfo overallThresholdsInfo = overallData
- .getApdexThresholdInfo();
- if (elapsedTime <= overallThresholdsInfo.getSatisfiedThreshold()) {
- overallData.IncSatisfiedCount();
- } else if (elapsedTime <= overallThresholdsInfo
- .getToleratedThreshold()) {
- overallData.IncToleratedCount();
- }
- }
-
- }
-
- private double getApdex(ApdexSummaryData data) {
- return (data.getSatisfiedCount() + (double) data.getToleratedCount() / 2)
- / data.getTotalCount();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.apache.jmeter.report.processor.AbstractSummaryConsumer#createResultTitles
- * ()
- */
- @Override
- protected ListResultData createResultTitles() {
- ListResultData titles = new ListResultData();
- titles.addResult(new ValueResultData(JMeterUtils
- .getResString("reportgenerator_summary_apdex_apdex")));
- titles.addResult(new ValueResultData(JMeterUtils
- .getResString("reportgenerator_summary_apdex_satisfied")));
- titles.addResult(new ValueResultData(JMeterUtils
- .getResString("reportgenerator_summary_apdex_tolerated")));
- titles.addResult(new ValueResultData(JMeterUtils
- .getResString("reportgenerator_summary_apdex_samplers")));
- return titles;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.jmeter.report.processor;
+
+import org.apache.jmeter.report.core.Sample;
+import org.apache.jmeter.util.JMeterUtils;
+
+/**
+ * <p>
+ * The class ApdexSummaryConsumer provides a consumer that calculates Apdex for
+ * each sample name.
+ * </p>
+ *
+ * <p>
+ * T and F thresholds for each sample is defined by the thresholds selector
+ * field.
+ * </p>
+ *
+ * @since 2.14
+ */
+public class ApdexSummaryConsumer extends
+ AbstractSummaryConsumer<ApdexSummaryData> {
+
+ private ThresholdSelector thresholdSelector;
+
+ /**
+ * Gets the APDEX threshold selector.
+ *
+ * @return the threshold selector
+ */
+ public final ThresholdSelector getThresholdSelector() {
+ return thresholdSelector;
+ }
+
+ /**
+ * Sets the APDEX threshold selector.
+ *
+ * @param thresholdSelector
+ * the APDEX threshold selector to set
+ */
+ public final void setThresholdSelector(ThresholdSelector thresholdSelector) {
+ this.thresholdSelector = thresholdSelector;
+ }
+
+ public ApdexSummaryConsumer() {
+ super(true);
+ }
+
+ @Override
+ protected ListResultData createDataResult(String key, ApdexSummaryData data) {
+ ListResultData result = new ListResultData();
+ result.addResult(new ValueResultData(getApdex(data)));
+ ApdexThresholdsInfo thresholdsInfo = data.getApdexThresholdInfo();
+ result.addResult(new ValueResultData(thresholdsInfo
+ .getSatisfiedThreshold()));
+ result.addResult(new ValueResultData(thresholdsInfo
+ .getToleratedThreshold()));
+ result.addResult(new ValueResultData(key != null ? key : JMeterUtils
+ .getResString("reportgenerator_summary_total")));
+
+ return result;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.jmeter.report.processor.AbstractSummaryConsumer#getKeyFromSample
+ * (org.apache.jmeter.report.core.Sample)
+ */
+ @Override
+ protected String getKeyFromSample(Sample sample) {
+ return sample.getName();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.jmeter.report.processor.AbstractSummaryConsumer#updateData
+ * (org.apache.jmeter.report.processor.AbstractSummaryConsumer.SummaryInfo,
+ * org.apache.jmeter.report.core.Sample)
+ */
+ @Override
+ protected void updateData(SummaryInfo info, Sample sample) {
+
+ // Initialize overall data if they don't exist
+ SummaryInfo overallInfo = getOverallInfo();
+ ApdexSummaryData overallData = overallInfo.getData();
+ if (overallData == null) {
+ overallData = new ApdexSummaryData(getThresholdSelector().select(
+ null));
+ overallInfo.setData(overallData);
+ }
+
+ // Initialize info data if they don't exist
+ ApdexSummaryData data = info.getData();
+ if (data == null) {
+ data = new ApdexSummaryData(getThresholdSelector().select(
+ sample.getName()));
+ info.setData(data);
+ }
+
+ // Increment the total count of samples with the current name
+ data.IncTotalCount();
+
+ // Increment the total count of samples
+ overallData.IncTotalCount();
+
+ // Process only succeeded samples
+ if (sample.getSuccess()) {
+ long elapsedTime = sample.getElapsedTime();
+
+ // Increment the counters depending on the elapsed time.
+ ApdexThresholdsInfo thresholdsInfo = data.getApdexThresholdInfo();
+ if (elapsedTime <= thresholdsInfo.getSatisfiedThreshold()) {
+ data.IncSatisfiedCount();
+ } else if (elapsedTime <= thresholdsInfo.getToleratedThreshold()) {
+ data.IncToleratedCount();
+ }
+
+ // Increment the overall counters depending on the elapsed time.
+ ApdexThresholdsInfo overallThresholdsInfo = overallData
+ .getApdexThresholdInfo();
+ if (elapsedTime <= overallThresholdsInfo.getSatisfiedThreshold()) {
+ overallData.IncSatisfiedCount();
+ } else if (elapsedTime <= overallThresholdsInfo
+ .getToleratedThreshold()) {
+ overallData.IncToleratedCount();
+ }
+ }
+
+ }
+
+ private double getApdex(ApdexSummaryData data) {
+ return (data.getSatisfiedCount() + (double) data.getToleratedCount() / 2)
+ / data.getTotalCount();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.jmeter.report.processor.AbstractSummaryConsumer#createResultTitles
+ * ()
+ */
+ @Override
+ protected ListResultData createResultTitles() {
+ ListResultData titles = new ListResultData();
+ titles.addResult(new ValueResultData(JMeterUtils
+ .getResString("reportgenerator_summary_apdex_apdex")));
+ titles.addResult(new ValueResultData(JMeterUtils
+ .getResString("reportgenerator_summary_apdex_satisfied")));
+ titles.addResult(new ValueResultData(JMeterUtils
+ .getResString("reportgenerator_summary_apdex_tolerated")));
+ titles.addResult(new ValueResultData(JMeterUtils
+ .getResString("reportgenerator_summary_apdex_samplers")));
+ return titles;
+ }
+
+}
Propchange: jmeter/trunk/src/core/org/apache/jmeter/report/processor/ApdexSummaryConsumer.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: jmeter/trunk/src/core/org/apache/jmeter/report/processor/ApdexSummaryData.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/ApdexSummaryData.java?rev=1719185&r1=1719184&r2=1719185&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/ApdexSummaryData.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/ApdexSummaryData.java Thu Dec 10 19:10:06 2015
@@ -1,110 +1,110 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.jmeter.report.processor;
-
-/**
- * The class ApdexSummaryData provides information for ApdexSummaryConsumer.
- *
- * @since 2.14
- */
-public class ApdexSummaryData {
- private final ApdexThresholdsInfo apdexThresholdInfo;
-
- private long satisfiedCount;
- private long toleratedCount;
- private long totalCount;
-
- public final ApdexThresholdsInfo getApdexThresholdInfo() {
- return apdexThresholdInfo;
- }
-
- /**
- * Gets the satisfied count.
- *
- * @return the satisfiedCount
- */
- public final long getSatisfiedCount() {
- return satisfiedCount;
- }
-
- /**
- * Sets the satisfied count.
- *
- * @param satisfiedCount
- * the satisfiedCount to set
- */
- public final void setSatisfiedCount(long satisfiedCount) {
- this.satisfiedCount = satisfiedCount;
- }
-
- /**
- * @return the toleratedCount
- */
- public final long getToleratedCount() {
- return toleratedCount;
- }
-
- /**
- * Sets the tolerated count.
- *
- * @param toleratedCount
- * the toleratedCount to set
- */
- public final void setToleratedCount(long toleratedCount) {
- this.toleratedCount = toleratedCount;
- }
-
- /**
- * Gets the total count.
- *
- * @return the totalCount
- */
- public final long getTotalCount() {
- return totalCount;
- }
-
- /**
- * @param totalCount
- * the totalCount to set
- */
- public final void setTotalCount(long totalCount) {
- this.totalCount = totalCount;
- }
-
- /**
- * Instantiates a new apdex summary data.
- *
- * @param info
- * the threshold information
- */
- public ApdexSummaryData(ApdexThresholdsInfo info) {
- apdexThresholdInfo = info;
- }
-
- public void IncSatisfiedCount() {
- satisfiedCount++;
- }
-
- public void IncToleratedCount() {
- toleratedCount++;
- }
-
- public void IncTotalCount() {
- totalCount++;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.jmeter.report.processor;
+
+/**
+ * The class ApdexSummaryData provides information for ApdexSummaryConsumer.
+ *
+ * @since 2.14
+ */
+public class ApdexSummaryData {
+ private final ApdexThresholdsInfo apdexThresholdInfo;
+
+ private long satisfiedCount;
+ private long toleratedCount;
+ private long totalCount;
+
+ public final ApdexThresholdsInfo getApdexThresholdInfo() {
+ return apdexThresholdInfo;
+ }
+
+ /**
+ * Gets the satisfied count.
+ *
+ * @return the satisfiedCount
+ */
+ public final long getSatisfiedCount() {
+ return satisfiedCount;
+ }
+
+ /**
+ * Sets the satisfied count.
+ *
+ * @param satisfiedCount
+ * the satisfiedCount to set
+ */
+ public final void setSatisfiedCount(long satisfiedCount) {
+ this.satisfiedCount = satisfiedCount;
+ }
+
+ /**
+ * @return the toleratedCount
+ */
+ public final long getToleratedCount() {
+ return toleratedCount;
+ }
+
+ /**
+ * Sets the tolerated count.
+ *
+ * @param toleratedCount
+ * the toleratedCount to set
+ */
+ public final void setToleratedCount(long toleratedCount) {
+ this.toleratedCount = toleratedCount;
+ }
+
+ /**
+ * Gets the total count.
+ *
+ * @return the totalCount
+ */
+ public final long getTotalCount() {
+ return totalCount;
+ }
+
+ /**
+ * @param totalCount
+ * the totalCount to set
+ */
+ public final void setTotalCount(long totalCount) {
+ this.totalCount = totalCount;
+ }
+
+ /**
+ * Instantiates a new apdex summary data.
+ *
+ * @param info
+ * the threshold information
+ */
+ public ApdexSummaryData(ApdexThresholdsInfo info) {
+ apdexThresholdInfo = info;
+ }
+
+ public void IncSatisfiedCount() {
+ satisfiedCount++;
+ }
+
+ public void IncToleratedCount() {
+ toleratedCount++;
+ }
+
+ public void IncTotalCount() {
+ totalCount++;
+ }
+}
Propchange: jmeter/trunk/src/core/org/apache/jmeter/report/processor/ApdexSummaryData.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: jmeter/trunk/src/core/org/apache/jmeter/report/processor/ApdexThresholdsInfo.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/ApdexThresholdsInfo.java?rev=1719185&r1=1719184&r2=1719185&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/ApdexThresholdsInfo.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/ApdexThresholdsInfo.java Thu Dec 10 19:10:06 2015
@@ -1,67 +1,67 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.jmeter.report.processor;
-
-/**
- * The class ApdexThresholdsInfo provides a container for APDEX threshold
- * information.
- *
- * @since 2.14
- */
-public class ApdexThresholdsInfo {
- private long satisfiedThreshold;
- private long toleratedThreshold;
-
- /**
- * Gets the satisfied users threshold (T).
- *
- * @return the satisfied threshold
- */
- public final long getSatisfiedThreshold() {
- return satisfiedThreshold;
- }
-
- /**
- * Sets the satisfied users threshold (T).
- *
- * @param satisfiedThreshold
- * the satisfied threshold to set
- */
- public final void setSatisfiedThreshold(long satisfiedThreshold) {
- this.satisfiedThreshold = satisfiedThreshold;
- }
-
- /**
- * Gets the tolerated threshold (F).
- *
- * @return the tolerated threshold
- */
- public final long getToleratedThreshold() {
- return toleratedThreshold;
- }
-
- /**
- * Sets the tolerated threshold (F).
- *
- * @param toleratedThreshold
- * the tolerated threshold to set
- */
- public final void setToleratedThreshold(long toleratedThreshold) {
- this.toleratedThreshold = toleratedThreshold;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.jmeter.report.processor;
+
+/**
+ * The class ApdexThresholdsInfo provides a container for APDEX threshold
+ * information.
+ *
+ * @since 2.14
+ */
+public class ApdexThresholdsInfo {
+ private long satisfiedThreshold;
+ private long toleratedThreshold;
+
+ /**
+ * Gets the satisfied users threshold (T).
+ *
+ * @return the satisfied threshold
+ */
+ public final long getSatisfiedThreshold() {
+ return satisfiedThreshold;
+ }
+
+ /**
+ * Sets the satisfied users threshold (T).
+ *
+ * @param satisfiedThreshold
+ * the satisfied threshold to set
+ */
+ public final void setSatisfiedThreshold(long satisfiedThreshold) {
+ this.satisfiedThreshold = satisfiedThreshold;
+ }
+
+ /**
+ * Gets the tolerated threshold (F).
+ *
+ * @return the tolerated threshold
+ */
+ public final long getToleratedThreshold() {
+ return toleratedThreshold;
+ }
+
+ /**
+ * Sets the tolerated threshold (F).
+ *
+ * @param toleratedThreshold
+ * the tolerated threshold to set
+ */
+ public final void setToleratedThreshold(long toleratedThreshold) {
+ this.toleratedThreshold = toleratedThreshold;
+ }
+}
Propchange: jmeter/trunk/src/core/org/apache/jmeter/report/processor/ApdexThresholdsInfo.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: jmeter/trunk/src/core/org/apache/jmeter/report/processor/ChannelContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: jmeter/trunk/src/core/org/apache/jmeter/report/processor/CsvFileSampleSource.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: jmeter/trunk/src/core/org/apache/jmeter/report/processor/ErrorsSummaryConsumer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: jmeter/trunk/src/core/org/apache/jmeter/report/processor/ExternalSampleSorter.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: jmeter/trunk/src/core/org/apache/jmeter/report/processor/FieldSampleComparator.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/FieldSampleComparator.java?rev=1719185&r1=1719184&r2=1719185&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/FieldSampleComparator.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/FieldSampleComparator.java Thu Dec 10 19:10:06 2015
@@ -1,59 +1,59 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.jmeter.report.processor;
-
-import org.apache.jmeter.report.core.Sample;
-import org.apache.jmeter.report.core.SampleComparator;
-import org.apache.jmeter.report.core.SampleException;
-import org.apache.jmeter.report.core.SampleMetadata;
-
-/**
- * @since 2.14
- */
-public class FieldSampleComparator implements SampleComparator {
- private static final String METADATA_EXCEPTION_MSG_FMT = "No <%s> data found in sample metadata <%s>";
-
- private int index;
-
- private final String fieldName;
-
- public FieldSampleComparator(String fieldName) {
- this.fieldName = fieldName;
- }
-
- @Override
- public final void initialize(SampleMetadata metadata) {
- index = metadata.indexOf(fieldName);
- if (index < 0) {
- throw new SampleException(String.format(METADATA_EXCEPTION_MSG_FMT,
- fieldName, metadata));
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.apache.jmeter.report.csv.core.SampleComparator#compare(org.apache
- * .jmeter.report.csv.core.Sample, org.apache.jmeter.report.csv.core.Sample)
- */
- @Override
- public long compare(Sample s1, Sample s2) {
- return s1.getLong(index) - s2.getLong(index);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.jmeter.report.processor;
+
+import org.apache.jmeter.report.core.Sample;
+import org.apache.jmeter.report.core.SampleComparator;
+import org.apache.jmeter.report.core.SampleException;
+import org.apache.jmeter.report.core.SampleMetadata;
+
+/**
+ * @since 2.14
+ */
+public class FieldSampleComparator implements SampleComparator {
+ private static final String METADATA_EXCEPTION_MSG_FMT = "No <%s> data found in sample metadata <%s>";
+
+ private int index;
+
+ private final String fieldName;
+
+ public FieldSampleComparator(String fieldName) {
+ this.fieldName = fieldName;
+ }
+
+ @Override
+ public final void initialize(SampleMetadata metadata) {
+ index = metadata.indexOf(fieldName);
+ if (index < 0) {
+ throw new SampleException(String.format(METADATA_EXCEPTION_MSG_FMT,
+ fieldName, metadata));
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.jmeter.report.csv.core.SampleComparator#compare(org.apache
+ * .jmeter.report.csv.core.Sample, org.apache.jmeter.report.csv.core.Sample)
+ */
+ @Override
+ public long compare(Sample s1, Sample s2) {
+ return s1.getLong(index) - s2.getLong(index);
+ }
+}
Propchange: jmeter/trunk/src/core/org/apache/jmeter/report/processor/FieldSampleComparator.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: jmeter/trunk/src/core/org/apache/jmeter/report/processor/FilterConsumer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/FilterConsumer.java?rev=1719185&r1=1719184&r2=1719185&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/FilterConsumer.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/FilterConsumer.java Thu Dec 10 19:10:06 2015
@@ -1,114 +1,114 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.jmeter.report.processor;
-
-import org.apache.jmeter.report.core.Sample;
-import org.apache.jmeter.report.core.SamplePredicate;
-import org.apache.jmeter.report.processor.AbstractSampleConsumer;
-
-/**
- * <p>
- * The class FilterConsumer provides a way to discard samples in a consumer
- * chain. This class uses a predicate for the filtering decision.
- * </p>
- *
- * <ul>
- * <li>
- * When reverseFilter is false, samples are discarded if none predicate is
- * defined or samples don't match the predicate.</li>
- * <li>
- * When reverseFilter is true, samples are discarded if a predicate is defined
- * and samples match the predicate.</li>
- * </ul>
- *
- * @since 2.14
- */
-public class FilterConsumer extends AbstractSampleConsumer {
- private SamplePredicate samplePredicate;
-
- private boolean reverseFilter = false;
-
- /**
- * Checks if the filtering is reversed.
- *
- * @return true if the filtering is reversed; otherwise false.
- */
- public final boolean isReverseFilter() {
- return reverseFilter;
- }
-
- /**
- * Reverses the filtering decision.
- *
- * @param reverseFilter
- * the filter mode to set
- */
- public final void setReverseFilter(boolean reverseFilter) {
- this.reverseFilter = reverseFilter;
- }
-
- /**
- * Gets the sample predicate used to filter the samples.
- *
- * @return the sample predicate used to filter the samples.
- */
- public final SamplePredicate getSamplePredicate() {
- return samplePredicate;
- }
-
- /**
- * Sets the sample predicate used to filter the samples.
- *
- * @param samplePredicate
- * the new sample predicate.
- */
- public final void setSamplePredicate(SamplePredicate samplePredicate) {
- this.samplePredicate = samplePredicate;
- }
-
- @Override
- public void startConsuming() {
- // Broadcast metadata to consumers for each channel
- int channelCount = getConsumedChannelCount();
- for (int i = 0; i < channelCount; i++) {
- super.setProducedMetadata(getConsumedMetadata(i), i);
- }
- super.startProducing();
- }
-
- @Override
- public void consume(Sample sample, int channel) {
- // The sample is reproduced if :
- // A predicate is defined and the sample matches it when reverseFilter
- // is false.
- // OR
- // None predicate is defined or the sample does not match when
- // reverseFilter is true.
- if ((reverseFilter == false && samplePredicate != null && samplePredicate
- .matches(sample))
- || (reverseFilter == true && (samplePredicate == null || samplePredicate
- .matches(sample) == false))) {
- super.produce(sample, channel);
- }
- }
-
- @Override
- public void stopConsuming() {
- super.stopProducing();
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.jmeter.report.processor;
+
+import org.apache.jmeter.report.core.Sample;
+import org.apache.jmeter.report.core.SamplePredicate;
+import org.apache.jmeter.report.processor.AbstractSampleConsumer;
+
+/**
+ * <p>
+ * The class FilterConsumer provides a way to discard samples in a consumer
+ * chain. This class uses a predicate for the filtering decision.
+ * </p>
+ *
+ * <ul>
+ * <li>
+ * When reverseFilter is false, samples are discarded if none predicate is
+ * defined or samples don't match the predicate.</li>
+ * <li>
+ * When reverseFilter is true, samples are discarded if a predicate is defined
+ * and samples match the predicate.</li>
+ * </ul>
+ *
+ * @since 2.14
+ */
+public class FilterConsumer extends AbstractSampleConsumer {
+ private SamplePredicate samplePredicate;
+
+ private boolean reverseFilter = false;
+
+ /**
+ * Checks if the filtering is reversed.
+ *
+ * @return true if the filtering is reversed; otherwise false.
+ */
+ public final boolean isReverseFilter() {
+ return reverseFilter;
+ }
+
+ /**
+ * Reverses the filtering decision.
+ *
+ * @param reverseFilter
+ * the filter mode to set
+ */
+ public final void setReverseFilter(boolean reverseFilter) {
+ this.reverseFilter = reverseFilter;
+ }
+
+ /**
+ * Gets the sample predicate used to filter the samples.
+ *
+ * @return the sample predicate used to filter the samples.
+ */
+ public final SamplePredicate getSamplePredicate() {
+ return samplePredicate;
+ }
+
+ /**
+ * Sets the sample predicate used to filter the samples.
+ *
+ * @param samplePredicate
+ * the new sample predicate.
+ */
+ public final void setSamplePredicate(SamplePredicate samplePredicate) {
+ this.samplePredicate = samplePredicate;
+ }
+
+ @Override
+ public void startConsuming() {
+ // Broadcast metadata to consumers for each channel
+ int channelCount = getConsumedChannelCount();
+ for (int i = 0; i < channelCount; i++) {
+ super.setProducedMetadata(getConsumedMetadata(i), i);
+ }
+ super.startProducing();
+ }
+
+ @Override
+ public void consume(Sample sample, int channel) {
+ // The sample is reproduced if :
+ // A predicate is defined and the sample matches it when reverseFilter
+ // is false.
+ // OR
+ // None predicate is defined or the sample does not match when
+ // reverseFilter is true.
+ if ((reverseFilter == false && samplePredicate != null && samplePredicate
+ .matches(sample))
+ || (reverseFilter == true && (samplePredicate == null || samplePredicate
+ .matches(sample) == false))) {
+ super.produce(sample, channel);
+ }
+ }
+
+ @Override
+ public void stopConsuming() {
+ super.stopProducing();
+ }
+}
Propchange: jmeter/trunk/src/core/org/apache/jmeter/report/processor/FilterConsumer.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: jmeter/trunk/src/core/org/apache/jmeter/report/processor/Job.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/Job.java?rev=1719185&r1=1719184&r2=1719185&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/Job.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/Job.java Thu Dec 10 19:10:06 2015
@@ -1,57 +1,57 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.jmeter.report.processor;
-
-/**
- * A Job that can be used to execute an operation that produce a result that we
- * want to get in the future when it is ready.
- *
- *
- * @param <T>
- * The result type
- * @since 2.14
- */
-abstract class Job<T> implements Runnable {
-
- private volatile boolean resultReady = false;
-
- private Object lock = new Object();
-
- private volatile T result;
-
- @Override
- public final void run() {
- resultReady = false;
- result = exec();
- synchronized (lock) {
- resultReady = true;
- lock.notify();
- }
- }
-
- protected abstract T exec();
-
- public T getResult() throws InterruptedException {
- synchronized (lock) {
- while (!resultReady) {
- lock.wait();
- }
- }
- return result;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.jmeter.report.processor;
+
+/**
+ * A Job that can be used to execute an operation that produce a result that we
+ * want to get in the future when it is ready.
+ *
+ *
+ * @param <T>
+ * The result type
+ * @since 2.14
+ */
+abstract class Job<T> implements Runnable {
+
+ private volatile boolean resultReady = false;
+
+ private Object lock = new Object();
+
+ private volatile T result;
+
+ @Override
+ public final void run() {
+ resultReady = false;
+ result = exec();
+ synchronized (lock) {
+ resultReady = true;
+ lock.notify();
+ }
+ }
+
+ protected abstract T exec();
+
+ public T getResult() throws InterruptedException {
+ synchronized (lock) {
+ while (!resultReady) {
+ lock.wait();
+ }
+ }
+ return result;
+ }
+}
Propchange: jmeter/trunk/src/core/org/apache/jmeter/report/processor/Job.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: jmeter/trunk/src/core/org/apache/jmeter/report/processor/ListResultData.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/ListResultData.java?rev=1719185&r1=1719184&r2=1719185&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/ListResultData.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/ListResultData.java Thu Dec 10 19:10:06 2015
@@ -1,101 +1,101 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.jmeter.report.processor;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.apache.jmeter.report.core.ArgumentNullException;
-
-/**
- * The class ListResultData provides a list of results from sample processing.
- *
- * @since 2.14
- */
-public class ListResultData implements ResultData, Iterable<ResultData> {
-
- /** The items. */
- private ArrayList<ResultData> items = new ArrayList<>();
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.apache.jmeter.report.processor.ResultData#accept(org.apache.jmeter
- * .report.processor.ResultDataVisitor)
- */
- @Override
- public <TVisit> TVisit accept(ResultDataVisitor<TVisit> visitor) {
- if (visitor == null) {
- throw new ArgumentNullException("visitor");
- }
- return visitor.visitListResult(this);
- }
-
- /**
- * Adds the result at the end of the list.
- *
- * @param result
- * the result
- * @return true, if the result is added
- */
- public boolean addResult(ResultData result) {
- return items.add(result);
- }
-
- /**
- * Removes the result at the specified index.
- *
- * @param index
- * the index of the result in the list
- * @return the removed result data
- */
- public ResultData removeResult(int index) {
- return items.remove(index);
- }
-
- /**
- * Gets the stored item at the specified index.
- *
- * @param index
- * the index
- * @return the result data
- */
- public ResultData get(int index) {
- return items.get(index);
- }
-
- /**
- * Gets the size of the list.
- *
- * @return the size of the list
- */
- public int getSize() {
- return items.size();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Iterable#iterator()
- */
- @Override
- public Iterator<ResultData> iterator() {
- return items.iterator();
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.jmeter.report.processor;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.apache.jmeter.report.core.ArgumentNullException;
+
+/**
+ * The class ListResultData provides a list of results from sample processing.
+ *
+ * @since 2.14
+ */
+public class ListResultData implements ResultData, Iterable<ResultData> {
+
+ /** The items. */
+ private ArrayList<ResultData> items = new ArrayList<>();
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.jmeter.report.processor.ResultData#accept(org.apache.jmeter
+ * .report.processor.ResultDataVisitor)
+ */
+ @Override
+ public <TVisit> TVisit accept(ResultDataVisitor<TVisit> visitor) {
+ if (visitor == null) {
+ throw new ArgumentNullException("visitor");
+ }
+ return visitor.visitListResult(this);
+ }
+
+ /**
+ * Adds the result at the end of the list.
+ *
+ * @param result
+ * the result
+ * @return true, if the result is added
+ */
+ public boolean addResult(ResultData result) {
+ return items.add(result);
+ }
+
+ /**
+ * Removes the result at the specified index.
+ *
+ * @param index
+ * the index of the result in the list
+ * @return the removed result data
+ */
+ public ResultData removeResult(int index) {
+ return items.remove(index);
+ }
+
+ /**
+ * Gets the stored item at the specified index.
+ *
+ * @param index
+ * the index
+ * @return the result data
+ */
+ public ResultData get(int index) {
+ return items.get(index);
+ }
+
+ /**
+ * Gets the size of the list.
+ *
+ * @return the size of the list
+ */
+ public int getSize() {
+ return items.size();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Iterable#iterator()
+ */
+ @Override
+ public Iterator<ResultData> iterator() {
+ return items.iterator();
+ }
+}
Propchange: jmeter/trunk/src/core/org/apache/jmeter/report/processor/ListResultData.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: jmeter/trunk/src/core/org/apache/jmeter/report/processor/MapResultData.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/MapResultData.java?rev=1719185&r1=1719184&r2=1719185&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/MapResultData.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/MapResultData.java Thu Dec 10 19:10:06 2015
@@ -1,94 +1,94 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.jmeter.report.processor;
-
-import java.util.HashMap;
-import java.util.Map.Entry;
-import java.util.Set;
-
-import org.apache.jmeter.report.core.ArgumentNullException;
-
-/**
- * The class MapResultData provides a hash map of results from samples
- * processing.
- *
- * @since 2.14
- */
-public class MapResultData implements ResultData {
-
- private HashMap<String, ResultData> map = new HashMap<>();
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.apache.jmeter.report.processor.ResultData#accept(org.apache.jmeter
- * .report.processor.ResultDataVisitor)
- */
- @Override
- public <TVisit> TVisit accept(ResultDataVisitor<TVisit> visitor) {
- if (visitor == null) {
- throw new ArgumentNullException("visitor");
- }
- return visitor.visitMapResult(this);
- }
-
- /**
- * Get the entry set.
- *
- * @return the sets of entries of the map
- */
- public Set<Entry<String, ResultData>> entrySet() {
- return map.entrySet();
- }
-
- /**
- * Gets the result with the specified name.
- *
- * @param name
- * the name of the result
- * @return the result
- */
- public ResultData getResult(String name) {
- return map.get(name);
- }
-
- /**
- * Sets the specified result to the map.
- *
- * @param name
- * the name of the result
- * @param result
- * the result
- * @return the previously result data associated with the specified name
- */
- public ResultData setResult(String name, ResultData result) {
- return map.put(name, result);
- }
-
- /**
- * Removes the result with the specified name.
- *
- * @param name
- * the name of the result
- * @return the removed result data
- */
- public ResultData removeResult(String name) {
- return map.remove(name);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.jmeter.report.processor;
+
+import java.util.HashMap;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import org.apache.jmeter.report.core.ArgumentNullException;
+
+/**
+ * The class MapResultData provides a hash map of results from samples
+ * processing.
+ *
+ * @since 2.14
+ */
+public class MapResultData implements ResultData {
+
+ private HashMap<String, ResultData> map = new HashMap<>();
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.jmeter.report.processor.ResultData#accept(org.apache.jmeter
+ * .report.processor.ResultDataVisitor)
+ */
+ @Override
+ public <TVisit> TVisit accept(ResultDataVisitor<TVisit> visitor) {
+ if (visitor == null) {
+ throw new ArgumentNullException("visitor");
+ }
+ return visitor.visitMapResult(this);
+ }
+
+ /**
+ * Get the entry set.
+ *
+ * @return the sets of entries of the map
+ */
+ public Set<Entry<String, ResultData>> entrySet() {
+ return map.entrySet();
+ }
+
+ /**
+ * Gets the result with the specified name.
+ *
+ * @param name
+ * the name of the result
+ * @return the result
+ */
+ public ResultData getResult(String name) {
+ return map.get(name);
+ }
+
+ /**
+ * Sets the specified result to the map.
+ *
+ * @param name
+ * the name of the result
+ * @param result
+ * the result
+ * @return the previously result data associated with the specified name
+ */
+ public ResultData setResult(String name, ResultData result) {
+ return map.put(name, result);
+ }
+
+ /**
+ * Removes the result with the specified name.
+ *
+ * @param name
+ * the name of the result
+ * @return the removed result data
+ */
+ public ResultData removeResult(String name) {
+ return map.remove(name);
+ }
+}
Propchange: jmeter/trunk/src/core/org/apache/jmeter/report/processor/MapResultData.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: jmeter/trunk/src/core/org/apache/jmeter/report/processor/MaxAggregator.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/MaxAggregator.java?rev=1719185&r1=1719184&r2=1719185&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/MaxAggregator.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/MaxAggregator.java Thu Dec 10 19:10:06 2015
@@ -1,72 +1,72 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.jmeter.report.processor;
-
-/**
- * The class MaxAggregator is used to get maximum from samples.
- *
- * @since 2.14
- */
-public class MaxAggregator implements Aggregator {
-
- private long count = 0L;
- private double value = Double.MIN_VALUE;
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.jmeter.report.core.GraphAggregator#getCount()
- */
- @Override
- public long getCount() {
- return count;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.jmeter.report.core.GraphAggregator#getResult()
- */
- @Override
- public double getResult() {
- return value;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.jmeter.report.core.GraphAggregator#addValue(double)
- */
- @Override
- public void addValue(double value) {
- this.value = Math.max(this.value, value);
- count++;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.jmeter.report.core.GraphAggregator#reset()
- */
- @Override
- public void reset() {
- count = 0L;
- value = Double.MIN_VALUE;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.jmeter.report.processor;
+
+/**
+ * The class MaxAggregator is used to get maximum from samples.
+ *
+ * @since 2.14
+ */
+public class MaxAggregator implements Aggregator {
+
+ private long count = 0L;
+ private double value = Double.MIN_VALUE;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.jmeter.report.core.GraphAggregator#getCount()
+ */
+ @Override
+ public long getCount() {
+ return count;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.jmeter.report.core.GraphAggregator#getResult()
+ */
+ @Override
+ public double getResult() {
+ return value;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.jmeter.report.core.GraphAggregator#addValue(double)
+ */
+ @Override
+ public void addValue(double value) {
+ this.value = Math.max(this.value, value);
+ count++;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.jmeter.report.core.GraphAggregator#reset()
+ */
+ @Override
+ public void reset() {
+ count = 0L;
+ value = Double.MIN_VALUE;
+ }
+
+}
Propchange: jmeter/trunk/src/core/org/apache/jmeter/report/processor/MaxAggregator.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: jmeter/trunk/src/core/org/apache/jmeter/report/processor/MeanAggregator.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/MeanAggregator.java?rev=1719185&r1=1719184&r2=1719185&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/MeanAggregator.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/MeanAggregator.java Thu Dec 10 19:10:06 2015
@@ -1,71 +1,71 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.jmeter.report.processor;
-
-import org.apache.commons.math3.stat.descriptive.moment.Mean;
-
-/**
- * The class MeanAggregator is used to get mean from samples.
- *
- * @since 2.14
- */
-public class MeanAggregator implements Aggregator {
-
- private Mean mean = new Mean();
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.jmeter.report.core.GraphAggregator#getCount()
- */
- @Override
- public long getCount() {
- return mean.getN();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.jmeter.report.core.GraphAggregator#getResult()
- */
- @Override
- public double getResult() {
- return mean.getResult();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.jmeter.report.core.GraphAggregator#addValue(double)
- */
- @Override
- public void addValue(double value) {
- mean.increment(value);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.jmeter.report.core.GraphAggregator#reset()
- */
- @Override
- public void reset() {
- mean.clear();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.jmeter.report.processor;
+
+import org.apache.commons.math3.stat.descriptive.moment.Mean;
+
+/**
+ * The class MeanAggregator is used to get mean from samples.
+ *
+ * @since 2.14
+ */
+public class MeanAggregator implements Aggregator {
+
+ private Mean mean = new Mean();
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.jmeter.report.core.GraphAggregator#getCount()
+ */
+ @Override
+ public long getCount() {
+ return mean.getN();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.jmeter.report.core.GraphAggregator#getResult()
+ */
+ @Override
+ public double getResult() {
+ return mean.getResult();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.jmeter.report.core.GraphAggregator#addValue(double)
+ */
+ @Override
+ public void addValue(double value) {
+ mean.increment(value);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.jmeter.report.core.GraphAggregator#reset()
+ */
+ @Override
+ public void reset() {
+ mean.clear();
+ }
+
+}
Propchange: jmeter/trunk/src/core/org/apache/jmeter/report/processor/MeanAggregator.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: jmeter/trunk/src/core/org/apache/jmeter/report/processor/MeanAggregatorFactory.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/MeanAggregatorFactory.java?rev=1719185&r1=1719184&r2=1719185&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/MeanAggregatorFactory.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/MeanAggregatorFactory.java Thu Dec 10 19:10:06 2015
@@ -1,39 +1,39 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.jmeter.report.processor;
-
-/**
- * A factory for creating MeanAggregator objects.
- *
- * @since 2.14
- */
-public class MeanAggregatorFactory extends AbstractAggregatorFactory {
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.apache.jmeter.report.core.AbstractAggregatorFactory#createAggregator
- * ()
- */
- @Override
- protected Aggregator createAggregator() {
- return new MeanAggregator();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.jmeter.report.processor;
+
+/**
+ * A factory for creating MeanAggregator objects.
+ *
+ * @since 2.14
+ */
+public class MeanAggregatorFactory extends AbstractAggregatorFactory {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.jmeter.report.core.AbstractAggregatorFactory#createAggregator
+ * ()
+ */
+ @Override
+ protected Aggregator createAggregator() {
+ return new MeanAggregator();
+ }
+
+}
Propchange: jmeter/trunk/src/core/org/apache/jmeter/report/processor/MeanAggregatorFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: jmeter/trunk/src/core/org/apache/jmeter/report/processor/MedianAggregatorFactory.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/MedianAggregatorFactory.java?rev=1719185&r1=1719184&r2=1719185&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/MedianAggregatorFactory.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/MedianAggregatorFactory.java Thu Dec 10 19:10:06 2015
@@ -1,41 +1,41 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.jmeter.report.processor;
-
-/**
- * A factory for creating PercentileAggregator with index of percentile fixed to
- * value 50.
- *
- * @since 2.14
- */
-public class MedianAggregatorFactory extends AbstractAggregatorFactory {
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.apache.jmeter.report.core.AbstractAggregatorFactory#createAggregator
- * ()
- */
- @Override
- protected Aggregator createAggregator() {
- // TODO Auto-generated method stub
- return new PercentileAggregator(50);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.jmeter.report.processor;
+
+/**
+ * A factory for creating PercentileAggregator with index of percentile fixed to
+ * value 50.
+ *
+ * @since 2.14
+ */
+public class MedianAggregatorFactory extends AbstractAggregatorFactory {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.jmeter.report.core.AbstractAggregatorFactory#createAggregator
+ * ()
+ */
+ @Override
+ protected Aggregator createAggregator() {
+ // TODO Auto-generated method stub
+ return new PercentileAggregator(50);
+ }
+
+}
Propchange: jmeter/trunk/src/core/org/apache/jmeter/report/processor/MedianAggregatorFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: jmeter/trunk/src/core/org/apache/jmeter/report/processor/MinAggregator.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/MinAggregator.java?rev=1719185&r1=1719184&r2=1719185&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/MinAggregator.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/MinAggregator.java Thu Dec 10 19:10:06 2015
@@ -1,72 +1,72 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.jmeter.report.processor;
-
-/**
- * The class MinAggregator is used to get minimum from samples.
- *
- * @since 2.14
- */
-public class MinAggregator implements Aggregator {
-
- private long count = 0L;
- private double value = Double.MAX_VALUE;
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.jmeter.report.core.GraphAggregator#getCount()
- */
- @Override
- public long getCount() {
- return count;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.jmeter.report.core.GraphAggregator#getResult()
- */
- @Override
- public double getResult() {
- return value;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.jmeter.report.core.GraphAggregator#addValue(double)
- */
- @Override
- public void addValue(double value) {
- this.value = Math.min(this.value, value);
- count++;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.jmeter.report.core.GraphAggregator#reset()
- */
- @Override
- public void reset() {
- count = 0L;
- value = Double.MAX_VALUE;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.jmeter.report.processor;
+
+/**
+ * The class MinAggregator is used to get minimum from samples.
+ *
+ * @since 2.14
+ */
+public class MinAggregator implements Aggregator {
+
+ private long count = 0L;
+ private double value = Double.MAX_VALUE;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.jmeter.report.core.GraphAggregator#getCount()
+ */
+ @Override
+ public long getCount() {
+ return count;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.jmeter.report.core.GraphAggregator#getResult()
+ */
+ @Override
+ public double getResult() {
+ return value;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.jmeter.report.core.GraphAggregator#addValue(double)
+ */
+ @Override
+ public void addValue(double value) {
+ this.value = Math.min(this.value, value);
+ count++;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.jmeter.report.core.GraphAggregator#reset()
+ */
+ @Override
+ public void reset() {
+ count = 0L;
+ value = Double.MAX_VALUE;
+ }
+
+}
Propchange: jmeter/trunk/src/core/org/apache/jmeter/report/processor/MinAggregator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: jmeter/trunk/src/core/org/apache/jmeter/report/processor/NormalizerSampleConsumer.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: jmeter/trunk/src/core/org/apache/jmeter/report/processor/PercentileAggregator.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/PercentileAggregator.java?rev=1719185&r1=1719184&r2=1719185&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/PercentileAggregator.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/PercentileAggregator.java Thu Dec 10 19:10:06 2015
@@ -1,89 +1,89 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.jmeter.report.processor;
-
-import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
-import org.apache.jmeter.report.config.ReportGeneratorConfiguration;
-import org.apache.jmeter.util.JMeterUtils;
-
-/**
- * The class PercentileAggregator is used to get percentile from samples.
- *
- * @since 2.14
- */
-public class PercentileAggregator implements Aggregator {
- private static final int SLIDING_WINDOW_SIZE = JMeterUtils.getPropDefault(
- ReportGeneratorConfiguration.REPORT_GENERATOR_KEY_PREFIX
- + ReportGeneratorConfiguration.KEY_DELIMITER
- + "statistic_window", 200000);
-
- private final DescriptiveStatistics statistics;
- private final double percentileIndex;
-
- /**
- * Instantiates a new percentile aggregator.
- *
- * @param index
- * the index of the percentile
- */
- public PercentileAggregator(double index) {
- statistics = new DescriptiveStatistics(SLIDING_WINDOW_SIZE);
- percentileIndex = index;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.jmeter.report.core.GraphAggregator#getCount()
- */
- @Override
- public long getCount() {
- return statistics.getN();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.jmeter.report.core.GraphAggregator#getResult()
- */
- @Override
- public double getResult() {
- return statistics.getPercentile(percentileIndex);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.jmeter.report.core.GraphAggregator#addValue(double)
- */
- @Override
- public void addValue(double value) {
- statistics.addValue(value);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.jmeter.report.core.GraphAggregator#reset()
- */
- @Override
- public void reset() {
- statistics.clear();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.jmeter.report.processor;
+
+import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
+import org.apache.jmeter.report.config.ReportGeneratorConfiguration;
+import org.apache.jmeter.util.JMeterUtils;
+
+/**
+ * The class PercentileAggregator is used to get percentile from samples.
+ *
+ * @since 2.14
+ */
+public class PercentileAggregator implements Aggregator {
+ private static final int SLIDING_WINDOW_SIZE = JMeterUtils.getPropDefault(
+ ReportGeneratorConfiguration.REPORT_GENERATOR_KEY_PREFIX
+ + ReportGeneratorConfiguration.KEY_DELIMITER
+ + "statistic_window", 200000);
+
+ private final DescriptiveStatistics statistics;
+ private final double percentileIndex;
+
+ /**
+ * Instantiates a new percentile aggregator.
+ *
+ * @param index
+ * the index of the percentile
+ */
+ public PercentileAggregator(double index) {
+ statistics = new DescriptiveStatistics(SLIDING_WINDOW_SIZE);
+ percentileIndex = index;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.jmeter.report.core.GraphAggregator#getCount()
+ */
+ @Override
+ public long getCount() {
+ return statistics.getN();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.jmeter.report.core.GraphAggregator#getResult()
+ */
+ @Override
+ public double getResult() {
+ return statistics.getPercentile(percentileIndex);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.jmeter.report.core.GraphAggregator#addValue(double)
+ */
+ @Override
+ public void addValue(double value) {
+ statistics.addValue(value);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.jmeter.report.core.GraphAggregator#reset()
+ */
+ @Override
+ public void reset() {
+ statistics.clear();
+ }
+
+}
Propchange: jmeter/trunk/src/core/org/apache/jmeter/report/processor/PercentileAggregator.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: jmeter/trunk/src/core/org/apache/jmeter/report/processor/PercentileAggregatorFactory.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/PercentileAggregatorFactory.java?rev=1719185&r1=1719184&r2=1719185&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/PercentileAggregatorFactory.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/PercentileAggregatorFactory.java Thu Dec 10 19:10:06 2015
@@ -1,60 +1,60 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.jmeter.report.processor;
-
-/**
- * A factory for creating PercentileAggregator objects.
- *
- * @since 2.14
- */
-public class PercentileAggregatorFactory extends AbstractAggregatorFactory {
-
- private double percentileIndex;
-
- /**
- * Gets the percentile index.
- *
- * @return the percentile index
- */
- public final double getPercentileIndex() {
- return percentileIndex;
- }
-
- /**
- * Sets the percentile index.
- *
- * @param percentileIndex
- * the index of the percentile to set
- */
- public void setPercentileIndex(double percentileIndex) {
- this.percentileIndex = percentileIndex;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.apache.jmeter.report.core.AbstractAggregatorFactory#createAggregator
- * ()
- */
- @Override
- protected Aggregator createAggregator() {
- return new PercentileAggregator(percentileIndex);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.jmeter.report.processor;
+
+/**
+ * A factory for creating PercentileAggregator objects.
+ *
+ * @since 2.14
+ */
+public class PercentileAggregatorFactory extends AbstractAggregatorFactory {
+
+ private double percentileIndex;
+
+ /**
+ * Gets the percentile index.
+ *
+ * @return the percentile index
+ */
+ public final double getPercentileIndex() {
+ return percentileIndex;
+ }
+
+ /**
+ * Sets the percentile index.
+ *
+ * @param percentileIndex
+ * the index of the percentile to set
+ */
+ public void setPercentileIndex(double percentileIndex) {
+ this.percentileIndex = percentileIndex;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.jmeter.report.core.AbstractAggregatorFactory#createAggregator
+ * ()
+ */
+ @Override
+ protected Aggregator createAggregator() {
+ return new PercentileAggregator(percentileIndex);
+ }
+
+}
Propchange: jmeter/trunk/src/core/org/apache/jmeter/report/processor/PercentileAggregatorFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
|