The Service Level Management (SLM) module was introduced in NetEye 4.7. Thanks to this module, it is now possible to define customers, service level agreement types and contracts, which permits users to easily manage the agreements they have with their customers in terms of availability of their hosts and services.
Tightly coupled with the SLM module is the Reporting module, in which it is possible to generate reports on the availability contracts defined in the SLM module. Here the user can select a contract of interest and display a graphical representation that shows both if and how well each of the monitored objects associated with a contract has respected that contract in terms of availability.
In the first version of the SLM module, i.e. in NetEye 4.7, the rendering of the reports was performed entirely within the Reporting module. The Reporting module would call the dedicated API “availability_calculation” function of our SLM daemon, which responded with a JSON string containing, for each monitored object and for each period, the number of milliseconds that that particular monitored object spent in each of the various “states” (i.e. available, unavailable, unknown, etc.). Then, within the Reporting module, this JSON was parsed and the HTML needed for rendering the report was built according to the data contained.
The problem that we as the R&D team faced, is that we could not meet the scalability requirements, since an HTML report referring to contracts with thousands of monitored objects and periods could not be produced within a reasonable time frame. After a thorough analysis, we discovered that an important bottleneck was the parsing of the JSON response of the SLM daemon and the subsequent generation of the HTML elements inside the Reporting module.
To resolve this issue in NetEye 4.8 , we decided to move the generation of the SLM reports away from the Reporting module and into the SLM daemon. The latter is then able to specify HTML output instead of JSON in the requests to the “availability_calculation” API. At this point the reporting module only needs to insert the resulting HTML after a predefined report header, and apply the necessary CSS styling to the returned HTML.
In this context, the HTML formatted data is produced much more quickly by the SLM daemon since it’s written in the very efficient “rust” programming language, and since the daemon already has all the necessary information to render the report, which we easily transform into HTML elements with the help of the Handlebars template engine.