Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

enh(resource-status): performance optimizations #10323

Merged
merged 2 commits into from
Oct 19, 2021

Conversation

adr-mo
Copy link
Contributor

@adr-mo adr-mo commented Oct 19, 2021

  • Replace INNER JOIN with EXISTS statements
  • Escape '_' character in LIKE statements for metaservices

Tests were done following the following procedure

  • User belonging to several ACL groups with different resource access rights
  • 20 consecutive calls to the API with a different limit set (using JMeter)
  • Tests realized before and after optimizations

Results of the tests

For a small amount of resources (limit 100)

Before: Response Time - 600ms
After: Response Time ~ 450ms

For a large amount of resources (limit 1000)

Before: Response Time - 2s
After: Response Time ~ 1s

Fixes # (issue)

Type of change

  • Patch fixing an issue (non-breaking change)
  • New functionality (non-breaking change)
  • Breaking change (patch or feature) that might cause side effects breaking part of the Software
  • Updating documentation (missing information, typo...)

Target serie

  • 20.04.x
  • 20.10.x
  • 21.04.x
  • 21.10.x (master)

How this pull request can be tested ?

Details in Jira ticket

Checklist

  • I have followed the coding style guidelines provided by Centreon
  • I have commented my code, especially new classes, functions or any legacy code modified. (docblock)
  • I have commented my code, especially hard-to-understand areas of the PR.
  • I have made corresponding changes to the documentation.
  • I have rebased my development branch on the base branch (master, maintenance).

@adr-mo adr-mo requested review from a team, callapa, a-launois and kduret and removed request for a team October 19, 2021 09:10
@sonarqube-decoration
Copy link

@adr-mo adr-mo merged commit b5659b5 into develop Oct 19, 2021
@adr-mo adr-mo deleted the MON-7158-resource-status-performance branch October 19, 2021 12:16
adr-mo added a commit that referenced this pull request Oct 19, 2021
* enh(resource-status): escape "_" character to use indexed search

* enh(resources): use EXISTS statement instead of INNER JOIN
adr-mo added a commit that referenced this pull request Oct 22, 2021
* enh(resource-status): escape "_" character to use indexed search

* enh(resources): use EXISTS statement instead of INNER JOIN
adr-mo added a commit that referenced this pull request Oct 22, 2021
* enh(resource-status): escape "_" character to use indexed search

* enh(resources): use EXISTS statement instead of INNER JOIN
adr-mo added a commit that referenced this pull request Oct 22, 2021
* enh(resource-status): escape "_" character to use indexed search

* enh(resources): use EXISTS statement instead of INNER JOIN
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants