@splitsoftware/splitio-commons 1.6.2-rc.0 → 1.6.2-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.txt +4 -0
- package/cjs/consent/sdkUserConsent.js +2 -2
- package/cjs/evaluator/index.js +15 -16
- package/cjs/integrations/ga/GaToSplit.js +8 -5
- package/cjs/listeners/browser.js +2 -1
- package/cjs/logger/constants.js +2 -1
- package/cjs/sdkClient/client.js +19 -7
- package/cjs/sdkClient/sdkClient.js +3 -1
- package/cjs/sdkFactory/index.js +24 -7
- package/cjs/sdkManager/index.js +3 -11
- package/cjs/services/splitApi.js +24 -4
- package/cjs/storages/AbstractSplitsCacheAsync.js +8 -10
- package/cjs/storages/AbstractSplitsCacheSync.js +8 -10
- package/cjs/storages/KeyBuilderSS.js +54 -9
- package/cjs/storages/dataLoader.js +1 -1
- package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +5 -7
- package/cjs/storages/inLocalStorage/index.js +5 -1
- package/cjs/storages/inMemory/ImpressionCountsCacheInMemory.js +12 -1
- package/cjs/storages/inMemory/InMemoryStorage.js +6 -2
- package/cjs/storages/inMemory/InMemoryStorageCS.js +6 -2
- package/cjs/storages/inMemory/SplitsCacheInMemory.js +7 -10
- package/cjs/storages/inMemory/TelemetryCacheInMemory.js +10 -5
- package/cjs/storages/inMemory/UniqueKeysCacheInMemory.js +73 -0
- package/cjs/storages/inMemory/UniqueKeysCacheInMemoryCS.js +78 -0
- package/cjs/storages/inRedis/EventsCacheInRedis.js +1 -1
- package/cjs/storages/inRedis/ImpressionCountsCacheInRedis.js +50 -0
- package/cjs/storages/inRedis/SplitsCacheInRedis.js +15 -9
- package/cjs/storages/inRedis/TelemetryCacheInRedis.js +100 -0
- package/cjs/storages/inRedis/UniqueKeysCacheInRedis.js +59 -0
- package/cjs/storages/inRedis/constants.js +4 -1
- package/cjs/storages/inRedis/index.js +17 -2
- package/cjs/storages/pluggable/ImpressionCountsCachePluggable.js +43 -0
- package/cjs/storages/pluggable/SplitsCachePluggable.js +14 -9
- package/cjs/storages/pluggable/TelemetryCachePluggable.js +126 -0
- package/cjs/storages/pluggable/UniqueKeysCachePluggable.js +50 -0
- package/cjs/storages/pluggable/index.js +42 -17
- package/cjs/sync/offline/syncTasks/fromObjectSyncTask.js +2 -3
- package/cjs/sync/polling/updaters/splitChangesUpdater.js +1 -1
- package/cjs/sync/submitters/submitterManager.js +3 -0
- package/cjs/sync/submitters/telemetrySubmitter.js +8 -4
- package/cjs/sync/submitters/uniqueKeysSubmitter.js +27 -0
- package/cjs/trackers/impressionsTracker.js +22 -41
- package/cjs/trackers/strategy/strategyDebug.js +25 -0
- package/cjs/trackers/strategy/strategyNone.js +29 -0
- package/cjs/trackers/strategy/strategyOptimized.js +35 -0
- package/cjs/trackers/telemetryTracker.js +6 -0
- package/cjs/trackers/uniqueKeysTracker.js +38 -0
- package/cjs/utils/constants/index.js +4 -2
- package/cjs/utils/lang/maps.js +15 -7
- package/cjs/utils/redis/RedisMock.js +31 -0
- package/cjs/utils/settingsValidation/impressionsMode.js +2 -2
- package/esm/consent/sdkUserConsent.js +2 -2
- package/esm/evaluator/index.js +15 -16
- package/esm/integrations/ga/GaToSplit.js +8 -5
- package/esm/listeners/browser.js +3 -2
- package/esm/logger/constants.js +1 -0
- package/esm/sdkClient/client.js +19 -7
- package/esm/sdkClient/sdkClient.js +3 -1
- package/esm/sdkFactory/index.js +24 -7
- package/esm/sdkManager/index.js +3 -11
- package/esm/services/splitApi.js +24 -4
- package/esm/storages/AbstractSplitsCacheAsync.js +8 -10
- package/esm/storages/AbstractSplitsCacheSync.js +8 -10
- package/esm/storages/KeyBuilderSS.js +50 -8
- package/esm/storages/dataLoader.js +1 -1
- package/esm/storages/inLocalStorage/SplitsCacheInLocal.js +5 -7
- package/esm/storages/inLocalStorage/index.js +6 -2
- package/esm/storages/inMemory/ImpressionCountsCacheInMemory.js +12 -1
- package/esm/storages/inMemory/InMemoryStorage.js +8 -4
- package/esm/storages/inMemory/InMemoryStorageCS.js +7 -3
- package/esm/storages/inMemory/SplitsCacheInMemory.js +7 -10
- package/esm/storages/inMemory/TelemetryCacheInMemory.js +9 -5
- package/esm/storages/inMemory/UniqueKeysCacheInMemory.js +70 -0
- package/esm/storages/inMemory/UniqueKeysCacheInMemoryCS.js +75 -0
- package/esm/storages/inRedis/EventsCacheInRedis.js +1 -1
- package/esm/storages/inRedis/ImpressionCountsCacheInRedis.js +47 -0
- package/esm/storages/inRedis/SplitsCacheInRedis.js +15 -9
- package/esm/storages/inRedis/TelemetryCacheInRedis.js +100 -0
- package/esm/storages/inRedis/UniqueKeysCacheInRedis.js +56 -0
- package/esm/storages/inRedis/constants.js +3 -0
- package/esm/storages/inRedis/index.js +18 -3
- package/esm/storages/pluggable/ImpressionCountsCachePluggable.js +40 -0
- package/esm/storages/pluggable/SplitsCachePluggable.js +14 -9
- package/esm/storages/pluggable/TelemetryCachePluggable.js +126 -0
- package/esm/storages/pluggable/UniqueKeysCachePluggable.js +47 -0
- package/esm/storages/pluggable/index.js +43 -18
- package/esm/sync/offline/syncTasks/fromObjectSyncTask.js +2 -3
- package/esm/sync/polling/updaters/splitChangesUpdater.js +1 -1
- package/esm/sync/submitters/submitterManager.js +3 -0
- package/esm/sync/submitters/telemetrySubmitter.js +9 -5
- package/esm/sync/submitters/uniqueKeysSubmitter.js +23 -0
- package/esm/trackers/impressionsTracker.js +22 -41
- package/esm/trackers/strategy/strategyDebug.js +21 -0
- package/esm/trackers/strategy/strategyNone.js +25 -0
- package/esm/trackers/strategy/strategyOptimized.js +31 -0
- package/esm/trackers/telemetryTracker.js +6 -0
- package/esm/trackers/uniqueKeysTracker.js +34 -0
- package/esm/utils/constants/index.js +2 -0
- package/esm/utils/lang/maps.js +15 -7
- package/esm/utils/redis/RedisMock.js +28 -0
- package/esm/utils/settingsValidation/impressionsMode.js +3 -3
- package/package.json +1 -2
- package/src/consent/sdkUserConsent.ts +2 -2
- package/src/evaluator/index.ts +14 -15
- package/src/integrations/ga/GaToSplit.ts +9 -5
- package/src/integrations/types.ts +2 -1
- package/src/listeners/browser.ts +3 -2
- package/src/logger/constants.ts +1 -0
- package/src/sdkClient/client.ts +21 -8
- package/src/sdkClient/sdkClient.ts +3 -1
- package/src/sdkFactory/index.ts +28 -8
- package/src/sdkFactory/types.ts +7 -4
- package/src/sdkManager/index.ts +3 -12
- package/src/services/splitApi.ts +26 -4
- package/src/services/types.ts +8 -2
- package/src/storages/AbstractSplitsCacheAsync.ts +13 -15
- package/src/storages/AbstractSplitsCacheSync.ts +15 -17
- package/src/storages/KeyBuilderSS.ts +61 -9
- package/src/storages/dataLoader.ts +1 -1
- package/src/storages/inLocalStorage/SplitsCacheInLocal.ts +8 -11
- package/src/storages/inLocalStorage/index.ts +5 -2
- package/src/storages/inMemory/ImpressionCountsCacheInMemory.ts +16 -1
- package/src/storages/inMemory/InMemoryStorage.ts +7 -4
- package/src/storages/inMemory/InMemoryStorageCS.ts +6 -3
- package/src/storages/inMemory/SplitsCacheInMemory.ts +10 -14
- package/src/storages/inMemory/TelemetryCacheInMemory.ts +10 -6
- package/src/storages/inMemory/UniqueKeysCacheInMemory.ts +82 -0
- package/src/storages/inMemory/UniqueKeysCacheInMemoryCS.ts +88 -0
- package/src/storages/inRedis/EventsCacheInRedis.ts +1 -1
- package/src/storages/inRedis/ImpressionCountsCacheInRedis.ts +53 -0
- package/src/storages/inRedis/SplitsCacheInRedis.ts +21 -17
- package/src/storages/inRedis/TelemetryCacheInRedis.ts +122 -2
- package/src/storages/inRedis/UniqueKeysCacheInRedis.ts +65 -0
- package/src/storages/inRedis/constants.ts +3 -0
- package/src/storages/inRedis/index.ts +15 -5
- package/src/storages/pluggable/ImpressionCountsCachePluggable.ts +47 -0
- package/src/storages/pluggable/SplitsCachePluggable.ts +20 -17
- package/src/storages/pluggable/TelemetryCachePluggable.ts +147 -2
- package/src/storages/pluggable/UniqueKeysCachePluggable.ts +56 -0
- package/src/storages/pluggable/index.ts +44 -19
- package/src/storages/types.ts +50 -29
- package/src/sync/offline/syncTasks/fromObjectSyncTask.ts +5 -6
- package/src/sync/polling/updaters/splitChangesUpdater.ts +2 -2
- package/src/sync/submitters/submitterManager.ts +2 -0
- package/src/sync/submitters/telemetrySubmitter.ts +15 -8
- package/src/sync/submitters/types.ts +38 -7
- package/src/sync/submitters/uniqueKeysSubmitter.ts +36 -0
- package/src/trackers/impressionsTracker.ts +27 -48
- package/src/trackers/strategy/strategyDebug.ts +28 -0
- package/src/trackers/strategy/strategyNone.ts +34 -0
- package/src/trackers/strategy/strategyOptimized.ts +42 -0
- package/src/trackers/telemetryTracker.ts +7 -2
- package/src/trackers/types.ts +32 -0
- package/src/trackers/uniqueKeysTracker.ts +48 -0
- package/src/types.ts +1 -1
- package/src/utils/constants/index.ts +2 -0
- package/src/utils/lang/maps.ts +20 -8
- package/src/utils/redis/RedisMock.ts +33 -0
- package/src/utils/settingsValidation/impressionsMode.ts +3 -3
- package/src/utils/settingsValidation/index.ts +1 -0
- package/types/integrations/types.d.ts +2 -1
- package/types/logger/browser/{debugLogger.d.ts → DebugLogger.d.ts} +0 -0
- package/types/logger/browser/{errorLogger.d.ts → ErrorLogger.d.ts} +0 -0
- package/types/logger/browser/{infoLogger.d.ts → InfoLogger.d.ts} +0 -0
- package/types/logger/browser/{warnLogger.d.ts → WarnLogger.d.ts} +0 -0
- package/types/logger/constants.d.ts +1 -0
- package/types/sdkFactory/types.d.ts +4 -2
- package/types/services/types.d.ts +6 -2
- package/types/storages/AbstractSplitsCacheAsync.d.ts +7 -6
- package/types/storages/AbstractSplitsCacheSync.d.ts +6 -6
- package/types/storages/KeyBuilderSS.d.ts +9 -2
- package/types/storages/inLocalStorage/SplitsCacheInLocal.d.ts +3 -4
- package/types/storages/inMemory/ImpressionCountsCacheInMemory.d.ts +5 -1
- package/types/storages/inMemory/SplitsCacheInMemory.d.ts +3 -2
- package/types/storages/inMemory/TelemetryCacheInMemory.d.ts +6 -3
- package/types/storages/inMemory/uniqueKeysCacheInMemory.d.ts +35 -0
- package/types/storages/inMemory/uniqueKeysCacheInMemoryCS.d.ts +37 -0
- package/types/storages/inRedis/EventsCacheInRedis.d.ts +1 -1
- package/types/storages/inRedis/ImpressionCountsCacheInRedis.d.ts +14 -0
- package/types/storages/inRedis/SplitsCacheInRedis.d.ts +6 -5
- package/types/storages/inRedis/TelemetryCacheInRedis.d.ts +16 -1
- package/types/storages/inRedis/constants.d.ts +3 -0
- package/types/storages/inRedis/uniqueKeysCacheInRedis.d.ts +15 -0
- package/types/storages/pluggable/ImpressionCountsCachePluggable.d.ts +14 -0
- package/types/storages/pluggable/SplitsCachePluggable.d.ts +6 -5
- package/types/storages/pluggable/TelemetryCachePluggable.d.ts +17 -1
- package/types/storages/pluggable/UniqueKeysCachePluggable.d.ts +14 -0
- package/types/storages/types.d.ts +38 -25
- package/types/sync/polling/updaters/splitChangesUpdater.d.ts +1 -1
- package/types/sync/submitters/telemetrySubmitter.d.ts +1 -1
- package/types/sync/submitters/types.d.ts +30 -7
- package/types/sync/submitters/uniqueKeysSubmitter.d.ts +0 -8
- package/types/trackers/impressionsTracker.d.ts +4 -6
- package/types/trackers/types.d.ts +27 -0
- package/types/trackers/uniqueKeysTracker.d.ts +3 -3
- package/types/types.d.ts +1 -1
- package/types/utils/constants/index.d.ts +2 -0
- package/types/utils/lang/maps.d.ts +6 -2
- package/types/utils/redis/RedisMock.d.ts +4 -0
- package/src/splitio.d.ts +0 -1602
- package/types/integrations/ga/GaToSplitPlugin.d.ts +0 -3
- package/types/integrations/ga/SplitToGaPlugin.d.ts +0 -4
- package/types/integrations/ga/autoRequire.d.ts +0 -4
- package/types/logger/codes.d.ts +0 -2
- package/types/logger/codesConstants.d.ts +0 -117
- package/types/logger/codesConstantsBrowser.d.ts +0 -2
- package/types/logger/codesConstantsNode.d.ts +0 -14
- package/types/logger/codesDebug.d.ts +0 -1
- package/types/logger/codesDebugBrowser.d.ts +0 -1
- package/types/logger/codesDebugNode.d.ts +0 -1
- package/types/logger/codesError.d.ts +0 -1
- package/types/logger/codesErrorNode.d.ts +0 -1
- package/types/logger/codesInfo.d.ts +0 -1
- package/types/logger/codesWarn.d.ts +0 -1
- package/types/logger/codesWarnNode.d.ts +0 -1
- package/types/logger/debugLogger.d.ts +0 -2
- package/types/logger/errorLogger.d.ts +0 -2
- package/types/logger/infoLogger.d.ts +0 -2
- package/types/logger/messages/debugBrowser.d.ts +0 -1
- package/types/logger/messages/debugNode.d.ts +0 -1
- package/types/logger/messages/errorNode.d.ts +0 -1
- package/types/logger/messages/warnNode.d.ts +0 -1
- package/types/logger/noopLogger.d.ts +0 -2
- package/types/logger/warnLogger.d.ts +0 -2
- package/types/sdkClient/types.d.ts +0 -18
- package/types/sdkFactory/userConsentProps.d.ts +0 -6
- package/types/sdkManager/sdkManagerMethod.d.ts +0 -6
- package/types/storages/getRegisteredSegments.d.ts +0 -10
- package/types/storages/inMemory/CountsCacheInMemory.d.ts +0 -20
- package/types/storages/inMemory/LatenciesCacheInMemory.d.ts +0 -20
- package/types/storages/inMemory/index.d.ts +0 -10
- package/types/storages/inRedis/CountsCacheInRedis.d.ts +0 -9
- package/types/storages/inRedis/LatenciesCacheInRedis.d.ts +0 -9
- package/types/storages/parseSegments.d.ts +0 -6
- package/types/sync/offline/LocalhostFromFile.d.ts +0 -2
- package/types/sync/offline/splitsParser/splitsParserFromFile.d.ts +0 -2
- package/types/sync/polling/syncTasks/splitsSyncTask.copy.d.ts +0 -35
- package/types/sync/polling/syncTasks/splitsSyncTask.morelikeoriginal.d.ts +0 -35
- package/types/sync/streaming/AuthClient/indexV1.d.ts +0 -12
- package/types/sync/streaming/AuthClient/indexV2.d.ts +0 -8
- package/types/sync/streaming/pushManagerCS.d.ts +0 -1
- package/types/sync/streaming/pushManagerNoUsers.d.ts +0 -13
- package/types/sync/streaming/pushManagerSS.d.ts +0 -1
- package/types/sync/submitters/eventsSyncTask.d.ts +0 -8
- package/types/sync/submitters/impressionCountsSyncTask.d.ts +0 -13
- package/types/sync/submitters/impressionsSyncTask.d.ts +0 -14
- package/types/sync/submitters/metricsSyncTask.d.ts +0 -12
- package/types/sync/submitters/submitterSyncTask.d.ts +0 -10
- package/types/sync/submitters/telemetrySyncTask.d.ts +0 -0
- package/types/sync/syncManagerFromFile.d.ts +0 -2
- package/types/sync/syncManagerFromObject.d.ts +0 -2
- package/types/sync/syncManagerOffline.d.ts +0 -9
- package/types/sync/syncTaskComposite.d.ts +0 -5
- package/types/trackers/telemetryRecorder.d.ts +0 -0
- package/types/utils/EventEmitter.d.ts +0 -4
- package/types/utils/consent.d.ts +0 -2
- package/types/utils/lang/errors.d.ts +0 -10
- package/types/utils/murmur3/commons.d.ts +0 -12
- package/types/utils/settingsValidation/buildMetadata.d.ts +0 -3
- package/types/utils/settingsValidation/localhost/index.d.ts +0 -9
- package/types/utils/settingsValidation/logger.d.ts +0 -11
- package/types/utils/settingsValidation/runtime/browser.d.ts +0 -2
- package/types/utils/settingsValidation/runtime/node.d.ts +0 -2
- package/types/utils/settingsValidation/userConsent.d.ts +0 -5
- package/types/utils/timeTracker/index.d.ts +0 -1
|
@@ -20,10 +20,12 @@ export declare type IFetchSplitChanges = (since: number, noCache?: boolean, till
|
|
|
20
20
|
export declare type IFetchSegmentChanges = (since: number, segmentName: string, noCache?: boolean, till?: number) => Promise<IResponse>;
|
|
21
21
|
export declare type IFetchMySegments = (userMatchingKey: string, noCache?: boolean) => Promise<IResponse>;
|
|
22
22
|
export declare type IPostEventsBulk = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
|
|
23
|
+
export declare type IPostUniqueKeysBulkCs = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
|
|
24
|
+
export declare type IPostUniqueKeysBulkSs = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
|
|
23
25
|
export declare type IPostTestImpressionsBulk = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
|
|
24
26
|
export declare type IPostTestImpressionsCount = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
|
|
25
|
-
export declare type IPostMetricsConfig = (body: string) => Promise<IResponse>;
|
|
26
|
-
export declare type IPostMetricsUsage = (body: string) => Promise<IResponse>;
|
|
27
|
+
export declare type IPostMetricsConfig = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
|
|
28
|
+
export declare type IPostMetricsUsage = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
|
|
27
29
|
export interface ISplitApi {
|
|
28
30
|
getSdkAPIHealthCheck: IHealthCheckAPI;
|
|
29
31
|
getEventsAPIHealthCheck: IHealthCheckAPI;
|
|
@@ -32,6 +34,8 @@ export interface ISplitApi {
|
|
|
32
34
|
fetchSegmentChanges: IFetchSegmentChanges;
|
|
33
35
|
fetchMySegments: IFetchMySegments;
|
|
34
36
|
postEventsBulk: IPostEventsBulk;
|
|
37
|
+
postUniqueKeysBulkCs: IPostUniqueKeysBulkCs;
|
|
38
|
+
postUniqueKeysBulkSs: IPostUniqueKeysBulkSs;
|
|
35
39
|
postTestImpressionsBulk: IPostTestImpressionsBulk;
|
|
36
40
|
postTestImpressionsCount: IPostTestImpressionsCount;
|
|
37
41
|
postMetricsConfig: IPostMetricsConfig;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { ISplitsCacheAsync } from './types';
|
|
2
|
+
import { ISplit } from '../dtos/types';
|
|
2
3
|
/**
|
|
3
4
|
* This class provides a skeletal implementation of the ISplitsCacheAsync interface
|
|
4
5
|
* to minimize the effort required to implement this interface.
|
|
5
6
|
*/
|
|
6
7
|
export declare abstract class AbstractSplitsCacheAsync implements ISplitsCacheAsync {
|
|
7
|
-
abstract addSplit(name: string, split:
|
|
8
|
-
abstract addSplits(entries: [string,
|
|
8
|
+
abstract addSplit(name: string, split: ISplit): Promise<boolean>;
|
|
9
|
+
abstract addSplits(entries: [string, ISplit][]): Promise<boolean[] | void>;
|
|
9
10
|
abstract removeSplits(names: string[]): Promise<boolean[] | void>;
|
|
10
|
-
abstract getSplit(name: string): Promise<
|
|
11
|
-
abstract getSplits(names: string[]): Promise<Record<string,
|
|
11
|
+
abstract getSplit(name: string): Promise<ISplit | null>;
|
|
12
|
+
abstract getSplits(names: string[]): Promise<Record<string, ISplit | null>>;
|
|
12
13
|
abstract setChangeNumber(changeNumber: number): Promise<boolean | void>;
|
|
13
14
|
abstract getChangeNumber(): Promise<number>;
|
|
14
|
-
abstract getAll(): Promise<
|
|
15
|
+
abstract getAll(): Promise<ISplit[]>;
|
|
15
16
|
abstract getSplitNames(): Promise<string[]>;
|
|
16
17
|
abstract trafficTypeExists(trafficType: string): Promise<boolean>;
|
|
17
18
|
abstract clear(): Promise<boolean | void>;
|
|
@@ -28,7 +29,7 @@ export declare abstract class AbstractSplitsCacheAsync implements ISplitsCacheAs
|
|
|
28
29
|
* @param {string} name
|
|
29
30
|
* @param {string} defaultTreatment
|
|
30
31
|
* @param {number} changeNumber
|
|
31
|
-
* @returns {Promise} a promise that is resolved once the split kill operation is performed. The fulfillment value is a boolean: `true` if the
|
|
32
|
+
* @returns {Promise} a promise that is resolved once the split kill operation is performed. The fulfillment value is a boolean: `true` if the operation successed updating the split or `false` if no split is updated,
|
|
32
33
|
* for instance, if the `changeNumber` is old, or if the split is not found (e.g., `/splitchanges` hasn't been fetched yet), or if the storage fails to apply the update.
|
|
33
34
|
* The promise will never be rejected.
|
|
34
35
|
*/
|
|
@@ -5,15 +5,15 @@ import { ISplit } from '../dtos/types';
|
|
|
5
5
|
* to minimize the effort required to implement this interface.
|
|
6
6
|
*/
|
|
7
7
|
export declare abstract class AbstractSplitsCacheSync implements ISplitsCacheSync {
|
|
8
|
-
abstract addSplit(name: string, split:
|
|
9
|
-
addSplits(entries: [string,
|
|
8
|
+
abstract addSplit(name: string, split: ISplit): boolean;
|
|
9
|
+
addSplits(entries: [string, ISplit][]): boolean[];
|
|
10
10
|
abstract removeSplit(name: string): boolean;
|
|
11
11
|
removeSplits(names: string[]): boolean[];
|
|
12
|
-
abstract getSplit(name: string):
|
|
13
|
-
getSplits(names: string[]): Record<string,
|
|
12
|
+
abstract getSplit(name: string): ISplit | null;
|
|
13
|
+
getSplits(names: string[]): Record<string, ISplit | null>;
|
|
14
14
|
abstract setChangeNumber(changeNumber: number): boolean;
|
|
15
15
|
abstract getChangeNumber(): number;
|
|
16
|
-
getAll():
|
|
16
|
+
getAll(): ISplit[];
|
|
17
17
|
abstract getSplitNames(): string[];
|
|
18
18
|
abstract trafficTypeExists(trafficType: string): boolean;
|
|
19
19
|
abstract usesSegments(): boolean;
|
|
@@ -30,7 +30,7 @@ export declare abstract class AbstractSplitsCacheSync implements ISplitsCacheSyn
|
|
|
30
30
|
* @param {string} name
|
|
31
31
|
* @param {string} defaultTreatment
|
|
32
32
|
* @param {number} changeNumber
|
|
33
|
-
* @returns {
|
|
33
|
+
* @returns {boolean} `true` if the operation successed updating the split, or `false` if no split is updated,
|
|
34
34
|
* for instance, if the `changeNumber` is old, or if the split is not found (e.g., `/splitchanges` hasn't been fetched yet), or if the storage fails to apply the update.
|
|
35
35
|
*/
|
|
36
36
|
killLocally(name: string, defaultTreatment: string, changeNumber: number): boolean;
|
|
@@ -2,14 +2,21 @@ import { KeyBuilder } from './KeyBuilder';
|
|
|
2
2
|
import { IMetadata } from '../dtos/types';
|
|
3
3
|
import { Method } from '../sync/submitters/types';
|
|
4
4
|
export declare class KeyBuilderSS extends KeyBuilder {
|
|
5
|
-
|
|
5
|
+
latencyPrefix: string;
|
|
6
|
+
exceptionPrefix: string;
|
|
7
|
+
initPrefix: string;
|
|
8
|
+
private versionablePrefix;
|
|
6
9
|
constructor(prefix: string, metadata: IMetadata);
|
|
7
10
|
buildRegisteredSegmentsKey(): string;
|
|
8
11
|
buildImpressionsKey(): string;
|
|
12
|
+
buildImpressionsCountKey(): string;
|
|
13
|
+
buildUniqueKeysKey(): string;
|
|
9
14
|
buildEventsKey(): string;
|
|
10
15
|
searchPatternForSplitKeys(): string;
|
|
11
16
|
buildLatencyKey(method: Method, bucket: number): string;
|
|
12
17
|
buildExceptionKey(method: Method): string;
|
|
13
18
|
buildInitKey(): string;
|
|
14
|
-
private buildVersionablePrefix;
|
|
15
19
|
}
|
|
20
|
+
export declare function parseMetadata(field: string): [metadata: string] | string;
|
|
21
|
+
export declare function parseExceptionField(field: string): [metadata: string, method: Method] | string;
|
|
22
|
+
export declare function parseLatencyField(field: string): [metadata: string, method: Method, bucket: number] | string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ISplitFiltersValidation } from '../../dtos/types';
|
|
1
|
+
import { ISplit, ISplitFiltersValidation } from '../../dtos/types';
|
|
2
2
|
import { AbstractSplitsCacheSync } from '../AbstractSplitsCacheSync';
|
|
3
3
|
import { KeyBuilderCS } from '../KeyBuilderCS';
|
|
4
4
|
import { ILogger } from '../../logger/types';
|
|
@@ -26,9 +26,9 @@ export declare class SplitsCacheInLocal extends AbstractSplitsCacheSync {
|
|
|
26
26
|
* We cannot simply call `localStorage.clear()` since that implies removing user items from the storage.
|
|
27
27
|
*/
|
|
28
28
|
clear(): void;
|
|
29
|
-
addSplit(name: string, split:
|
|
29
|
+
addSplit(name: string, split: ISplit): boolean;
|
|
30
30
|
removeSplit(name: string): boolean;
|
|
31
|
-
getSplit(name: string):
|
|
31
|
+
getSplit(name: string): any;
|
|
32
32
|
setChangeNumber(changeNumber: number): boolean;
|
|
33
33
|
getChangeNumber(): number;
|
|
34
34
|
getSplitNames(): string[];
|
|
@@ -42,7 +42,6 @@ export declare class SplitsCacheInLocal extends AbstractSplitsCacheSync {
|
|
|
42
42
|
checkCache(): boolean;
|
|
43
43
|
/**
|
|
44
44
|
* Clean Splits cache if its `lastUpdated` timestamp is older than the given `expirationTimestamp`,
|
|
45
|
-
* Clean operation (clear) also updates `lastUpdated` timestamp with current time.
|
|
46
45
|
*
|
|
47
46
|
* @param {number | undefined} expirationTimestamp if the value is not a number, data will not be cleaned
|
|
48
47
|
*/
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { IImpressionCountsCacheSync } from '../types';
|
|
2
2
|
export declare class ImpressionCountsCacheInMemory implements IImpressionCountsCacheSync {
|
|
3
|
-
|
|
3
|
+
protected cache: Record<string, number>;
|
|
4
|
+
private readonly maxStorage;
|
|
5
|
+
protected onFullQueue?: () => void;
|
|
6
|
+
private cacheSize;
|
|
7
|
+
constructor(impressionCountsCacheSize?: number);
|
|
4
8
|
/**
|
|
5
9
|
* Builds key to be stored in the cache with the featureName and the timeFrame truncated.
|
|
6
10
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ISplit } from '../../dtos/types';
|
|
1
2
|
import { AbstractSplitsCacheSync } from '../AbstractSplitsCacheSync';
|
|
2
3
|
/**
|
|
3
4
|
* Default ISplitsCacheSync implementation that stores split definitions in memory.
|
|
@@ -9,9 +10,9 @@ export declare class SplitsCacheInMemory extends AbstractSplitsCacheSync {
|
|
|
9
10
|
private changeNumber;
|
|
10
11
|
private splitsWithSegmentsCount;
|
|
11
12
|
clear(): void;
|
|
12
|
-
addSplit(name: string, split:
|
|
13
|
+
addSplit(name: string, split: ISplit): boolean;
|
|
13
14
|
removeSplit(name: string): boolean;
|
|
14
|
-
getSplit(name: string):
|
|
15
|
+
getSplit(name: string): ISplit | null;
|
|
15
16
|
setChangeNumber(changeNumber: number): boolean;
|
|
16
17
|
getChangeNumber(): number;
|
|
17
18
|
getSplitNames(): string[];
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { ImpressionDataType, EventDataType, LastSync, HttpErrors, HttpLatencies, StreamingEvent, Method, OperationType, MethodExceptions, MethodLatencies } from '../../sync/submitters/types';
|
|
2
|
-
import { ITelemetryCacheSync } from '../types';
|
|
2
|
+
import { IStorageFactoryParams, ITelemetryCacheSync } from '../types';
|
|
3
|
+
export declare const MAX_LATENCY_BUCKET_COUNT = 23;
|
|
4
|
+
export declare function newBuckets(): number[];
|
|
3
5
|
/**
|
|
4
|
-
*
|
|
6
|
+
* Record telemetry if mode is not localhost.
|
|
7
|
+
* All factory instances track telemetry on server-side, and 0.1% on client-side.
|
|
5
8
|
*/
|
|
6
|
-
export declare function shouldRecordTelemetry(): boolean;
|
|
9
|
+
export declare function shouldRecordTelemetry(params: IStorageFactoryParams): boolean;
|
|
7
10
|
export declare class TelemetryCacheInMemory implements ITelemetryCacheSync {
|
|
8
11
|
private timeUntilReady?;
|
|
9
12
|
getTimeUntilReady(): number | undefined;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IUniqueKeysCacheBase } from '../types';
|
|
2
|
+
import { ISet } from '../../utils/lang/sets';
|
|
3
|
+
import { UniqueKeysPayloadSs } from '../../sync/submitters/types';
|
|
4
|
+
export declare class UniqueKeysCacheInMemory implements IUniqueKeysCacheBase {
|
|
5
|
+
protected onFullQueue?: () => void;
|
|
6
|
+
private readonly maxStorage;
|
|
7
|
+
private uniqueTrackerSize;
|
|
8
|
+
protected uniqueKeysTracker: {
|
|
9
|
+
[keys: string]: ISet<string>;
|
|
10
|
+
};
|
|
11
|
+
constructor(uniqueKeysQueueSize?: number);
|
|
12
|
+
setOnFullQueueCb(cb: () => void): void;
|
|
13
|
+
/**
|
|
14
|
+
* Store unique keys in sequential order
|
|
15
|
+
* key: string = feature name.
|
|
16
|
+
* value: Set<string> = set of unique keys.
|
|
17
|
+
*/
|
|
18
|
+
track(key: string, featureName: string): void;
|
|
19
|
+
/**
|
|
20
|
+
* Clear the data stored on the cache.
|
|
21
|
+
*/
|
|
22
|
+
clear(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Pop the collected data, used as payload for posting.
|
|
25
|
+
*/
|
|
26
|
+
pop(): UniqueKeysPayloadSs;
|
|
27
|
+
/**
|
|
28
|
+
* Check if the cache is empty.
|
|
29
|
+
*/
|
|
30
|
+
isEmpty(): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Converts `uniqueKeys` data from cache into request payload for SS.
|
|
33
|
+
*/
|
|
34
|
+
private fromUniqueKeysCollector;
|
|
35
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { IUniqueKeysCacheBase } from '../types';
|
|
2
|
+
import { UniqueKeysPayloadCs } from '../../sync/submitters/types';
|
|
3
|
+
export declare class UniqueKeysCacheInMemoryCS implements IUniqueKeysCacheBase {
|
|
4
|
+
private onFullQueue?;
|
|
5
|
+
private readonly maxStorage;
|
|
6
|
+
private uniqueTrackerSize;
|
|
7
|
+
private uniqueKeysTracker;
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param impressionsQueueSize number of queued impressions to call onFullQueueCb.
|
|
11
|
+
* Default value is 0, that means no maximum value, in case we want to avoid this being triggered.
|
|
12
|
+
*/
|
|
13
|
+
constructor(uniqueKeysQueueSize?: number);
|
|
14
|
+
setOnFullQueueCb(cb: () => void): void;
|
|
15
|
+
/**
|
|
16
|
+
* Store unique keys in sequential order
|
|
17
|
+
* key: string = key.
|
|
18
|
+
* value: HashSet<string> = set of split names.
|
|
19
|
+
*/
|
|
20
|
+
track(key: string, featureName: string): void;
|
|
21
|
+
/**
|
|
22
|
+
* Clear the data stored on the cache.
|
|
23
|
+
*/
|
|
24
|
+
clear(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Pop the collected data, used as payload for posting.
|
|
27
|
+
*/
|
|
28
|
+
pop(): UniqueKeysPayloadCs;
|
|
29
|
+
/**
|
|
30
|
+
* Check if the cache is empty.
|
|
31
|
+
*/
|
|
32
|
+
isEmpty(): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Converts `uniqueKeys` data from cache into request payload.
|
|
35
|
+
*/
|
|
36
|
+
private fromUniqueKeysCollector;
|
|
37
|
+
}
|
|
@@ -23,7 +23,7 @@ export declare class EventsCacheInRedis implements IEventsCacheAsync {
|
|
|
23
23
|
drop(count?: number): Promise<any>;
|
|
24
24
|
/**
|
|
25
25
|
* Pop the given number of events from the storage.
|
|
26
|
-
* The returned promise rejects if the
|
|
26
|
+
* The returned promise rejects if the redis operation fails.
|
|
27
27
|
*
|
|
28
28
|
* NOTE: this method doesn't take into account MAX_EVENT_SIZE or MAX_QUEUE_BYTE_SIZE limits.
|
|
29
29
|
* It is the submitter responsability to handle that.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Redis } from 'ioredis';
|
|
2
|
+
import { ILogger } from '../../logger/types';
|
|
3
|
+
import { ImpressionCountsCacheInMemory } from '../inMemory/ImpressionCountsCacheInMemory';
|
|
4
|
+
export declare class ImpressionCountsCacheInRedis extends ImpressionCountsCacheInMemory {
|
|
5
|
+
private readonly log;
|
|
6
|
+
private readonly key;
|
|
7
|
+
private readonly redis;
|
|
8
|
+
private readonly refreshRate;
|
|
9
|
+
private intervalId;
|
|
10
|
+
constructor(log: ILogger, key: string, redis: Redis, impressionCountsCacheSize?: number, refreshRate?: number);
|
|
11
|
+
private postImpressionCountsInRedis;
|
|
12
|
+
start(): void;
|
|
13
|
+
stop(): Promise<boolean | import("ioredis").BooleanResponse | undefined>;
|
|
14
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { KeyBuilderSS } from '../KeyBuilderSS';
|
|
2
2
|
import { Redis } from 'ioredis';
|
|
3
3
|
import { ILogger } from '../../logger/types';
|
|
4
|
+
import { ISplit } from '../../dtos/types';
|
|
4
5
|
import { AbstractSplitsCacheAsync } from '../AbstractSplitsCacheAsync';
|
|
5
6
|
/**
|
|
6
7
|
* ISplitsCacheAsync implementation that stores split definitions in Redis.
|
|
@@ -19,13 +20,13 @@ export declare class SplitsCacheInRedis extends AbstractSplitsCacheAsync {
|
|
|
19
20
|
* The returned promise is resolved when the operation success
|
|
20
21
|
* or rejected if it fails (e.g., redis operation fails)
|
|
21
22
|
*/
|
|
22
|
-
addSplit(name: string, split:
|
|
23
|
+
addSplit(name: string, split: ISplit): Promise<boolean>;
|
|
23
24
|
/**
|
|
24
25
|
* Add a list of splits.
|
|
25
26
|
* The returned promise is resolved when the operation success
|
|
26
27
|
* or rejected if it fails (e.g., redis operation fails)
|
|
27
28
|
*/
|
|
28
|
-
addSplits(entries: [string,
|
|
29
|
+
addSplits(entries: [string, ISplit][]): Promise<boolean[]>;
|
|
29
30
|
/**
|
|
30
31
|
* Remove a given split.
|
|
31
32
|
* The returned promise is resolved when the operation success, with 1 or 0 indicating if the split existed or not.
|
|
@@ -42,7 +43,7 @@ export declare class SplitsCacheInRedis extends AbstractSplitsCacheAsync {
|
|
|
42
43
|
* Get split definition or null if it's not defined.
|
|
43
44
|
* Returned promise is rejected if redis operation fails.
|
|
44
45
|
*/
|
|
45
|
-
getSplit(name: string): Promise<
|
|
46
|
+
getSplit(name: string): Promise<ISplit | null>;
|
|
46
47
|
/**
|
|
47
48
|
* Set till number.
|
|
48
49
|
* The returned promise is resolved when the operation success,
|
|
@@ -63,7 +64,7 @@ export declare class SplitsCacheInRedis extends AbstractSplitsCacheAsync {
|
|
|
63
64
|
* @TODO we need to benchmark which is the maximun number of commands we could
|
|
64
65
|
* pipeline without kill redis performance.
|
|
65
66
|
*/
|
|
66
|
-
getAll(): Promise<
|
|
67
|
+
getAll(): Promise<ISplit[]>;
|
|
67
68
|
/**
|
|
68
69
|
* Get list of split names.
|
|
69
70
|
* The returned promise is resolved with the list of split names,
|
|
@@ -87,5 +88,5 @@ export declare class SplitsCacheInRedis extends AbstractSplitsCacheAsync {
|
|
|
87
88
|
* Fetches multiple splits definitions.
|
|
88
89
|
* Returned promise is rejected if redis operation fails.
|
|
89
90
|
*/
|
|
90
|
-
getSplits(names: string[]): Promise<Record<string,
|
|
91
|
+
getSplits(names: string[]): Promise<Record<string, ISplit | null>>;
|
|
91
92
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ILogger } from '../../logger/types';
|
|
2
|
-
import { Method } from '../../sync/submitters/types';
|
|
2
|
+
import { Method, MultiConfigs, MultiMethodExceptions, MultiMethodLatencies } from '../../sync/submitters/types';
|
|
3
3
|
import { KeyBuilderSS } from '../KeyBuilderSS';
|
|
4
4
|
import { ITelemetryCacheAsync } from '../types';
|
|
5
5
|
import { Redis } from 'ioredis';
|
|
@@ -17,4 +17,19 @@ export declare class TelemetryCacheInRedis implements ITelemetryCacheAsync {
|
|
|
17
17
|
recordLatency(method: Method, latencyMs: number): Promise<number | void>;
|
|
18
18
|
recordException(method: Method): Promise<number | void>;
|
|
19
19
|
recordConfig(): Promise<number | void>;
|
|
20
|
+
/**
|
|
21
|
+
* Pop telemetry latencies.
|
|
22
|
+
* The returned promise rejects if redis operations fail.
|
|
23
|
+
*/
|
|
24
|
+
popLatencies(): Promise<MultiMethodLatencies>;
|
|
25
|
+
/**
|
|
26
|
+
* Pop telemetry exceptions.
|
|
27
|
+
* The returned promise rejects if redis operations fail.
|
|
28
|
+
*/
|
|
29
|
+
popExceptions(): Promise<MultiMethodExceptions>;
|
|
30
|
+
/**
|
|
31
|
+
* Pop telemetry configs.
|
|
32
|
+
* The returned promise rejects if redis operations fail.
|
|
33
|
+
*/
|
|
34
|
+
popConfigs(): Promise<MultiConfigs>;
|
|
20
35
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IUniqueKeysCacheBase } from '../types';
|
|
2
|
+
import { Redis } from 'ioredis';
|
|
3
|
+
import { UniqueKeysCacheInMemory } from '../inMemory/UniqueKeysCacheInMemory';
|
|
4
|
+
import { ILogger } from '../../logger/types';
|
|
5
|
+
export declare class UniqueKeysCacheInRedis extends UniqueKeysCacheInMemory implements IUniqueKeysCacheBase {
|
|
6
|
+
private readonly log;
|
|
7
|
+
private readonly key;
|
|
8
|
+
private readonly redis;
|
|
9
|
+
private readonly refreshRate;
|
|
10
|
+
private intervalId;
|
|
11
|
+
constructor(log: ILogger, key: string, redis: Redis, uniqueKeysQueueSize?: number, refreshRate?: number);
|
|
12
|
+
private postUniqueKeysInRedis;
|
|
13
|
+
start(): void;
|
|
14
|
+
stop(): Promise<boolean | import("ioredis").BooleanResponse | undefined>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ILogger } from '../../logger/types';
|
|
2
|
+
import { ImpressionCountsCacheInMemory } from '../inMemory/ImpressionCountsCacheInMemory';
|
|
3
|
+
import { IPluggableStorageWrapper } from '../types';
|
|
4
|
+
export declare class ImpressionCountsCachePluggable extends ImpressionCountsCacheInMemory {
|
|
5
|
+
private readonly log;
|
|
6
|
+
private readonly key;
|
|
7
|
+
private readonly wrapper;
|
|
8
|
+
private readonly refreshRate;
|
|
9
|
+
private intervalId;
|
|
10
|
+
constructor(log: ILogger, key: string, wrapper: IPluggableStorageWrapper, impressionCountsCacheSize?: number, refreshRate?: number);
|
|
11
|
+
private storeImpressionCounts;
|
|
12
|
+
start(): void;
|
|
13
|
+
stop(): Promise<any>;
|
|
14
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { KeyBuilder } from '../KeyBuilder';
|
|
2
2
|
import { IPluggableStorageWrapper } from '../types';
|
|
3
3
|
import { ILogger } from '../../logger/types';
|
|
4
|
+
import { ISplit } from '../../dtos/types';
|
|
4
5
|
import { AbstractSplitsCacheAsync } from '../AbstractSplitsCacheAsync';
|
|
5
6
|
/**
|
|
6
7
|
* ISplitsCacheAsync implementation for pluggable storages.
|
|
@@ -23,13 +24,13 @@ export declare class SplitsCachePluggable extends AbstractSplitsCacheAsync {
|
|
|
23
24
|
* The returned promise is resolved when the operation success
|
|
24
25
|
* or rejected if it fails (e.g., wrapper operation fails)
|
|
25
26
|
*/
|
|
26
|
-
addSplit(name: string, split:
|
|
27
|
+
addSplit(name: string, split: ISplit): Promise<boolean>;
|
|
27
28
|
/**
|
|
28
29
|
* Add a list of splits.
|
|
29
30
|
* The returned promise is resolved when the operation success
|
|
30
31
|
* or rejected if it fails (e.g., wrapper operation fails)
|
|
31
32
|
*/
|
|
32
|
-
addSplits(entries: [string,
|
|
33
|
+
addSplits(entries: [string, ISplit][]): Promise<boolean[]>;
|
|
33
34
|
/**
|
|
34
35
|
* Remove a given split.
|
|
35
36
|
* The returned promise is resolved when the operation success, with a boolean indicating if the split existed or not.
|
|
@@ -47,19 +48,19 @@ export declare class SplitsCachePluggable extends AbstractSplitsCacheAsync {
|
|
|
47
48
|
* The returned promise is resolved with the split definition or null if it's not defined,
|
|
48
49
|
* or rejected if wrapper operation fails.
|
|
49
50
|
*/
|
|
50
|
-
getSplit(name: string): Promise<
|
|
51
|
+
getSplit(name: string): Promise<ISplit | null>;
|
|
51
52
|
/**
|
|
52
53
|
* Get list of splits.
|
|
53
54
|
* The returned promise is resolved with a map of split names to their split definition or null if it's not defined,
|
|
54
55
|
* or rejected if wrapper operation fails.
|
|
55
56
|
*/
|
|
56
|
-
getSplits(names: string[]): Promise<Record<string,
|
|
57
|
+
getSplits(names: string[]): Promise<Record<string, ISplit | null>>;
|
|
57
58
|
/**
|
|
58
59
|
* Get list of all split definitions.
|
|
59
60
|
* The returned promise is resolved with the list of split definitions,
|
|
60
61
|
* or rejected if wrapper operation fails.
|
|
61
62
|
*/
|
|
62
|
-
getAll(): Promise<
|
|
63
|
+
getAll(): Promise<ISplit[]>;
|
|
63
64
|
/**
|
|
64
65
|
* Get list of split names.
|
|
65
66
|
* The returned promise is resolved with the list of split names,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ILogger } from '../../logger/types';
|
|
2
|
-
import { Method } from '../../sync/submitters/types';
|
|
2
|
+
import { Method, MultiConfigs, MultiMethodExceptions, MultiMethodLatencies } from '../../sync/submitters/types';
|
|
3
3
|
import { KeyBuilderSS } from '../KeyBuilderSS';
|
|
4
4
|
import { IPluggableStorageWrapper, ITelemetryCacheAsync } from '../types';
|
|
5
5
|
export declare class TelemetryCachePluggable implements ITelemetryCacheAsync {
|
|
@@ -15,4 +15,20 @@ export declare class TelemetryCachePluggable implements ITelemetryCacheAsync {
|
|
|
15
15
|
constructor(log: ILogger, keys: KeyBuilderSS, wrapper: IPluggableStorageWrapper);
|
|
16
16
|
recordLatency(method: Method, latencyMs: number): Promise<number | void>;
|
|
17
17
|
recordException(method: Method): Promise<number | void>;
|
|
18
|
+
recordConfig(): Promise<boolean | void>;
|
|
19
|
+
/**
|
|
20
|
+
* Pop telemetry latencies.
|
|
21
|
+
* The returned promise rejects if wrapper operations fail.
|
|
22
|
+
*/
|
|
23
|
+
popLatencies(): Promise<MultiMethodLatencies>;
|
|
24
|
+
/**
|
|
25
|
+
* Pop telemetry exceptions.
|
|
26
|
+
* The returned promise rejects if wrapper operations fail.
|
|
27
|
+
*/
|
|
28
|
+
popExceptions(): Promise<MultiMethodExceptions>;
|
|
29
|
+
/**
|
|
30
|
+
* Pop telemetry configs.
|
|
31
|
+
* The returned promise rejects if wrapper operations fail.
|
|
32
|
+
*/
|
|
33
|
+
popConfigs(): Promise<MultiConfigs>;
|
|
18
34
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IPluggableStorageWrapper, IUniqueKeysCacheBase } from '../types';
|
|
2
|
+
import { UniqueKeysCacheInMemory } from '../inMemory/UniqueKeysCacheInMemory';
|
|
3
|
+
import { ILogger } from '../../logger/types';
|
|
4
|
+
export declare class UniqueKeysCachePluggable extends UniqueKeysCacheInMemory implements IUniqueKeysCacheBase {
|
|
5
|
+
private readonly log;
|
|
6
|
+
private readonly key;
|
|
7
|
+
private readonly wrapper;
|
|
8
|
+
private readonly refreshRate;
|
|
9
|
+
private intervalId;
|
|
10
|
+
constructor(log: ILogger, key: string, wrapper: IPluggableStorageWrapper, uniqueKeysQueueSize?: number, refreshRate?: number);
|
|
11
|
+
storeUniqueKeys(): Promise<any>;
|
|
12
|
+
start(): void;
|
|
13
|
+
stop(): Promise<any>;
|
|
14
|
+
}
|