Jazz Register Log in
Jazz Forum Welcome to the Jazz Community Forum

Welcome to the Jazz Community Forum

Connect and collaborate with IBM Engineering experts and users

Speeding up Reportable REST API calls

I have noticed that retrieving attribute data and primary text for all artifacts within a specified module via the Reportable REST Text Endpoint (for example: http://server/rm/publish/text?moduleURI=module) is slow if the module has a lot of artifactsFor example, to pull all artifacts and their attribute values for a module that has 4000 artifacts takes over 5 minutes. Are there any techniques that can be used to speed this up?

0 votes



3 answers

Permanent link
The best way to approach this is using lazy fetches. The Reportable REST API is already set up to do paged fetching, as is the OSLC API, and this is how DNG does it too. 

Users inside the UI will never view the entire contents of a large module on one screen, they will inevitably page or search, so fetch the bare minimum to show an initial overview, and then fetch detail as the user browses to it, storing the data in a local cache. Refresh the cache for single records as the user goes into more detail.

If you watch how DNG does it, the first fetch pulls the basic module information so that you have the total number of artefacts, and enough for a table of contents, then the first page of the view being shown in the module is fetched, and finally the details of the current artefact are fetched if you have the side current artefact panel visible. If you then grab the scroll bar and start moving it down, you see the currently fetched contents scrolling and then it just shows section numbering, unless you pause. Then it fetches the next level of content.

In your case, I suspect you're asking this for your compare widget, so I would fetch the initial content and start your compare at the highest level, then fetch the detail that the user can currently see, and compare that, and then slowly fetch and compare in the background using Promises or async calls.

I'd also have a look at the code for the Module Browser widget supplied in the examples - it may give you some ideas but it may just be fetching the top level only.

1 vote


Permanent link
Yes, there is simple way to improve speed of those reporting calls to DNG. Just use views data schema insteed of module.

Views allows you to get the exact data from the view you have in the DNG. IBM printModuleBook and printModuleTable are created this way.

0 votes

Comments

By "views data schema" are you referring to "module views" referenced in the supported artifacts formats section at the bottom of the  Reportable REST documentation?

Yes, it just makes more sense to get what exactly you need using a view than iterate through all the artifacts one by one.

1 vote

Using the views API, it requires a "projectURI" parameter.  Is there anyway to get this via API? It's not returned by the Get Configuration Context Client API


Permanent link

As Davyd Norris mentioned, you can fetch the artifacts page by page using the "size" and "pos" parameters in your URL. This helps reduce response time and server load.

Example:
http://server/rm/publish/resources?moduleURI=moduleurl&size=1000&pos=0

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,973

Question asked: Jan 31, 10:57 p.m.

Question was seen: 236 times

Last updated: Feb 03, 11:25 a.m.

Confirmation Cancel Confirm