Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⚡ [Datastore] Reduce the number of queries to keep the registry info updates #4081

Conversation

dseurotech
Copy link
Contributor

This pr adds a configuration switch that allows to skip a costly (and potentially unneccesary) fetch from elasticsearch currently performed for each metric not present in the cache (very inefficient in case of device messages with a lot of metrics).
The behaviour can me configured by the following parameter:
datastore.cache.metrics.fetchBeforeUpsert=true
omit the configuration or leave at 'true' to maintain the current behaviour, set to 'false' to skip the fetch

…adding a switch to avoid the fetch and always perform an upsert

Signed-off-by: dseurotech <davide.salvador@eurotech.com>
Copy link

codecov bot commented Jul 11, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.

Project coverage is 52.30%. Comparing base (f15c972) to head (997258e).
Report is 11 commits behind head on release-1.7.x.

Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                 @@
##             release-1.7.x    #4081      +/-   ##
===================================================
- Coverage            52.34%   52.30%   -0.05%     
  Complexity            1864     1864              
===================================================
  Files                 1633     1633              
  Lines                46163    46166       +3     
  Branches              4233     4234       +1     
===================================================
- Hits                 24165    24148      -17     
- Misses               20604    20623      +19     
- Partials              1394     1395       +1     
Files Coverage Δ
...tastore/internal/setting/DatastoreSettingsKey.java 100.00% <100.00%> (ø)
...e/datastore/internal/MetricInfoRegistryFacade.java 65.42% <85.71%> (-0.30%) ⬇️

... and 11 files with indirect coverage changes

@Coduz Coduz added the Enhancement This PR/Issue improves an part of Kapua label Jul 11, 2024
@Coduz Coduz changed the title Datastore - Reduce the number of queries to keep the registry info updates ⚡ [Datastore] Datastore - Reduce the number of queries to keep the registry info updates Jul 11, 2024
@Coduz Coduz merged commit e37c4fe into eclipse:release-1.7.x Jul 11, 2024
25 of 26 checks passed
@Coduz Coduz changed the title ⚡ [Datastore] Datastore - Reduce the number of queries to keep the registry info updates ⚡ [Datastore] Reduce the number of queries to keep the registry info updates Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement This PR/Issue improves an part of Kapua
Projects
Development

Successfully merging this pull request may close these issues.

2 participants