
io.gatling.highcharts.template.RequestDetailsResponseTimeDistributionTemplate.scala Maven / Gradle / Ivy
/**
* Copyright 2011-2016 GatlingCorp (http://gatling.io)
*
* Licensed under the Gatling Highcharts License
*/
package io.gatling.highcharts.template
import com.dongxiguo.fastring.Fastring.Implicits._
import io.gatling.highcharts.series.StackedColumnSeries
object RequestDetailsResponseTimeDistributionTemplate {
val htmlContent = fast"""
"""
}
class RequestDetailsResponseTimeDistributionTemplate(successSeries: StackedColumnSeries, failuresSeries: StackedColumnSeries) extends Template {
val categories = if (!successSeries.getXValues.isEmpty) successSeries.getXValues else failuresSeries.getXValues
def js = fast"""
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: ['${categories.mkFastring("', '")}'],
tickInterval: 20
},
yAxis: {
min: 0,
title: {
text: 'Percentage of Requests'
}
},
tooltip: {
formatter: function() {
return ''+ this.x +' ms
'+
this.series.name +': '+ this.y +' %
'+
'Total: '+ this.point.stackTotal + ' %';
}
},
plotOptions: {
series: {
groupPadding: 0,
stacking: 'normal',
shadow: true
}
},
series: [
{${renderStackedColumnSeries(successSeries)}},
{${renderStackedColumnSeries(failuresSeries)}}
]
});
responseTimeDistributionChart.setTitle({
text: 'Response Time Distribution',
useHTML: true
});
"""
val html = RequestDetailsResponseTimeDistributionTemplate.htmlContent
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy