Skip to content

Commit

Permalink
Add pcre benchmark to chart
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed May 22, 2014
1 parent fa6a7b7 commit ebf5282
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 15 deletions.
46 changes: 31 additions & 15 deletions bench.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
legend: {
align: 'left',
verticalAlign: 'top',
y: 20,
y: 50,
x: 100,
floating: true,
borderWidth: 0
},
Expand All @@ -73,6 +74,7 @@
},

plotOptions: {
/*
area: {
fillColor: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1},
Expand All @@ -92,28 +94,42 @@
},
threshold: null
}
*/
},

series: [{
type: 'area',
name: 'Speed',
pointInterval: 1000,
lineWidth: 2,
marker: {
radius: 3
series: [
{
type: 'area',
name: '/qux/bar/corge',
pointInterval: 1000,
lineWidth: 2,
marker: {
radius: 3
},
pointStart: Date.UTC(2014, 5, 16),
data: []
},
pointStart: Date.UTC(2014, 5, 16),
data: []
}]
{
type: 'area',
name: '/post/{year}/{month}',
pointInterval: 1000,
lineWidth: 2,
marker: {
radius: 3
},
pointStart: Date.UTC(2014, 5, 16),
data: []
}
]
};

var lines = data.split(/\n/);
$(lines).each(function(i,line) {
var columns = line.split(/,/);
var i = parseInt(columns[1]);
if(i) {
options.series[0].data.push(i);
}
var str_i = parseInt(columns[1]);
var pcre_i = parseInt(columns[2]);
options.series[0].data.push(str_i || 0);
options.series[1].data.push(pcre_i || 0);
});

$('#chart').highcharts(options);
Expand Down
2 changes: 2 additions & 0 deletions tests/bench_str.csv
Original file line number Diff line number Diff line change
Expand Up @@ -444,3 +444,5 @@
1400681414,10832905.89
1400685490,13185955.87
1400762875,10472029.42
1400764426,10066458.45,1590373.41
1400765068,10657617.64,2131810.12

0 comments on commit ebf5282

Please sign in to comment.