Skip to content

Commit

Permalink
Merge pull request gatling#14 from gcoutant/groups
Browse files Browse the repository at this point in the history
Improve functional groups handling and displaying
  • Loading branch information
Stephane Landelle committed Oct 30, 2012
2 parents 6a46236 + fb7bcae commit 2f3420c
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
//<% import com.excilys.ebi.gatling.charts.report.Container.GROUP %>
//<% import com.excilys.ebi.gatling.charts.report.Container.REQUEST %>

function numberOfRequestsDataForGroup(group) {
var data = {names: [], oks: [], kos: []};

if (group.groups != null) {
$.each(group.groups, function(groupName, group) {
var result = numberOfRequestsDataForGroup(group);
$.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);
});
}

if (group.requests != null) {
$.each(group.requests, function(requestName, request) {
data.names.push(request.path);
data.oks.push(parseInt(request.stats.numberOfRequests.ok));
data.kos.push(parseInt(request.stats.numberOfRequests.ko));
});
}
}
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;
}
Expand Down

0 comments on commit 2f3420c

Please sign in to comment.