mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
- add index.html
- add more data to the runs
This commit is contained in:
parent
b2139146d0
commit
84be5370a1
2 changed files with 173 additions and 3 deletions
143
test/speed/index.html
Normal file
143
test/speed/index.html
Normal file
|
@ -0,0 +1,143 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<script src="http://d3js.org/d3.v3.min.js"></script>
|
||||
<style>
|
||||
|
||||
svg {
|
||||
font: 10px sans-serif;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.axis path,
|
||||
.axis line {
|
||||
fill: none;
|
||||
stroke: #000;
|
||||
shape-rendering: crispEdges;
|
||||
}
|
||||
|
||||
.x.axis path {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.line {
|
||||
fill: none;
|
||||
stroke-width: 1.5px;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
var margin = {top: 20, right: 80, bottom: 30, left: 50},
|
||||
width = 960 - margin.left - margin.right,
|
||||
height = 500 - margin.top - margin.bottom;
|
||||
|
||||
var d3_parseDate = d3.time.format("%Y-%m-%dT%H:%M:%S").parse;
|
||||
var parseDate = function(s) {
|
||||
// d3 doesn't doesn't support timezone offset parsing yet
|
||||
// nor subsecond precision.
|
||||
return d3_parseDate(s.replace(/\.[0-9]{3}Z/,""))
|
||||
}
|
||||
|
||||
var x = d3.time.scale()
|
||||
.range([0, width]);
|
||||
|
||||
var y = d3.scale.linear()
|
||||
.range([height, 0]);
|
||||
|
||||
var color = d3.scale.category10()
|
||||
|
||||
var xAxis = d3.svg.axis()
|
||||
.scale(x)
|
||||
.orient("bottom");
|
||||
|
||||
var yAxis = d3.svg.axis()
|
||||
.scale(y)
|
||||
.orient("left");
|
||||
|
||||
var y_element = "rate_1m";
|
||||
var ranges = {
|
||||
count: { x: [0, 300000], y: [0, 5000000] },
|
||||
rate_1m: { x: [0, 300000], y: [0, 25000] }
|
||||
};
|
||||
|
||||
x.domain(ranges[y_element].x);
|
||||
y.domain(ranges[y_element].y);
|
||||
|
||||
var line = d3.svg.line()
|
||||
.x(function(d) { return x(d.timestamp); })
|
||||
.y(function(d) { return y(d[y_element]); });
|
||||
|
||||
var svg = d3.select("body").append("svg")
|
||||
.attr("width", width + margin.left + margin.right)
|
||||
.attr("height", height + margin.top + margin.bottom)
|
||||
.append("g")
|
||||
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
|
||||
|
||||
var graphcsv = function(file) {
|
||||
/* force color allocation now so things are always the same color across
|
||||
* reloads */
|
||||
color(file);
|
||||
d3.csv(file, function(error, data) {
|
||||
points = []
|
||||
|
||||
start_time = parseDate(data[0].timestamp);
|
||||
data.forEach(function(d) {
|
||||
// Relative time against t[0]
|
||||
d.timestamp = parseDate(d.timestamp) - start_time;
|
||||
|
||||
// Relative count against previous (derivative)
|
||||
d[y_element] = parseInt(d[y_element])
|
||||
|
||||
if (!isNaN(d[y_element])) {
|
||||
points.push(d);
|
||||
}
|
||||
});
|
||||
|
||||
//x.domain(d3.extent(points, function(d) { return d.timestamp; }));
|
||||
//y.domain(d3.extent(points, function(d) { return d[y_element]; }));
|
||||
|
||||
svg.append("g")
|
||||
.attr("class", "x axis")
|
||||
.attr("transform", "translate(0," + height + ")")
|
||||
.call(xAxis);
|
||||
|
||||
svg.append("g")
|
||||
.attr("class", "y axis")
|
||||
.call(yAxis)
|
||||
.append("text")
|
||||
.attr("transform", "rotate(-90)")
|
||||
.attr("y", 6)
|
||||
.attr("dy", ".71em")
|
||||
.style("text-anchor", "end")
|
||||
.text("count");
|
||||
|
||||
svg.append("path")
|
||||
.datum(points)
|
||||
.attr("class", "line")
|
||||
.attr("d", line)
|
||||
.style("stroke", function(d) { return color(file) });
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
/* for each row in _index.tsv, graph that name.csv */
|
||||
d3.tsv("_index.tsv", function(error, rows) {
|
||||
rows.forEach(function(d) {
|
||||
file = d.name + ".csv"
|
||||
graphcsv(file)
|
||||
|
||||
/* Add to the legend */
|
||||
d3.select("body").append("div")
|
||||
.style("margin-right", "3em")
|
||||
.style("color", color(file))
|
||||
.style("font-weight", "bold")
|
||||
.text("████ - " + file + ": " + d.env)
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
root=$(dirname $0)/../../
|
||||
workdir="$1"
|
||||
index="$workdir/_index.tsv"
|
||||
|
||||
if [ -z "$workdir" ] ; then
|
||||
echo "Usage: $0 <output dir>"
|
||||
|
@ -11,17 +12,43 @@ fi
|
|||
run() {
|
||||
caller="${FUNCNAME[1]}"
|
||||
out="$workdir/${caller}.csv"
|
||||
|
||||
# record this run's name and arguments
|
||||
echo "$caller $@" >> $index
|
||||
|
||||
# csv header
|
||||
echo "timestamp,count,rate_1m" > $out
|
||||
$root/bin/logstash agent -f <(m4 -DPATH="$out" bench.conf.erb)
|
||||
|
||||
# run logstash
|
||||
env "$@" $root/bin/logstash agent -f <(m4 -DPATH="$out" bench.conf.erb)
|
||||
}
|
||||
|
||||
default() {
|
||||
JRUBY_OPTS= JAVA_OPTS= run
|
||||
run JRUBY_OPTS= JAVA_OPTS=
|
||||
}
|
||||
|
||||
indy() {
|
||||
JRUBY_OPTS="-Xjit.max=100000 -Xcompile.invokedynamic=true -Xcompile.fastest=true" run
|
||||
run JRUBY_OPTS="-Xcompile.invokedynamic=true"
|
||||
}
|
||||
|
||||
gctune() {
|
||||
run JAVA_OPTS="-XX:ReservedCodeCacheSize=128m -XX:+UseBiasedLocking -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=15 -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError"
|
||||
}
|
||||
|
||||
cp index.html $workdir/index.html
|
||||
|
||||
(
|
||||
echo "# logstash perf tests"
|
||||
|
||||
echo "## ruby"
|
||||
ruby -v |& sed -e 's/^/ /'
|
||||
|
||||
echo "## java"
|
||||
java -version |& sed -e 's/^/ /'
|
||||
) > $workdir/README.md
|
||||
|
||||
|
||||
echo "name env" > $index
|
||||
default
|
||||
indy
|
||||
gctune
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue