-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature flags performance improvements
- Loading branch information
Robert
committed
Dec 13, 2024
1 parent
615a965
commit 55498e8
Showing
23 changed files
with
748 additions
and
276 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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,56 @@ | ||
// | ||
// BSGMemoryFeatureFlagStore.h | ||
// Bugsnag | ||
// | ||
// Created by Nick Dowell on 11/11/2021. | ||
// Copyright © 2021 Bugsnag Inc. All rights reserved. | ||
// | ||
|
||
#import "BugsnagInternals.h" | ||
#import "BSGDefines.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
void BSGFeatureFlagStoreAddFeatureFlag(BSGMemoryFeatureFlagStore *store, NSString *name, NSString *_Nullable variant); | ||
|
||
void BSGFeatureFlagStoreAddFeatureFlags(BSGMemoryFeatureFlagStore *store, NSArray<BugsnagFeatureFlag *> *featureFlags); | ||
|
||
void BSGFeatureFlagStoreClear(BSGMemoryFeatureFlagStore *store, NSString *_Nullable name); | ||
|
||
NSArray<NSDictionary *> * BSGFeatureFlagStoreToJSON(BSGMemoryFeatureFlagStore *store); | ||
|
||
BSGMemoryFeatureFlagStore * BSGFeatureFlagStoreFromJSON(id _Nullable json); | ||
BSGMemoryFeatureFlagStore * BSGFeatureFlagStoreWithFlags(NSArray<BugsnagFeatureFlag *> *); | ||
|
||
|
||
BSG_OBJC_DIRECT_MEMBERS | ||
@interface BSGMemoryFeatureFlagStore () | ||
|
||
@property(nonatomic,nonnull,readonly) NSArray<BugsnagFeatureFlag *> * allFlags; | ||
@property(nonatomic) BOOL isMainStore; | ||
|
||
+ (nonnull BSGMemoryFeatureFlagStore *) fromJSON:(nonnull id)json; | ||
+ (nonnull BSGMemoryFeatureFlagStore *)withFlags:(NSArray<BugsnagFeatureFlag *> *)flags; | ||
|
||
- (NSUInteger) count; | ||
|
||
- (void) addFeatureFlag:(nonnull NSString *)name withVariant:(nullable NSString *)variant; | ||
|
||
- (void) addFeatureFlags:(nonnull NSArray<BugsnagFeatureFlag *> *)featureFlags; | ||
|
||
- (void) clear:(nullable NSString *)name; | ||
|
||
- (nonnull NSArray<NSDictionary *> *) toJSON; | ||
|
||
@end | ||
|
||
#pragma mark - | ||
|
||
/** | ||
* Inserts the current feature flags into a crash report. | ||
* | ||
*/ | ||
void BugsnagFeatureFlagsWriteCrashReport(const BSG_KSCrashReportWriter * _Nonnull writer, | ||
bool requiresAsyncSafety); | ||
|
||
NS_ASSUME_NONNULL_END |
Oops, something went wrong.