Skip to content
Snippets Groups Projects
Commit 8bfadaea authored by Stanley Feng's avatar Stanley Feng
Browse files

Incorporate CR feedback:

1. Use LinkedList rather than ArrayList for the measurement array in RAW. Update size estimation in documentation in workload_template.

2. Add a new composite measurement type which combines HdrHistogram and RAW.

3. Allow user to optionally disable output of summary stats from the raw measurement class.
parent 8947b1cc
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,7 @@ public class Measurements {
HISTOGRAM,
HDRHISTOGRAM,
HDRHISTOGRAM_AND_HISTOGRAM,
HDRHISTOGRAM_AND_RAW,
TIMESERIES,
RAW
}
......@@ -97,6 +98,10 @@ public class Measurements {
{
_measurementType = MeasurementType.HDRHISTOGRAM_AND_HISTOGRAM;
}
else if (mTypeString.equals("hdrhistogram+raw"))
{
_measurementType = MeasurementType.HDRHISTOGRAM_AND_RAW;
}
else if (mTypeString.equals("timeseries"))
{
_measurementType = MeasurementType.TIMESERIES;
......@@ -139,6 +144,10 @@ public class Measurements {
return new TwoInOneMeasurement(name,
new OneMeasurementHdrHistogram("Hdr"+name, _props),
new OneMeasurementHistogram("Bucket"+name, _props));
case HDRHISTOGRAM_AND_RAW:
return new TwoInOneMeasurement(name,
new OneMeasurementHdrHistogram("Hdr"+name, _props),
new OneMeasurementHistogram("Raw"+name, _props));
case TIMESERIES:
return new OneMeasurementTimeSeries(name, _props);
case RAW:
......
......@@ -22,7 +22,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Properties;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Collections;
import java.util.Comparator;
import com.yahoo.ycsb.measurements.exporter.MeasurementsExporter;
......@@ -77,14 +77,28 @@ public class OneMeasurementRaw extends OneMeasurement {
*/
public static final String OUTPUT_FILE_PATH = "measurement.raw.output_file";
public static final String OUTPUT_FILE_PATH_DEFAULT = "";
/**
* Optionally, user can request to not output summary stats. This is useful
* if the user chains the raw measurement type behind the HdrHistogram type
* which already outputs summary stats. But even in that case, the user may
* still want this class to compute summary stats for them, especially if
* they want accurate computation of percentiles (because percentils computed
* by histogram classes are still approximations).
*/
public static final String NO_SUMMARY_STATS = "measurement.raw.no_summary";
public static final String NO_SUMMARY_STATS_DEFAULT = "false";
private String outputFilePath = "";
private final PrintStream outputStream;
private ArrayList<RawDataPoint> measurements;
private boolean noSummaryStats = false;
private LinkedList<RawDataPoint> measurements;
private long totalLatency = 0;
// A window of stats to print summary for at the next getSummary() call.
// It's supposed to be a one line summary, so we will just print count and
// It's supposed to be a one line summary, so we will just print count and
// average.
private int windowOperations = 0;
private long windowTotalLatency = 0;
......@@ -111,7 +125,11 @@ public class OneMeasurementRaw extends OneMeasurement {
outputStream = System.out;
}
measurements = new ArrayList<RawDataPoint>(1000);
noSummaryStats = Boolean.parseBoolean(props.getProperty(NO_SUMMARY_STATS,
NO_SUMMARY_STATS_DEFAULT));
measurements = new LinkedList<RawDataPoint>();
}
@Override
......@@ -142,7 +160,7 @@ public class OneMeasurementRaw extends OneMeasurement {
int totalOps = measurements.size();
exporter.write(getName(), "Total Operations", totalOps);
if (totalOps > 0) {
if (totalOps > 0 && !noSummaryStats) {
exporter.write(getName(),
"Below is a summary of latency in microseconds:", -1);
exporter.write(getName(), "Average",
......
......@@ -121,11 +121,11 @@ measurementtype=histogram
# "operation, timestamp of the measurement, latency in us"
#
# Raw datapoints are collected in-memory while the test is running. Each
# data point consumes about 20 bytes (including java object overhead).
# data point consumes about 50 bytes (including java object overhead).
# For a typical run of 1 million to 10 million operations, this should
# easily fit into memory. If you plan to do a run with 100s of millions of
# operations, consider increasing your jvm heap size before you enable the
# RAW measurement type, or split the run into multiple runs.
# fit into memory most of the time. If you plan to do 100s of millions of
# operations per run, consider provisioning a machine with larger RAM when using
# the RAW measurement type, or split the run into multiple runs.
#
# Optionally, you can specify an output file to save raw datapoints.
# Otherwise, raw datapoints will be written to stdout.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment