How to get Group Names from DataReader

Browsing around the source code and trying to dump all stats into a single json file. not like currently reports inject all data into htmls and javaScripts.

i found i can get request names from https://github.com/excilys/gatling/blob/master/gatling-core/src/main/scala/io/gatling/core/result/reader/DataReader.scala#L35
def requestNames: List[String]

but i dont see a field i can get groupNames. But in all other methods, group is passed in as a parameter. Any ideas how i can get the groupName return back? Probably my scala is not good enough to understand every detail statement.

Thanks!

I think, best for you is to look at this code sample :

https://github.com/excilys/gatling/blob/master/gatling-charts/src/main/scala/io/gatling/charts/report/RequestDetailsReportGenerator.scala#L120

Does it help ?

cheers
Nicolas

i somehow understand what it does. unfortunately I’m using java and invoke gatling and scala as my library. i use this to get a collection of StatsPath back but dont really know what to proceed:

Collection statsPath = JavaConversions.asJavaCollection(dataReader.statsPaths());
List statsPathList = new ArrayList(statsPath);

from this file: https://github.com/excilys/gatling/blob/master/gatling-core/src/main/scala/io/gatling/core/result/StatsPath.scala, i “feel” RequestStatsPath and GroupsStatsPath are subclasses of StatsPath. My understanding could be wrong…From the collection i get know, how can i get a list of reqeust names and group names?

i figured this out by using instaceof to do the match/case work.

for(int i=0;i<statsPathList.size();i++) {
StatsPath statsPath = statsPathList.get(i);
if(statsPath instanceof GroupStatsPath) {
GroupStatsPath groupStatsPath = (GroupStatsPath) statsPath;
xxxx
}
}

That’s it.

Thanks for keep us posted.
Nicolas