-
Notifications
You must be signed in to change notification settings - Fork 23
Extract out data store metrics for re-usability #138
Extract out data store metrics for re-usability #138
Conversation
Thank you for opening this pull request! 🙌 These tips will help get your PR across the finish line:
|
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.
looks good, just a few comments
storage/rawstores.go
Outdated
// NewDataStore creates a new Data Store with the supplied config. | ||
func NewDataStore(cfg *Config, metricsScope promutils.Scope) (s *DataStore, err error) { | ||
func NewDataStore(cfg *Config, metrics *DataStoreMetrics) (s *DataStore, err error) { |
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.
let's keep the constructor as is, but also add a method func (d *DataStore) RefreshConfig(cfg *Config) error
that can re-use code defined in this constructor (this shared code can be pulled out to a separate private func for re-use)
Codecov Report
@@ Coverage Diff @@
## master #138 +/- ##
==========================================
+ Coverage 68.75% 68.78% +0.03%
==========================================
Files 69 69
Lines 3405 3418 +13
==========================================
+ Hits 2341 2351 +10
- Misses 905 908 +3
Partials 159 159
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: iaroslav-ciupin <[email protected]>
Signed-off-by: iaroslav-ciupin <[email protected]>
3ee4bf3
to
0a019f9
Compare
Why do we need to do this? It seems it can already be reinitialized - pass a different scope |
Signed-off-by: iaroslav-ciupin <[email protected]>
9cbf247
to
b9fb011
Compare
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.
looks good, just one suggestion
Signed-off-by: iaroslav-ciupin <[email protected]>
Signed-off-by: iaroslav-ciupin <[email protected]>
Congrats on merging your first pull request! 🎉 |
* Extract out data store metrics for re-usability and add RefreshConfig method to DataStore * Add some tests to improve coverage
TL;DR
Adjust DataStore to allow initialising it multiple times during a single application run.
Type
Are all requirements met?
Complete description
How did you fix the bug, make the feature etc. Link to any design docs etc
Tracking Issue
Remove the 'fixes' keyword if there will be multiple PRs to fix the linked issue
fixes https://github.com/flyteorg/flyte/issues/
Follow-up issue
NA
OR
https://github.com/flyteorg/flyte/issues/