1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

feat/enable_batch_metrics_for_all (#3027)

Batch Metrics as a capability developed to support the frontend API to
handle more metrics from SDKs without overloading the DB to much. It has
been running in Unleash Cloud for months and has proven to work quite
nice.

This PR simply removes the flag to make the capability GA, also for
self-hosted users.
This commit is contained in:
Ivar Conradi Østhus 2023-02-01 20:50:17 +01:00 committed by GitHub
parent 896994d42f
commit 627958d30f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 20 deletions

View File

@ -69,7 +69,6 @@ exports[`should create default config 1`] = `
"flags": {
"ENABLE_DARK_MODE_SUPPORT": false,
"anonymiseEventLog": false,
"batchMetrics": false,
"caseInsensitiveInOperators": false,
"crOnVariants": false,
"embedProxy": true,
@ -91,7 +90,6 @@ exports[`should create default config 1`] = `
"experiments": {
"ENABLE_DARK_MODE_SUPPORT": false,
"anonymiseEventLog": false,
"batchMetrics": false,
"caseInsensitiveInOperators": false,
"crOnVariants": false,
"embedProxy": true,

View File

@ -95,18 +95,11 @@ export default class ClientMetricsServiceV2 {
no: value.bucket.toggles[name].no,
}));
if (this.config.flagResolver.isEnabled('batchMetrics')) {
this.unsavedMetrics = collapseHourlyMetrics([
...this.unsavedMetrics,
...clientMetrics,
]);
this.lastSeenService.updateLastSeen(clientMetrics);
} else {
if (toggleNames.length > 0) {
await this.featureToggleStore.setLastSeen(toggleNames);
}
await this.clientMetricsStoreV2.batchInsertMetrics(clientMetrics);
}
this.unsavedMetrics = collapseHourlyMetrics([
...this.unsavedMetrics,
...clientMetrics,
]);
this.lastSeenService.updateLastSeen(clientMetrics);
this.config.eventBus.emit(CLIENT_METRICS, value);
}

View File

@ -22,10 +22,6 @@ const flags = {
process.env.UNLEASH_EXPERIMENTAL_EMBED_PROXY_FRONTEND,
true,
),
batchMetrics: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_BATCH_METRICS,
false,
),
responseTimeWithAppName: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_RESPONSE_TIME_WITH_APP_NAME,
false,

View File

@ -36,7 +36,6 @@ process.nextTick(async () => {
flags: {
embedProxy: true,
embedProxyFrontend: true,
batchMetrics: true,
anonymiseEventLog: false,
responseTimeWithAppName: true,
variantsPerEnvironment: true,

View File

@ -26,7 +26,6 @@ export function createTestConfig(config?: IUnleashOptions): IUnleashConfig {
flags: {
embedProxy: true,
embedProxyFrontend: true,
batchMetrics: true,
variantsPerEnvironment: true,
},
},