Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Reduces the Centreon API calls and the SQL cost of the plugin, mainly on the Computer list with the "Centreon Host Status" column.
glpi_plugin_centreon_hosts.centreon_id: the access check no longer scans the whole table.COUNTremoved from the tab label.Session::writeClose()) after the right checks, so a slow Centreon no longer blocks the user's other requests.Schema change: the update adds the
centreon_idindex and now runsexecuteMigration(), which also applies thechangeField()calls added in #60 and never executed until now (centreon_idbecomes unsigned on installs older than 1.0.3).Benchmark
GLPI 11.0.13, 52 000 computers, 50 000 Centreon mappings, Centreon API mocked at 50 ms per call (a real Centreon is usually slower, so the gains on API calls are a lower bound).
On S4, rows examined go from 1 054 557 to 54 520 (54 432 without the plugin) and SQL time from 154 ms to 23 ms; the page displays in 1.4 s instead of 5.7 s.
S4 still makes one Centreon call per displayed row: the remaining ~1.1 s grows with the page size and the Centreon latency; fetching all statuses in one call would be a separate change.
The other pages move within their measurement noise: they keep their Centreon calls, since the login is reused within a request only.