Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Improve performance of fetching contributor details using Java RTC API

 Hi,


I'm using code largely based off of the following blog post:


In our test environments it worked fine, however in production environments with projects that have thousands of users the performance is much much slower.

I ran the code attached to the above blog post (20121209_AnalyzeProjectAreaContributorsAndRoles.zip) and it took over 19 minutes to fetch about 7000 users in one project.

My code takes about 6 minutes to similar fetch details about users in a project (user id and user name):

public Map<String, String> getUsers(ITeamRepository repo, IProjectArea projectArea) throws TeamRepositoryException{
IProcessArea processArea = (IProcessArea) projectArea;

Map<String, String> users = new LinkedHashMap<String, String>();
LOGGER.info("Users-------------------------");

for (IContributorHandle m : processArea.getMembers()) {
IContributor contributor = (IContributor) repo.itemManager()
.fetchCompleteItem(m, IItemManager.DEFAULT, null);
users.put(contributor.getUserId(), contributor.getName());
LOGGER.info(contributor.getName());

}

LOGGER.info("Admin-------------------------");
for (IContributorHandle m : processArea.getAdministrators()) {
IContributor contributor = (IContributor) repo.itemManager()
.fetchCompleteItem(m, IItemManager.DEFAULT, null);
users.put(contributor.getUserId(), contributor.getName());
LOGGER.info(contributor.getName());
}


Is there anyway to improve it, such as by mass fetching all the users in a project at once, and not one by one?

0 votes



One answer

Permanent link

 Utilize fetchCompleteItems method for quicker results. 

If only partial data is ultimately required, use fetchPartialItems from the same itemManager interface of team repository interface.

More speed can be got by using an executor service, to have two tasks, to get data for members and administrators.

If speed is only your concern, you use a GET Httpconnection to query RPT Rest service of your server, to quickly get user information in XML format and its response is generally way fast than plain Java API, as the results are processed and formatted at server side itself.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,941

Question asked: Jun 09 '20, 11:59 a.m.

Question was seen: 1,884 times

Last updated: Jun 14 '20, 10:07 p.m.

Confirmation Cancel Confirm