Improve the speed of the ReST API and Service Layer for the requisitions' repositories.

Description

The current WebUI for requisitions works fine for a few requisitions, and a few nodes per requisition.

On those environments with hundreds or thousands of nodes/requisitions, the WebUI is unusable and it takes several minutes to render on each change. For these situations, it is better to use the ReST API directly or provision.pl. Unfortunately, the ReST API is still slow when dealing with big requisitions and/or thousands of requisitions.

There are several strategies for the requisitions' repository management that are not being used. There is one of them designed to maintain a cache in memory that makes the response time almost immediately (FasterFilesystemForeignSourceRepository). This class was using a custom implementation for a Directory Watcher, that works but not for all cases. This class must be redesigned to use the Java7's libraries for file changes watcher.

Also it would be good to be able to select which strategy must be used by Provisiond and the ReST API.

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Alejandro Galue December 23, 2014 at 10:44 AM

On revision 84eb213e53b0946476ee0f922a3f325d950ce7ab for the develop branch, I've refactored the repository code to provide a way to select the strategy to use, and I re-implemented the DirectoryWatcher class using Java7' features to update the cache when a requisition is added, updated or deleted.

On my test lab, I made an experiment using real requisitions from a customer (about 500 requisitions with more than 10000 nodes in total), and the response time is order of magnitudes faster than the default strategy. It feels that the response came almost instantaneously. Now the WebUI is faster (even if it is not designed for big requisitions), and the ReST API is extremely fast, which makes provision.pl a very good option for handling big requisitions.

Because the ReST API is very fast, you can even develop your own UI for managing requisitions, like this:

https://github.com/agalue/OpenNMS-UI-Requisitions

The responsive of that AngularJS application is extremely fast thanks to the changes introduced.

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

PagerDuty

Created December 23, 2014 at 10:40 AM
Updated December 23, 2014 at 10:44 AM
Resolved December 23, 2014 at 10:44 AM