Skip to content

feature:change getconfig impl to cache locally and update by polling … - #77

Merged
kevinten10 merged 3 commits into
capa-cloud:feature/metricsfrom
reckless11:feature_modify_getconfig_impl
Dec 28, 2021
Merged

feature:change getconfig impl to cache locally and update by polling …#77
kevinten10 merged 3 commits into
capa-cloud:feature/metricsfrom
reckless11:feature_modify_getconfig_impl

Conversation

@reckless11

@reckless11 reckless11 commented Dec 28, 2021

Copy link
Copy Markdown
Contributor

…periodly

Description

当前getconfig是直接调用appconfig sdk获取配置,频繁使用会使用调用费用昂贵。接入方可能不理解此方法的真实使用场景,进行滥用,导致费用飙升。现将里面的逻辑改成和subscribe逻辑一致,自己维护配置的更新,每次返回配置,从本地拉取。

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #76

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • [√ ] Code compiles correctly
  • [√ ] Created/updated tests
  • [ √] Extended the documentation

@codecov-commenter

codecov-commenter commented Dec 28, 2021

Copy link
Copy Markdown

Codecov Report

Merging #77 (0e005b9) into master (384cc0f) will decrease coverage by 1.78%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #77      +/-   ##
============================================
- Coverage     33.92%   32.14%   -1.79%     
+ Complexity       70       69       -1     
============================================
  Files            25       25              
  Lines           731      728       -3     
  Branches         74       73       -1     
============================================
- Hits            248      234      -14     
- Misses          468      480      +12     
+ Partials         15       14       -1     
Impacted Files Coverage Δ
...xcloud/capa/spi/aws/config/AwsCapaConfigStore.java 65.80% <0.00%> (-5.98%) ⬇️
...loud/capa/spi/aws/config/entity/Configuration.java 60.60% <0.00%> (-0.69%) ⬇️
...s/telemetry/metrics/CloudWatchMetricsExporter.java 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 384cc0f...0e005b9. Read the comment docs.

@reckless11
reckless11 changed the base branch from master to feature/metrics December 28, 2021 08:42

@kevinten10 kevinten10 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

urgently

@kevinten10
kevinten10 merged commit a3f2b08 into capa-cloud:feature/metrics Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]:current getconfig may be misused by user which causes high cost

4 participants