Skip to content

Commit bae6f71

Browse files
Merge branch 'development' into readiness-status
2 parents 1eeff81 + 57e1608 commit bae6f71

16 files changed

+28
-23
lines changed

src/listeners/browser.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { ISettings } from '../types';
99
import SplitIO from '../../types/splitio';
1010
import { ImpressionsPayload } from '../sync/submitters/types';
1111
import { objectAssign } from '../utils/lang/objectAssign';
12-
import { CLEANUP_REGISTERING, CLEANUP_DEREGISTERING } from '../logger/constants';
12+
import { CLEANUP_REGISTERING, CLEANUP_DEREGISTERING, SUBMITTERS_PUSH_PAGE_HIDDEN } from '../logger/constants';
1313
import { ISyncManager } from '../sync/types';
1414
import { isConsentGranted } from '../consent';
1515

@@ -104,6 +104,7 @@ export class BrowserSignalListener implements ISignalListener {
104104
if (!this._sendBeacon(url, dataPayload, extraMetadata)) {
105105
postService(JSON.stringify(dataPayload)).catch(() => { }); // no-op to handle possible promise rejection
106106
}
107+
this.settings.log.debug(SUBMITTERS_PUSH_PAGE_HIDDEN, [cache.name]);
107108
}
108109
}
109110

src/logger/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export const IMPRESSIONS_TRACKER_SUCCESS = 121;
5555
export const USER_CONSENT_UPDATED = 122;
5656
export const USER_CONSENT_NOT_UPDATED = 123;
5757
export const USER_CONSENT_INITIAL = 124;
58+
export const SUBMITTERS_PUSH_PAGE_HIDDEN = 125;
5859

5960
export const ENGINE_VALUE_INVALID = 200;
6061
export const ENGINE_VALUE_NO_ATTRIBUTES = 201;

src/logger/messages/info.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export const codesInfo: [number, string][] = codesWarn.concat([
2525
[c.SYNC_SPLITS_FETCH_RETRY, c.LOG_PREFIX_SYNC_SPLITS + 'Retrying download of feature flags #%s. Reason: %s'],
2626
[c.SUBMITTERS_PUSH_FULL_QUEUE, c.LOG_PREFIX_SYNC_SUBMITTERS + 'Flushing full %s queue and resetting timer.'],
2727
[c.SUBMITTERS_PUSH, c.LOG_PREFIX_SYNC_SUBMITTERS + 'Pushing %s.'],
28+
[c.SUBMITTERS_PUSH_PAGE_HIDDEN, c.LOG_PREFIX_SYNC_SUBMITTERS + 'Flushing %s because page became hidden.'],
2829
[c.STREAMING_REFRESH_TOKEN, c.LOG_PREFIX_SYNC_STREAMING + 'Refreshing streaming token in %s seconds, and connecting streaming in %s seconds.'],
2930
[c.STREAMING_RECONNECT, c.LOG_PREFIX_SYNC_STREAMING + 'Attempting to reconnect streaming in %s seconds.'],
3031
[c.STREAMING_CONNECTING, c.LOG_PREFIX_SYNC_STREAMING + 'Connecting streaming.'],

src/storages/inMemory/EventsCacheInMemory.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const MAX_QUEUE_BYTE_SIZE = 5 * 1024 * 1024; // 5M
55

66
export class EventsCacheInMemory implements IEventsCacheSync {
77

8+
public name = 'events';
89
private onFullQueue?: () => void;
910
private readonly maxQueue: number;
1011
private queue: SplitIO.EventData[];

src/storages/inMemory/ImpressionCountsCacheInMemory.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { DEFAULT_CACHE_SIZE } from '../inRedis/constants';
33
import { IImpressionCountsCacheSync } from '../types';
44

55
export class ImpressionCountsCacheInMemory implements IImpressionCountsCacheSync {
6+
7+
public name = 'impression counts';
68
protected cache: Record<string, number> = {};
79
private readonly maxStorage: number;
810
protected onFullQueue?: () => void;

src/storages/inMemory/ImpressionsCacheInMemory.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import SplitIO from '../../../types/splitio';
33

44
export class ImpressionsCacheInMemory implements IImpressionsCacheSync {
55

6+
public name = 'impressions';
67
private onFullQueue?: () => void;
78
private readonly maxQueue: number;
89
private queue: SplitIO.ImpressionDTO[];

src/storages/inMemory/TelemetryCacheInMemory.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ export function shouldRecordTelemetry({ settings }: IStorageFactoryParams) {
2525

2626
export class TelemetryCacheInMemory implements ITelemetryCacheSync {
2727

28+
public name = 'telemetry stats';
29+
2830
constructor(private splits?: ISplitsCacheSync, private segments?: ISegmentsCacheSync, private largeSegments?: ISegmentsCacheSync) { }
2931

3032
// isEmpty flag

src/storages/inMemory/UniqueKeysCacheInMemory.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { IUniqueKeysCacheBase } from '../types';
1+
import { IUniqueKeysCacheSync } from '../types';
22
import { UniqueKeysPayloadSs } from '../../sync/submitters/types';
33
import { DEFAULT_CACHE_SIZE } from '../inRedis/constants';
44
import { setToArray } from '../../utils/lang/sets';
@@ -22,8 +22,8 @@ export function fromUniqueKeysCollector(uniqueKeys: { [featureName: string]: Set
2222
return { keys: payload };
2323
}
2424

25-
export class UniqueKeysCacheInMemory implements IUniqueKeysCacheBase {
26-
25+
export class UniqueKeysCacheInMemory implements IUniqueKeysCacheSync {
26+
public name = 'unique keys';
2727
protected onFullQueue?: () => void;
2828
private readonly maxStorage: number;
2929
private uniqueTrackerSize = 0;

src/storages/inMemory/UniqueKeysCacheInMemoryCS.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { IUniqueKeysCacheBase } from '../types';
1+
import { IUniqueKeysCacheSync } from '../types';
22
import { UniqueKeysPayloadCs } from '../../sync/submitters/types';
33
import { DEFAULT_CACHE_SIZE } from '../inRedis/constants';
44
import { setToArray } from '../../utils/lang/sets';
55

6-
export class UniqueKeysCacheInMemoryCS implements IUniqueKeysCacheBase {
7-
6+
export class UniqueKeysCacheInMemoryCS implements IUniqueKeysCacheSync {
7+
public name = 'unique keys';
88
private onFullQueue?: () => void;
99
private readonly maxStorage: number;
1010
private uniqueTrackerSize = 0;

src/storages/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ export interface IUniqueKeysCacheBase {
325325

326326
// API methods for sync recorder storages, used by submitters in standalone mode to pop data and post it to Split BE.
327327
export interface IRecorderCacheSync<T> {
328+
name: string,
328329
// @TODO names are inconsistent with spec
329330
/* Checks if cache is empty. Returns true if the cache was just created or cleared */
330331
isEmpty(): boolean

0 commit comments

Comments
 (0)