This repository has been archived by the owner on Dec 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 240
fix(topcounter): use session cache to store top counter hosts/services results #8189
Merged
Conversation
This file contains 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
loiclau
previously approved these changes
Dec 17, 2019
cgagnaire
changed the title
use session cache to store top counter hosts/services results
fix(topcounter): use session cache to store top counter hosts/services results
Dec 17, 2019
kduret
reviewed
Dec 21, 2019
kduret
suggested changes
Feb 4, 2020
callapa
reviewed
Feb 4, 2020
cgagnaire
added
pr/internal-ps
PR made by the Centreon ProServices Team
status/needs-attention
The PR is on-hold. The reasons are specified in the PR
labels
Feb 6, 2020
sc979
reviewed
Feb 14, 2020
sc979
reviewed
Feb 14, 2020
sc979
previously approved these changes
Feb 14, 2020
sc979
reviewed
Feb 24, 2020
sc979
reviewed
Feb 24, 2020
@@ -612,6 +619,11 @@ public function getServicesStatus() | |||
throw new \RestUnauthorizedException("You're not authorized to access resource datas"); | |||
} | |||
|
|||
if (isset($_SESSION['topCounterServiceStatus']) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a function will avoid to duplicate lines 556->559 & 622->625
sc979
previously approved these changes
Feb 24, 2020
kduret
approved these changes
Mar 5, 2020
sc979
approved these changes
Mar 5, 2020
cgagnaire
added a commit
that referenced
this pull request
Mar 5, 2020
…s results (#8189) * use session cache to store top counter hosts/services results * resolve comments review * enh(performance): session size fix * fix(topcounter): manage reviews * fix topcounters session errors * fix timezone * replace deprecated method * remove useless request to get configuration poller main.cfg * Update moveFiles.php * Update moveFiles.php Co-authored-by: qgarnier <garnier.quentin@gmail.com> Co-authored-by: sc979 <34628915+sc979@users.noreply.github.com> Co-authored-by: Kevin Duret <duret.kevin@gmail.com>
cgagnaire
added a commit
that referenced
this pull request
Mar 5, 2020
…s results (#8189) * use session cache to store top counter hosts/services results * resolve comments review * enh(performance): session size fix * fix(topcounter): manage reviews * fix topcounters session errors * fix timezone * replace deprecated method * remove useless request to get configuration poller main.cfg * Update moveFiles.php * Update moveFiles.php Co-authored-by: qgarnier <garnier.quentin@gmail.com> Co-authored-by: sc979 <34628915+sc979@users.noreply.github.com> Co-authored-by: Kevin Duret <duret.kevin@gmail.com> Conflicts: www/class/centreon.class.php
victorvassilev
added a commit
that referenced
this pull request
Mar 9, 2020
* enh(apiv2): add extra fields to host read endpoint Resolves: MON-4943 * fix(code): Clean switch case service monitoring (#8285) * fix(code): dedicated meta event console does not exist anymore * fix(code): scheduling queue console does not exist anymore * fix(code): merge some cases Co-authored-by: Colin Gagnaire <cgagnaire@centreon.com> * fix(remote-server): fix import with strict mode (#7944) Refs: MON-7944 * Update src/Centreon/Domain/Monitoring/Host.php Co-Authored-By: Kevin Duret <kduret@centreon.com> * Update src/Centreon/Domain/Monitoring/Host.php Co-Authored-By: Kevin Duret <kduret@centreon.com> * doc(api): document how to generate html api documentation (#8394) * fix(topcounter): use session cache to store top counter hosts/services results (#8189) * use session cache to store top counter hosts/services results * resolve comments review * enh(performance): session size fix * fix(topcounter): manage reviews * fix topcounters session errors * fix timezone * replace deprecated method * remove useless request to get configuration poller main.cfg * Update moveFiles.php * Update moveFiles.php Co-authored-by: qgarnier <garnier.quentin@gmail.com> Co-authored-by: sc979 <34628915+sc979@users.noreply.github.com> Co-authored-by: Kevin Duret <duret.kevin@gmail.com> * enh(config): prepare anomalydetection module (#8321) * enh(config): prepare anomalydetection module * Update service.class.php * fix(config): remove dead code Co-authored-by: qgarnier <garnier.quentin@gmail.com> * enh(apiv2): add extra fields to host read endpoint Resolves: MON-4943 * Update src/Centreon/Domain/Monitoring/Host.php Co-Authored-By: Kevin Duret <kduret@centreon.com> * Update src/Centreon/Domain/Monitoring/Host.php Co-Authored-By: Kevin Duret <kduret@centreon.com> * remove api html doc Co-authored-by: Colin Gagnaire <cgagnaire@centreon.com> Co-authored-by: Kevin Duret <kduret@centreon.com> Co-authored-by: qgarnier <garnier.quentin@gmail.com> Co-authored-by: sc979 <34628915+sc979@users.noreply.github.com> Co-authored-by: Kevin Duret <duret.kevin@gmail.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area/performance
kind/enhancement
pr/internal-ps
PR made by the Centreon ProServices Team
status/needs-attention
The PR is on-hold. The reasons are specified in the PR
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.
Pull Request Template
Description
On huge platform with many users (around 200), top counters services/hosts slows overall database real-time performances.
The best solution should have a configuration for read-only mariadb/mysql replicas. Like that we could have many users and we don't slow real time database for centreon-broker. First, It's important for top counters, services monitoring and some widgets. For configuration and graphs, we could do it after.
That solution will take some time. So i have done a patch. It fixes following issue:
I use the session cache to solve the issue.
Fixes # (issue)
Type of change
Target serie
How this pull request can be tested ?
If you call the top counter 2 times in a row, it should provide the same result (there is the 'time' attribute).
Checklist
Community contributors & Centreon team
Centreon team only