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

Add memoizaion for getConfig #679

Merged

Conversation

th3M1ke
Copy link
Contributor

@th3M1ke th3M1ke commented Jan 15, 2021

Which problem is this PR solving?

Short description of the changes

  • Add memoization for getConfig()

Signed-off-by: Mykhailo Semenchenko <mykhailo.semenchenko@logz.io>
@codecov
Copy link

codecov bot commented Jan 15, 2021

Codecov Report

Merging #679 (cb3cad9) into master (e0ee8eb) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #679      +/-   ##
==========================================
+ Coverage   94.23%   94.26%   +0.03%     
==========================================
  Files         228      228              
  Lines        5930     5931       +1     
  Branches     1492     1492              
==========================================
+ Hits         5588     5591       +3     
+ Misses        304      302       -2     
  Partials       38       38              
Impacted Files Coverage Δ
packages/jaeger-ui/src/utils/config/get-config.tsx 100.00% <100.00%> (ø)
...nents/TracePage/TraceTimelineViewer/SpanBarRow.tsx 79.31% <0.00%> (+6.89%) ⬆️

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 e0ee8eb...cb3cad9. Read the comment docs.

@@ -59,6 +59,7 @@ describe('getConfig()', () => {
let getJaegerUiConfig;

beforeEach(() => {
getConfig.apply({}, []);
Copy link
Member

Choose a reason for hiding this comment

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

what does this do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is reset memoization cache

alexreardon/memoize-one#43

Copy link
Member

Choose a reason for hiding this comment

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

thx. I wish they would've fixed that ticket by adding an explicit method like reset(), much better for readability.

Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

lgtm

@yurishkuro
Copy link
Member

I wonder if #678 requires the opposite, i.e. always re-evaluating the config. @bobrik PTAL

@bobrik
Copy link
Contributor

bobrik commented Jan 15, 2021

I don't think #678 requires re-evaluation. As long as I can have a function stored in a config key, it should be fine.

@yurishkuro yurishkuro merged commit 48956d5 into jaegertracing:master Jan 15, 2021
vvvprabhakar pushed a commit to vvvprabhakar/jaeger-ui that referenced this pull request Jul 4, 2021
Signed-off-by: Mykhailo Semenchenko <mykhailo.semenchenko@logz.io>
Signed-off-by: vvvprabhakar <vvvprabhakar@gmail.com>
vvvprabhakar pushed a commit to vvvprabhakar/jaeger-ui that referenced this pull request Jul 4, 2021
Signed-off-by: Mykhailo Semenchenko <mykhailo.semenchenko@logz.io>
Signed-off-by: vvvprabhakar <vvvprabhakar@gmail.com>
vvvprabhakar pushed a commit to vvvprabhakar/jaeger-ui that referenced this pull request Jul 5, 2021
Signed-off-by: Mykhailo Semenchenko <mykhailo.semenchenko@logz.io>
Signed-off-by: vvvprabhakar <vvvprabhakar@gmail.com>
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.

3 participants