Project

General

Profile

Actions

Feature #31154

closed

Optimize data during report import

Added by Lukas Zapletal about 4 years ago. Updated over 3 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
Reporting
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

When building report.body column which will be likely in JSON format internally, it is not necessary to create another Ruby hash in-memory and then dump it into a string. The body can be built using StringBuilder into buffer, the data format will be very easy (basically text lines with some metadata in the beginning). Reports are then only loaded on per-host per-report basis (e.g. when viewed). This can significantly speed up import time even more.

Also alternative (SAX-like) parsers should be considered when parsing HTTP request input. Rails default JSON request body parsing should definitely be turned off. Example library: https://github.com/dgraham/json-stream


Related issues 1 (1 open0 closed)

Related to Foreman - Tracker #31142: New report model and import/view mechanismNewLukas Zapletal

Actions
Actions

Also available in: Atom PDF