correct usage of jacoco agent and dumping via tcp

3,752 views
Skip to first unread message

rupert....@gmail.com

unread,
Aug 16, 2013, 9:51:00 AM8/16/13
to jac...@googlegroups.com
hi,

i try to get the coverage from 2 application servers via tcp dump client, following http://www.intothepool.org/2012/04/jacoco-tcp-server-setup-and-reporting.html. and using marc's example dump code at: http://www.eclemma.org/jacoco/trunk/doc/examples/java/ExecutionDataClient.java.

i'd have two questions:
1. in the documentation i cannot see how often one should start this dump. and how should the dump file handling be? a new file for every run? or it anyway dumps always since start of the server?

2. when listening to 2 different servers, one should store than 2 different dump files even if its the same code base which is running on the application server?

rupert.

Marc R. Hoffmann

unread,
Aug 16, 2013, 6:28:59 PM8/16/13
to jac...@googlegroups.com
Hi Rupert,

the question here is what kind of code coverage report(s) do you want to
generate? A singe one with all coverage data consolidated? Seperate
reports for separate tests?

If you you're interested in a combined report only you can dump all
execution data to the same file. The same consideration applies to the
question when to dump the data: If you need a combined report only it
should be enough to dump the data only once after you executed your tests.

Cheers,
-marc

rupert....@gmail.com

unread,
Aug 19, 2013, 10:55:20 AM8/19/13
to jac...@googlegroups.com
hi marc,

if it makes any sense i'd like to get this into the gradle jacoco plugin, but i have zero experience with it: http://www.gradle.org/docs/current/userguide/jacoco_plugin.html

there should probably a task to collect the data from an agent after the test run. then there should be a task to merge the files. and then one to produce a report.

i am very unsure what configuration parameters should be there:
* a list of urls to collect from so one is able to cover multi tier or clustered setups
* file name(s) to store the data. the original question was directed here: if one calls the dump data again what does it do? it reads everything again? if yes, then it is sufficient to just have one file for one agent which is overwritten.
* exclusions/inclusions to somehow restrict it to the java packages under development and not get all.

rupert.

Marc R. Hoffmann

unread,
Aug 19, 2013, 11:03:27 AM8/19/13
to jac...@googlegroups.com
Hi Rupert,

the Ant tasks already has everything you need (dump, merge, report):

http://www.eclemma.org/jacoco/trunk/doc/ant.html

I have no experience with the gradle plug-in (it is not maintained
here). I recommend to get in touch with the gradle team.

Cheers,
-marc

rupert....@gmail.com

unread,
Aug 19, 2013, 11:31:45 AM8/19/13
to jac...@googlegroups.com
hi marc, i saw now the source code: https://github.com/gradle/gradle/tree/75165d22a318ff0e73c5615038452dce2c16e04b/subprojects/jacoco/src/main/groovy/org/gradle/testing/jacoco. it seems it just calls the ant tasks. and i posted a question, maybe somebody gradle knowledgable has an opinion about it: http://forums.gradle.org/gradle/topics/how_to_best_extend_the_jacoco_plugin .

rupert.

xiongf...@gmail.com

unread,
Jul 15, 2015, 2:52:48 AM7/15/15
to jac...@googlegroups.com

Hi Marc,

I got a question about this here. I'm using tcpclient mode. do you know before I do a dump request, on app server, where are the data stored? in the memory or on the disk? as we're running a great number of auto-test in parallel, the data size will increase quickly. If it's stored in memory before dumping, I'm concerned about the performance as well as a proper dump frequency.

Luka

Evgeny Mandrikov

unread,
Jul 15, 2015, 5:41:43 AM7/15/15
to jac...@googlegroups.com, xiongf...@gmail.com, xiongf...@gmail.com
Hi,

Data is stored in memory. Size of this data is low and proportional to a size and number of instrumented classes. If you have doubts about memory consumption and performance in your environment, then IMO the best thing to do - is to measure in your environment.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages