-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: introduce isyncstore interface (#660)
<!-- Please use this template for your pull request. --> <!-- Please use the sections that you need and delete other sections --> ## This PR <!-- add the description of the PR here --> - decouples the sync store from sync server startup, allowing for alternative sync store implementations to be introduced ### Related Issues <!-- add here the GitHub issue that this PR resolves if applicable --> ### Notes <!-- any additional notes for this PR --> ### Follow-up Tasks <!-- anything that is related to this PR but not done here should be noted under this section --> <!-- if there is a need for a new issue, please link it here --> ### How to test <!-- if applicable, add testing instructions under this section --> --------- Signed-off-by: James Milligan <[email protected]>
- Loading branch information
1 parent
93e708e
commit c0e2fa0
Showing
4 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package store | ||
|
||
import ( | ||
"context" | ||
|
||
isync "github.com/open-feature/flagd/core/pkg/sync" | ||
) | ||
|
||
// ISyncStore defines the interface for the sync store | ||
type ISyncStore interface { | ||
FetchAllFlags( | ||
ctx context.Context, | ||
key interface{}, | ||
target string, | ||
) (isync.DataSync, error) | ||
RegisterSubscription( | ||
ctx context.Context, | ||
target string, | ||
key interface{}, | ||
dataSync chan isync.DataSync, | ||
errChan chan error, | ||
) | ||
|
||
// metrics hooks | ||
GetActiveSubscriptionsInt64() int64 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c0e2fa0
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.
Possible performance regression was detected for benchmark 'Go Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
1.30
.BenchmarkResolveBooleanValue/test_staticBoolFlag
3116
ns/op 304 B/op 7 allocs/op1557
ns/op 304 B/op 7 allocs/op2.00
BenchmarkResolveBooleanValue/test_targetingBoolFlag
19718
ns/op 5025 B/op 83 allocs/op12312
ns/op 5025 B/op 83 allocs/op1.60
BenchmarkResolveBooleanValue/test_staticObjectFlag
2272
ns/op 304 B/op 7 allocs/op1452
ns/op 304 B/op 7 allocs/op1.56
BenchmarkResolveBooleanValue/test_missingFlag
2483
ns/op 368 B/op 9 allocs/op1618
ns/op 368 B/op 9 allocs/op1.53
BenchmarkResolveBooleanValue/test_disabledFlag
2451
ns/op 368 B/op 9 allocs/op1625
ns/op 368 B/op 9 allocs/op1.51
BenchmarkResolveStringValue/test_staticStringFlag
2383
ns/op 336 B/op 9 allocs/op1569
ns/op 336 B/op 9 allocs/op1.52
BenchmarkResolveStringValue/test_targetingStringFlag
20343
ns/op 5049 B/op 85 allocs/op12276
ns/op 5049 B/op 85 allocs/op1.66
BenchmarkResolveStringValue/test_staticObjectFlag
2206
ns/op 304 B/op 7 allocs/op1448
ns/op 304 B/op 7 allocs/op1.52
BenchmarkResolveStringValue/test_missingFlag
2401
ns/op 368 B/op 9 allocs/op1601
ns/op 368 B/op 9 allocs/op1.50
BenchmarkResolveStringValue/test_disabledFlag
2383
ns/op 368 B/op 9 allocs/op1599
ns/op 368 B/op 9 allocs/op1.49
BenchmarkResolveFloatValue/test:_staticFloatFlag
2471
ns/op 320 B/op 9 allocs/op1540
ns/op 320 B/op 9 allocs/op1.60
BenchmarkResolveFloatValue/test:_targetingFloatFlag
20376
ns/op 5049 B/op 85 allocs/op12563
ns/op 5049 B/op 85 allocs/op1.62
BenchmarkResolveFloatValue/test:_staticObjectFlag
2220
ns/op 304 B/op 7 allocs/op1453
ns/op 304 B/op 7 allocs/op1.53
BenchmarkResolveFloatValue/test:_missingFlag
2501
ns/op 368 B/op 9 allocs/op1605
ns/op 368 B/op 9 allocs/op1.56
BenchmarkResolveFloatValue/test:_disabledFlag
2445
ns/op 368 B/op 9 allocs/op1596
ns/op 368 B/op 9 allocs/op1.53
BenchmarkResolveIntValue/test_staticIntFlag
2353
ns/op 304 B/op 7 allocs/op1533
ns/op 304 B/op 7 allocs/op1.53
BenchmarkResolveIntValue/test_targetingNumberFlag
19099
ns/op 5033 B/op 83 allocs/op11266
ns/op 5033 B/op 83 allocs/op1.70
BenchmarkResolveIntValue/test_staticObjectFlag
2212
ns/op 304 B/op 7 allocs/op1437
ns/op 304 B/op 7 allocs/op1.54
BenchmarkResolveIntValue/test_missingFlag
2400
ns/op 352 B/op 9 allocs/op1591
ns/op 352 B/op 9 allocs/op1.51
BenchmarkResolveIntValue/test_disabledFlag
2361
ns/op 368 B/op 9 allocs/op1596
ns/op 368 B/op 9 allocs/op1.48
BenchmarkResolveObjectValue/test_staticObjectFlag
7803
ns/op 1600 B/op 35 allocs/op4979
ns/op 1600 B/op 35 allocs/op1.57
BenchmarkResolveObjectValue/test_targetingObjectFlag
27597
ns/op 6314 B/op 107 allocs/op15781
ns/op 6314 B/op 107 allocs/op1.75
BenchmarkResolveObjectValue/test_staticBoolFlag
2182
ns/op 304 B/op 7 allocs/op1454
ns/op 304 B/op 7 allocs/op1.50
BenchmarkResolveObjectValue/test_missingFlag
2426
ns/op 368 B/op 9 allocs/op1612
ns/op 368 B/op 9 allocs/op1.50
BenchmarkResolveObjectValue/test_disabledFlag
2431
ns/op 368 B/op 9 allocs/op1611
ns/op 368 B/op 9 allocs/op1.51
BenchmarkFlag_Evaluation_ResolveBoolean/happy_path
13982
ns/op 3232 B/op 35 allocs/op8947
ns/op 3232 B/op 35 allocs/op1.56
BenchmarkFlag_Evaluation_ResolveString/happy_path
13857
ns/op 3248 B/op 35 allocs/op9212
ns/op 3248 B/op 35 allocs/op1.50
BenchmarkFlag_Evaluation_ResolveFloat/happy_path
13820
ns/op 3232 B/op 35 allocs/op9000
ns/op 3232 B/op 35 allocs/op1.54
BenchmarkFlag_Evaluation_ResolveInt/happy_path
14415
ns/op 3232 B/op 35 allocs/op8908
ns/op 3232 B/op 35 allocs/op1.62
BenchmarkFlag_Evaluation_ResolveObject/happy_path
17731
ns/op 3656 B/op 42 allocs/op10770
ns/op 3656 B/op 42 allocs/op1.65
This comment was automatically generated by workflow using github-action-benchmark.