Skip to content

Instantly share code, notes, and snippets.

@lacoski
Created August 11, 2019 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lacoski/db9d2f9169506f100eac01565e847bc5 to your computer and use it in GitHub Desktop.
Save lacoski/db9d2f9169506f100eac01565e847bc5 to your computer and use it in GitHub Desktop.
Cách sử dụng Gatling Recorder
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="shortcut icon" type="image/x-icon" href="style/favicon.ico"/>
<link href="style/style.css" rel="stylesheet" type="text/css" />
<link href="style/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/gatling.js"></script>
<script type="text/javascript" src="js/moment.min.js"></script>
<script type="text/javascript" src="js/menu.js"></script>
<script type="text/javascript" src="js/all_sessions.js"></script>
<script type="text/javascript" src="js/stats.js"></script>
<script type="text/javascript" src="js/highstock.js"></script>
<script type="text/javascript" src="js/highcharts-more.js"></script>
<script type="text/javascript" src="js/theme.js"></script>
<script type="text/javascript" src="js/unpack.js"></script>
<title>Gatling Stats - Global Information</title>
</head>
<body>
<div class="frise"></div>
<div class="container details">
<div class="head">
<a class="logo" href="https://gatling.io" target="blank_" title="Gatling Home Page"><img alt="Gatling" src="style/logo.svg"/></a>
<div class="frontline"><a href="https://gatling.io/gatling-frontline/?report" target="_blank">Get more features with Gatling FrontLine</a></div>
</div>
<div class="main">
<div class="cadre">
<div class="onglet">
<img src="style/cible.png" />
<p><span>recordedsimulation</span></p>
</div>
<div class="content">
<div class="sous-menu">
<div class="item ouvert"><a href="index.html">GLOBAL</a></div>
<div class="item "><a id="details_link" href="#">DETAILS</a></div>
<script type="text/javascript">
var timestamp = 1565196216114;
var runStartHumanDate = moment(timestamp).format("YYYY-MM-DD HH:mm:ss Z");
document.writeln("<p class='sim_desc' title='"+ runStartHumanDate +", duration : 19 seconds' data-content=''>");
document.writeln("<b>" + runStartHumanDate + ", duration : 19 seconds </b>");
document.writeln("</p>");
</script>
</div>
<div class="content-in">
<h1><span>> </span>Global Information</h1>
<div class="article">
<div class="schema polar">
<div id="container_number_of_requests"></div>
</div>
<div class="schema demi">
<div id="container_indicators" class="demi"></div>
</div>
<div class="statistics extensible-geant collapsed">
<div class="title">
<div class="right">
<span class="expand-all-button">Expand all groups</span> | <span class="collapse-all-button">Collapse all groups</span>
</div>
<div id="statistics_title" class="title_collapsed">STATISTICS <span>(Click here to show more)</span></div>
</div>
<table id="container_statistics_head" class="statistics-in extensible-geant">
<thead>
<tr>
<th rowspan="2" id="col-1" class="header sortable sorted-up"><span>Requests</span></th>
<th colspan="5" class="header"><span class="executions">Executions</span></th>
<th colspan="8" class="header"><span class="response-time">Response Time (ms)</span></th>
</tr>
<tr>
<th id="col-2" class="header sortable"><span>Total</span></th>
<th id="col-3" class="header sortable"><span>OK</span></th>
<th id="col-4" class="header sortable"><span>KO</span></th>
<th id="col-5" class="header sortable"><span>% KO</span></th>
<th id="col-6" class="header sortable"><span>Cnt/s</span></th>
<th id="col-7" class="header sortable"><span>Min</span></th>
<th id="col-8" class="header sortable"><span>50th pct</span></th>
<th id="col-9" class="header sortable"><span>75th pct</span></th>
<th id="col-10" class="header sortable"><span>95th pct</span></th>
<th id="col-11" class="header sortable"><span>99th pct</span></th>
<th id="col-12" class="header sortable"><span>Max</span></th>
<th id="col-13" class="header sortable"><span>Mean</span></th>
<th id="col-14" class="header sortable"><span>Std Dev</span></th>
</tr>
</thead>
<tbody></tbody>
</table>
<div class="scrollable">
<table id="container_statistics_body" class="statistics-in extensible-geant">
<tbody></tbody>
</table>
</div>
</div>
<div class="schema geant">
<a name="active_users"></a>
<div id="container_active_users" class="geant"></div>
</div>
<div class="schema geant">
<div id="container_distrib" class="geant"></div>
</div>
<div class="schema geant">
<div id="container" class="geant"></div>
</div>
<div class="schema geant">
<a name="requests"></a>
<div id="container_requests" class="geant"></div>
</div>
<div class="schema geant">
<a name="responses"></a>
<div id="container_responses" class="geant"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="nav">
<ul></ul>
</div>
</div>
<script type="text/javascript">
var pageStats = stats.stats;
$(document).ready(function() {
$('.sim_desc').popover({trigger:'hover', placement:'bottom'});
setDetailsLinkUrl();
setGlobalMenu();
setActiveMenu();
fillStats(pageStats);
function numberOfRequestsDataForGroup(group) {
var data = {names: [], oks: [], kos: []};
$.each(group.contents, function(contentName, content) {
if (content.type == 'GROUP') {
var result = numberOfRequestsDataForGroup(content);
data.names = data.names.concat(result.names);
data.oks = data.oks.concat(result.oks);
data.kos = data.kos.concat(result.kos);
}
else if (content.type == 'REQUEST') {
data.names.push(content.path);
data.oks.push(parseInt(content.stats.numberOfRequests.ok));
data.kos.push(parseInt(content.stats.numberOfRequests.ko));
}
});
return data;
}
var numberOfRequestsData = numberOfRequestsDataForGroup(stats);
new Highcharts.Chart({
chart: {
renderTo:'container_number_of_requests',
polar:true,
type:'column',
height:330
},
credits:{
enabled:false
},
title:{
text:'<span class="chart_title">Number of requests</span>',
useHTML: true
},
xAxis:{
tickmarkPlacement:'on',
tickInterval: 1,
categories:numberOfRequestsData.names,
labels:{ enabled:false }
},
yAxis:{
min:0
},
plotOptions:{
series:{
stacking:'normal',
groupPadding:0,
pointPlacement:'on',
shadow: true
}
},
legend: {
borderWidth: 0.5,
borderRadius: 3,
borderColor: 'black',
itemStyle: { fontWeight: "normal" }
},
series:[
{
name:'KO',
data:numberOfRequestsData.kos,
color:"#FF0000"
},
{
name:'OK',
data:numberOfRequestsData.oks,
color:"#4572A7"
}
]
});
Highcharts.setOptions({
global: { useUTC: false }
});
var indicatorsChart = new Highcharts.Chart({
chart: {
renderTo: 'container_indicators',
marginRight: 150
},
credits: { enabled: false },
legend: { enabled: false },
title: { text: 'A title to let highcharts reserve the place for the title set later' },
xAxis: {
categories: [
pageStats.group1.name,
pageStats.group2.name,
pageStats.group3.name,
pageStats.group4.name
]
},
yAxis: {
title: { text: 'Number of Requests' }
},
tooltip: {
formatter: function() {
var s;
if (this.point.name) { // the pie chart
s = ''+ this.point.name +': '+ this.y +'% requests';
} else {
s = ''+ this.y + ' requests';
}
return s;
}
},
plotOptions: {
series: {
stacking: 'normal',
shadow: true
}
},
series: [
{
type: 'column',
data: [{
color: '#A0B228',
y: pageStats.group1.count
},
{
color: '#FFDD00',
y: pageStats.group2.count
},
{
color: '#FF9D00',
y: pageStats.group3.count
},
{
color: '#FF0000',
y: pageStats.group4.count
}]
},
{
type: 'pie',
name: 'Percentages',
data: [
{
name: pageStats.group1.name,
y: pageStats.group1.percentage,
color: '#A0B228'
},
{
name: pageStats.group2.name,
y: pageStats.group2.percentage,
color: '#FFDD00'
},
{
name: pageStats.group3.name,
y: pageStats.group3.percentage,
color: '#FF9D00'
},
{
name: pageStats.group4.name,
y: pageStats.group4.percentage,
color: '#FF0000'
}
],
center: [470, 85],
size: 100,
showInLegend: false,
dataLabels: { enabled: false }
}
]
});
indicatorsChart.setTitle({
text: '<span class="chart_title">Indicators</span>',
useHTML: true
});
$('#container_exceptions').sortable('#container_exceptions');
function shortenNameAndDisplayFullOnHover(name){
if (name.length < 20)
return name;
else
return "<span class='tooltipContent'>"+name+"</span>" + name.substr(0,8)+"..."+name.substr(name.length-8,name.length);
}
function generateHtmlRow(request, level, index, parent, group) {
if (request.name == 'Global Information')
var url = 'index.html';
else
var url = request.pathFormatted + '.html';
if (group)
var expandButtonStyle = '';
else
var expandButtonStyle = ' hidden';
if (request.stats.numberOfRequests.total != 0)
var koPercent = (request.stats.numberOfRequests.ko * 100 / request.stats.numberOfRequests.total).toFixed(0) + '%';
else
var koPercent = '-'
return '<tr id="' + request.pathFormatted + '" class="child-of-' + parent + '"> \
<td class="total col-1"> \
<span id="' + request.pathFormatted + '" style="margin-left: ' + (level * 10) + 'px;" class="expand-button' + expandButtonStyle + '">&nbsp;</span> \
<a href="' + url +'" class="withTooltip">' + shortenNameAndDisplayFullOnHover(request.name) + '</a><span class="value" style="display:none;">' + index + '</span> \
</td> \
<td class="value total col-2">' + request.stats.numberOfRequests.total + '</td> \
<td class="value ok col-3">' + request.stats.numberOfRequests.ok + '</td> \
<td class="value ko col-4">' + request.stats.numberOfRequests.ko + '</td> \
<td class="value ko col-5">' + koPercent + '</td> \
<td class="value total col-6">' + request.stats.meanNumberOfRequestsPerSecond.total + '</td> \
<td class="value total col-7">' + request.stats.minResponseTime.total + '</td> \
<td class="value total col-8">' + request.stats.percentiles1.total + '</td> \
<td class="value total col-9">' + request.stats.percentiles2.total + '</td> \
<td class="value total col-10">' + request.stats.percentiles3.total + '</td> \
<td class="value total col-11">' + request.stats.percentiles4.total + '</td> \
<td class="value total col-12">' + request.stats.maxResponseTime.total + '</td> \
<td class="value total col-13">' + request.stats.meanResponseTime.total + '</td> \
<td class="value total col-14">' + request.stats.standardDeviation.total + '</td> \
</tr>';
}
function generateHtmlRowsForGroup(group, level, index, parent) {
var buffer = '';
if (!parent)
parent = 'ROOT';
else {
buffer += generateHtmlRow(group, level - 1, index, parent, true);
index++;
parent = group.pathFormatted;
}
$.each(group.contents, function(contentName, content) {
if (content.type == 'GROUP') {
var result = generateHtmlRowsForGroup(content, level + 1, index, parent);
buffer += result.html;
index = result.index;
}
else if (content.type == 'REQUEST') {
buffer += generateHtmlRow(content, level, index, parent);
index++;
}
});
return { html: buffer, index: index };
}
$('#container_statistics_head tbody').append(generateHtmlRow(stats, 0, 0));
var lines = generateHtmlRowsForGroup(stats, 0, 0)
$('#container_statistics_body tbody').append(lines.html);
$('#container_statistics_head').sortable('#container_statistics_body');
$('.statistics').expandable();
if (lines.index < 30) {
$('#statistics_title span').attr('style', 'display: none;');
$('#statistics_title').attr('style', 'cursor: auto;')
}
else {
$('#statistics_title').click(function(){
$(this).toggleClass('title_collapsed').toggleClass('title_not_collapsed');
$('#container_statistics_body').parent().toggleClass('scrollable').toggleClass('');
});
}
$('#container_errors').sortable('#container_errors');
allUsersData.yAxis = 0;
var allUsersChart = new Highcharts.StockChart({
chart: {
renderTo: 'container_active_users',
zoomType: 'x'
},
credits: { enabled: false },
legend: {
enabled: true,
floating: true,
align: 'right',
verticalAlign: 'top',
layout: 'vertical',
borderWidth: 0,
itemStyle: { fontWeight: "normal" }
},
title: { text: 'A title to let highcharts reserve the place for the title set later' },
rangeSelector: {
buttonSpacing: 0,
buttonTheme: {
fill: 'LightGrey',
padding: 1,
stroke: 'Black',
'stroke-width': 0.25,
style: {
color: 'Black',
fontWeight: 'bold',
},
states: {
stroke: 'Black',
'stroke-width': 0.25,
hover: {
fill: 'DarkGrey',
style: { color: 'black' }
},
select: {
fill: 'DarkOrange',
style: { color: 'white' }
}
}
},
buttons : [
{
type : 'minute',
count : 1,
text : '1m'
}, {
type : 'minute',
count : 10,
text : '10m'
}, {
type : 'hour',
count : 1,
text : '1h'
}, {
type : 'all',
count : 1,
text : 'All'
}
],
selected : 3,
inputEnabled : false
},
xAxis: {
type: 'datetime',
ordinal: false,
maxZoom: 10000 // three days
},
yAxis: {
title: { text: 'Number of Active Users' },
opposite: false,
min: 0
},
series: [
{
color: '#4572A7',
name: 'RecordedSimulation',
data: [
[1565196218000,1],[1565196219000,1],[1565196220000,1],[1565196221000,1],[1565196222000,1],[1565196223000,1],[1565196224000,1],[1565196225000,1],[1565196226000,1],[1565196227000,1],[1565196228000,1],[1565196229000,1],[1565196230000,1],[1565196231000,1],[1565196232000,1],[1565196233000,1],[1565196234000,1],[1565196235000,1]
],
tooltip: { yDecimals: 0, ySuffix: '', valueDecimals: 0 }},
allUsersData
]
});
allUsersChart.setTitle({
text: '<span class="chart_title">Active Users along the Simulation</span>',
useHTML: true
});
allUsersData.yAxis = 1;
var responseTimeDistributionChart = new Highcharts.Chart({
chart: {
renderTo: 'container_distrib',
type: 'column'
},
credits: {
enabled: false
},
legend: {
enabled: true,
floating: true,
y: -285,
borderWidth: 0,
itemStyle: {
fontWeight: "normal"
}
},
title: {
text: 'A title to let highcharts reserve the place for the title set later'
},
xAxis: {
categories: ['25', '34', '42', '50', '59', '67', '75', '84', '92', '100', '109', '117', '125', '134', '142', '150', '159', '167', '175', '184', '192', '200', '209', '217', '225', '234', '242', '250', '259', '267', '275', '284', '292', '300', '309', '317', '325', '334', '342', '350', '359', '367', '375', '384', '392', '400', '409', '417', '425', '434', '442', '451', '459', '467', '476', '484', '492', '501', '509', '517', '526', '534', '542', '551', '559', '567', '576', '584', '592', '601', '609', '617', '626', '634', '642', '651', '659', '667', '676', '684', '692', '701', '709', '717', '726', '734', '742', '751', '759', '767', '776', '784', '792', '801', '809', '817', '826', '834', '842', '851'],
tickInterval: 20
},
yAxis: {
min: 0,
title: {
text: 'Percentage of Requests'
}
},
tooltip: {
formatter: function() {
return '<b>'+ this.x +' ms</b><br/>'+
this.series.name +': '+ this.y +' %<br/>'+
'Total: '+ this.point.stackTotal + ' %';
}
},
plotOptions: {
series: {
groupPadding: 0,
stacking: 'normal',
shadow: true
}
},
series: [
{
type: 'column',
color: '#4572A7',
name: 'OK',
data: [
41.17,17.64,5.88,5.88,0.0,17.64,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,5.88,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,5.88
],
tooltip: { yDecimals: 0, ySuffix: 'ms' }
},
{
type: 'column',
color: '#FF0000',
name: 'KO',
data: [
0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
],
tooltip: { yDecimals: 0, ySuffix: 'ms' }
}
]
});
responseTimeDistributionChart.setTitle({
text: '<span class="chart_title">Response Time Distribution</span>',
useHTML: true
});
var responseTimePercentiles = unpack([[1565196218,[26,36,47,57,59,61,63,65,67,68]],[1565196219,null],[1565196220,[35,44,53,62,63,65,67,69,70,71]],[1565196221,[21,24,30,38,39,41,43,45,46,47]],[1565196222,null],[1565196223,null],[1565196224,null],[1565196225,null],[1565196226,null],[1565196227,null],[1565196228,[855,855,855,855,855,855,855,855,855,855]],[1565196229,[21,23,35,39,45,51,57,63,68,70]],[1565196230,null],[1565196231,null],[1565196232,null],[1565196233,null],[1565196234,null],[1565196235,[21,25,29,108,123,139,155,171,183,187]]]);
var responseTimeChart = new Highcharts.StockChart({
chart: {
renderTo: 'container',
zoomType: 'x'
},
colors: ['#C4FD90', '#7FF77F', '#6FF2AD', '#60ECE5', '#51A8E7', '#4353E2', '#7335DC', '#BC28D7', '#D11C97', '#C73905', 'Orange'],
credits: { enabled: false },
legend: {
enabled: true,
floating: true,
y: -65,
borderWidth: 0,
itemStyle: { fontWeight: "normal" }
},
title: { text: 'A title to let highcharts reserve the place for the title set later' },
navigator: { baseSeries: 9 },
rangeSelector: {
rangeSelector: { align: "left" },
buttonSpacing: 0,
buttonTheme: {
fill: 'LightGrey',
padding: 1,
stroke: 'Black',
'stroke-width': 0.25,
style: {
color: 'Black',
fontWeight: 'bold',
},
states: {
stroke: 'Black',
'stroke-width': 0.25,
hover: {
fill: 'DarkGrey',
style: { color: 'black' }
},
select: {
fill: 'DarkOrange',
style: { color: 'white' }
}
}
},
buttons : [
{
type : 'minute',
count : 1,
text : '1m'
}, {
type : 'minute',
count : 10,
text : '10m'
}, {
type : 'hour',
count : 1,
text : '1h'
}, {
type : 'all',
count : 1,
text : 'All'
}
],
selected : 3,
inputEnabled : false
},
xAxis: {
type: 'datetime',
ordinal: false,
maxZoom: 10000 // three days
},
yAxis:[
{
min: 0,
title: {
text: 'Response Time (ms)',
style: { color: '#4572A7' }
},
opposite: false
}, {
min: 0,
title: {
text: 'Active Users',
style: { color: '#FF9D00' }
},
opposite: true
}
],
plotOptions: {
arearange: { lineWidth: 1 },
series: {
dataGrouping: { enabled: false }
}
},
series: [
{
pointInterval: 1000,
name: 'min',
data: responseTimePercentiles[0],
tooltip: { yDecimals: 0, ySuffix: 'ms' },
type : 'area',
yAxis: 0,
zIndex: 10
},
{
pointInterval: 1000,
name: '25%',
data: responseTimePercentiles[1],
tooltip: { yDecimals: 0, ySuffix: 'ms' },
type : 'area',
yAxis: 0,
zIndex: 9
},
{
pointInterval: 1000,
name: '50%',
data: responseTimePercentiles[2],
tooltip: { yDecimals: 0, ySuffix: 'ms' },
type : 'area',
yAxis: 0,
zIndex: 8
},
{
pointInterval: 1000,
name: '75%',
data: responseTimePercentiles[3],
tooltip: { yDecimals: 0, ySuffix: 'ms' },
type : 'area',
yAxis: 0,
zIndex: 7
},
{
pointInterval: 1000,
name: '80%',
data: responseTimePercentiles[4],
tooltip: { yDecimals: 0, ySuffix: 'ms' },
type : 'area',
yAxis: 0,
zIndex: 6
},
{
pointInterval: 1000,
name: '85%',
data: responseTimePercentiles[5],
tooltip: { yDecimals: 0, ySuffix: 'ms' },
type : 'area',
yAxis: 0,
zIndex: 5
},
{
pointInterval: 1000,
name: '90%',
data: responseTimePercentiles[6],
tooltip: { yDecimals: 0, ySuffix: 'ms' },
type : 'area',
yAxis: 0,
zIndex: 4
},
{
pointInterval: 1000,
name: '95%',
data: responseTimePercentiles[7],
tooltip: { yDecimals: 0, ySuffix: 'ms' },
type : 'area',
yAxis: 0,
zIndex: 3
},
{
pointInterval: 1000,
name: '99%',
data: responseTimePercentiles[8],
tooltip: { yDecimals: 0, ySuffix: 'ms' },
type : 'area',
yAxis: 0,
zIndex: 2
},
{
pointInterval: 1000,
name: 'max',
data: responseTimePercentiles[9],
tooltip: { yDecimals: 0, ySuffix: 'ms' },
type : 'area',
yAxis: 0,
zIndex: 1
},
allUsersData
]
});
responseTimeChart.setTitle({
text: '<span class="chart_title chart_title_">Response Time Percentiles over Time (OK)</span>',
useHTML: true
});
var container_requests = unpack([[1565196218,[2,0, 2]],[1565196219,[0,0, 0]],[1565196220,[2,0, 2]],[1565196221,[4,0, 4]],[1565196222,[0,0, 0]],[1565196223,[0,0, 0]],[1565196224,[0,0, 0]],[1565196225,[0,0, 0]],[1565196226,[0,0, 0]],[1565196227,[0,0, 0]],[1565196228,[1,0, 1]],[1565196229,[5,0, 5]],[1565196230,[0,0, 0]],[1565196231,[0,0, 0]],[1565196232,[0,0, 0]],[1565196233,[0,0, 0]],[1565196234,[0,0, 0]],[1565196235,[3,0, 3]]]);
var requestsChart = new Highcharts.StockChart({
chart: {
renderTo: 'container_requests',
zoomType: 'x'
},
credits: { enabled: false },
legend: {
enabled: true,
floating: true,
itemDistance: 10,
y: -285,
borderWidth: 0,
itemStyle: { fontWeight: "normal" }
},
title: { text: 'A title to let highcharts reserve the place for the title set later' },
rangeSelector: {
buttonSpacing: 0,
buttonTheme: {
fill: 'LightGrey',
padding: 1,
stroke: 'Black',
'stroke-width': 0.25,
style: {
color: 'Black',
fontWeight: 'bold',
},
states: {
stroke: 'Black',
'stroke-width': 0.25,
hover: {
fill: 'DarkGrey',
style: { color: 'black' }
},
select: {
fill: 'DarkOrange',
style: { color: 'white' }
}
}
},
buttons : [
{
type : 'minute',
count : 1,
text : '1m'
}, {
type : 'minute',
count : 10,
text : '10m'
}, {
type : 'hour',
count : 1,
text : '1h'
}, {
type : 'all',
count : 1,
text : 'All'
}
],
selected : 3,
inputEnabled : false
},
plotOptions: {
series: {
dataGrouping: { enabled: false }
},
area: {
stacking: 'normal'
}
},
xAxis: {
type: 'datetime',
ordinal: false,
maxZoom: 10000 // three days
},
yAxis:[
{
min: 0,
title: {
text: 'Number of requests',
style: { color: '#4572A7' }
},
opposite: false
}, {
min: 0,
title: {
text: 'Active Users',
style: { color: '#FF9D00' }
},
opposite: true
}
],
series: [
{
color: '#4572A7',
name: 'All',
data: container_requests[0],
tooltip: { yDecimals: 0, ySuffix: '', valueDecimals: 0 }
,type: 'area'},
allUsersData
]
});
requestsChart.setTitle({
text: '<span class="chart_title">Number of requests per second</span>',
useHTML: true
});
var container_responses = unpack([[1565196218,[2,0, 2]],[1565196219,[0,0, 0]],[1565196220,[2,0, 2]],[1565196221,[4,0, 4]],[1565196222,[0,0, 0]],[1565196223,[0,0, 0]],[1565196224,[0,0, 0]],[1565196225,[0,0, 0]],[1565196226,[0,0, 0]],[1565196227,[0,0, 0]],[1565196228,[0,0, 0]],[1565196229,[6,0, 6]],[1565196230,[0,0, 0]],[1565196231,[0,0, 0]],[1565196232,[0,0, 0]],[1565196233,[0,0, 0]],[1565196234,[0,0, 0]],[1565196235,[3,0, 3]]]);
var requestsChart = new Highcharts.StockChart({
chart: {
renderTo: 'container_responses',
zoomType: 'x'
},
credits: { enabled: false },
legend: {
enabled: true,
floating: true,
itemDistance: 10,
y: -285,
borderWidth: 0,
itemStyle: { fontWeight: "normal" }
},
title: { text: 'A title to let highcharts reserve the place for the title set later' },
rangeSelector: {
buttonSpacing: 0,
buttonTheme: {
fill: 'LightGrey',
padding: 1,
stroke: 'Black',
'stroke-width': 0.25,
style: {
color: 'Black',
fontWeight: 'bold',
},
states: {
stroke: 'Black',
'stroke-width': 0.25,
hover: {
fill: 'DarkGrey',
style: { color: 'black' }
},
select: {
fill: 'DarkOrange',
style: { color: 'white' }
}
}
},
buttons : [
{
type : 'minute',
count : 1,
text : '1m'
}, {
type : 'minute',
count : 10,
text : '10m'
}, {
type : 'hour',
count : 1,
text : '1h'
}, {
type : 'all',
count : 1,
text : 'All'
}
],
selected : 3,
inputEnabled : false
},
plotOptions: {
series: {
dataGrouping: { enabled: false }
},
area: {
stacking: 'normal'
}
},
xAxis: {
type: 'datetime',
ordinal: false,
maxZoom: 10000 // three days
},
yAxis:[
{
min: 0,
title: {
text: 'Number of responses',
style: { color: '#4572A7' }
},
opposite: false
}, {
min: 0,
title: {
text: 'Active Users',
style: { color: '#FF9D00' }
},
opposite: true
}
],
series: [
{
color: '#4572A7',
name: 'All',
data: container_responses[0],
tooltip: { yDecimals: 0, ySuffix: '', valueDecimals: 0 }
},
{
color: '#FF0000',
name: 'KO',
data: container_responses[1],
tooltip: { yDecimals: 0, ySuffix: '', valueDecimals: 0 }
,type: 'area'},
{
color: '#A0B228',
name: 'OK',
data: container_responses[2],
tooltip: { yDecimals: 0, ySuffix: '', valueDecimals: 0 }
,type: 'area'},
allUsersData,
{
type: 'pie',
name: 'Distribution',
data: [
{name: 'OK', y: 17.0, color: '#A0B228'},{name: 'KO', y: 0.0, color: '#FF0000'}
],
center: [775, -40],
size: 70,
showInLegend: false,
dataLabels: { enabled: false },
dataGrouping: { enabled: false }
}
]
});
requestsChart.setTitle({
text: '<span class="chart_title">Number of responses per second</span>',
useHTML: true
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment