${ util.include('header', [title: result?.stats?.component + ' statistics', imports: [ [ type: 'css', content:'.chart-bar-legend { display: block; } .chart-bar-legend > li { width: 100; display: block; padding: 2px; }' ] ]]) }
<% def userConnections = null; def tmp = result.stats.data.findAll { it.var.contains(' user connections') }; if (tmp && !tmp.isEmpty()) { userConnections = [ labels : [], datasets: [[ label: 'User connections', fillColor: "rgba(151,187,205,0.5)", strokeColor: "rgba(151,187,205,0.8)", highlightFill: "rgba(151,187,205,0.75)", highlightStroke: "rgba(151,187,205,1)", data: [] ]] ]; ['Open','Closed','Total','Maximum'].each { name -> userConnections.labels.add(name); userConnections.datasets[0].data.add( Integer.parseInt((tmp.find { it.var.contains(name) }).value) ); } } def userSessions = null; tmp = result.stats.data.findAll { it.var.contains(' user sessions') }; if (tmp && !tmp.isEmpty()) { userSessions = [ labels : [], datasets: [[ label: 'User sessions', fillColor: "rgba(151,187,205,0.5)", strokeColor: "rgba(151,187,205,0.8)", highlightFill: "rgba(151,187,205,0.75)", highlightStroke: "rgba(151,187,205,1)", data: [] ]] ]; ['Open','Total','Maximum'].each { name -> userSessions.labels.add(name); userSessions.datasets[0].data.add( Integer.parseInt((tmp.find { it.var.contains(name) }).value) ); } } def processors = null; tmp = result.stats.data.findAll { it.var.contains('/Processor: ') }; if (tmp && !tmp.isEmpty()) { processors = [ labels : [], datasets : [[ label: 'Processors average processing time', fillColor: "rgba(151,187,205,0.5)", strokeColor: "rgba(151,187,205,0.8)", highlightFill: "rgba(151,187,205,0.75)", highlightStroke: "rgba(151,187,205,1)", data: [] ]] ]; tmp.each { processors.labels.add(it.var.replace(result.stats.component+'/Processor: ', '')); processors.datasets[0].data.add(Integer.parseInt(it.value.split(',')[2].split(':')[1].trim())); } } %>

<% if (userConnections) { %> |  |  | <% } %>

<% def packetsRecvSent = [ labels: ['Packets (total)'], datasets: [[ label: 'Received', fillColor: "rgba(220,220,220,0.5)", strokeColor: "rgba(220,220,220,0.8)", highlightFill: "rgba(220,220,220,0.75)", highlightStroke: "rgba(220,220,220,1)", data: [ Integer.parseInt((result.stats.data.find { it.var == (result.stats.component+'/Packets received') }).value) ] ],[ label: 'Sent', fillColor: "rgba(151,187,205,0.5)", strokeColor: "rgba(151,187,205,0.8)", highlightFill: "rgba(151,187,205,0.75)", highlightStroke: "rgba(151,187,205,1)", data: [ Integer.parseInt((result.stats.data.find { it.var == (result.stats.component+'/Packets sent') }).value) ] ]] ]; def packetsPerInThread = [ labels: [], datasets: [[ label:'Packets per "in" thread', fillColor: "rgba(151,187,205,0.5)", strokeColor: "rgba(151,187,205,0.8)", highlightFill: "rgba(151,187,205,0.75)", highlightStroke: "rgba(151,187,205,1)", data : [] ]] ]; def inData = result.stats.data.findAll { it.var.contains('Processed packets thread: in_') } inData.each { packetsPerInThread.labels.add(it.var.replace(result.stats.component+"/Processed packets thread: ", "")); packetsPerInThread.datasets[0].data.add(Integer.parseInt(it.value)); } def packetsPerOutThread = [ labels: [], datasets: [[ label:'Packets per "out" thread', fillColor: "rgba(151,187,205,0.5)", strokeColor: "rgba(151,187,205,0.8)", highlightFill: "rgba(151,187,205,0.75)", highlightStroke: "rgba(151,187,205,1)", data : [] ]] ]; inData = result.stats.data.findAll { it.var.contains('Processed packets thread: out_') } inData.each { packetsPerOutThread.labels.add(it.var.replace(result.stats.component+"/Processed packets thread: ", "")); packetsPerOutThread.datasets[0].data.add(Integer.parseInt(it.value)); } %>
${ util.include('footer') }