It's all about the answers!

Ask a question

How to find number of lines delivered to a stream in RTC?

Anil Joseph (111) | asked May 27 '18, 1:18 p.m.

 Hi Team,

I'm trying to get a matrix out of the number of lines of code delivered to RTC in a given duration (Let's say 1 month).

Any body have any idea, how I can accomplish it?

I thought, there will be some REST APIs already available to get this data. It seems like it's not available.

Any help on this, is greatly appreciated.



2 answers

permanent link
Ralph Schoon (62.3k33643) | answered May 28 '18, 2:20 a.m.

permanent link
Luca Martinucci (1.0k291110) | answered May 28 '18, 3:32 a.m.

I had a similar requirement (see, and, as I figured out that there were no out-of-the-box RTC features that calculated LOC, I developed a custom solution using RTC Plain Java API.

Basically, you must retrieve a stream's history, cycle over the delivered change sets, and, for each change set, retrieve its changes (i.e. the modified or added files).
For each change, extract its contents locally in a temporary file and then count its lines.
If you want to count just the added or modified lines as compared to the previous version, retrieve the file history and extract both the current and the previous version, then compare them.

Your answer

Register or to post your answer.