mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
fix: remove 'fixHourMetrics' flag
This commit is contained in:
parent
0c2a67f1dc
commit
325cd34c0c
@ -73,7 +73,6 @@ exports[`should create default config 1`] = `
|
||||
"cloneEnvironment": false,
|
||||
"embedProxy": false,
|
||||
"embedProxyFrontend": false,
|
||||
"fixHourMetrics": false,
|
||||
"publicSignup": false,
|
||||
"responseTimeWithAppName": false,
|
||||
"syncSSOGroups": false,
|
||||
@ -88,7 +87,6 @@ exports[`should create default config 1`] = `
|
||||
"cloneEnvironment": false,
|
||||
"embedProxy": false,
|
||||
"embedProxyFrontend": false,
|
||||
"fixHourMetrics": false,
|
||||
"publicSignup": false,
|
||||
"responseTimeWithAppName": false,
|
||||
"syncSSOGroups": false,
|
||||
|
@ -167,47 +167,40 @@ export default class ClientMetricsServiceV2 {
|
||||
hoursBack,
|
||||
);
|
||||
|
||||
if (this.flagResolver.isEnabled('fixHourMetrics')) {
|
||||
const hours = generateHourBuckets(hoursBack);
|
||||
const hours = generateHourBuckets(hoursBack);
|
||||
|
||||
const environments = [
|
||||
...new Set(metrics.map((x) => x.environment)),
|
||||
];
|
||||
const environments = [...new Set(metrics.map((x) => x.environment))];
|
||||
|
||||
const applications = [
|
||||
...new Set(metrics.map((x) => x.appName)),
|
||||
].slice(0, 100);
|
||||
const applications = [...new Set(metrics.map((x) => x.appName))].slice(
|
||||
0,
|
||||
100,
|
||||
);
|
||||
|
||||
const result = environments.flatMap((environment) =>
|
||||
applications.flatMap((appName) =>
|
||||
hours.flatMap((hourBucket) => {
|
||||
const metric = metrics.find(
|
||||
(item) =>
|
||||
compareAsc(
|
||||
hourBucket.timestamp,
|
||||
item.timestamp,
|
||||
) === 0 &&
|
||||
item.appName === appName &&
|
||||
item.environment === environment,
|
||||
);
|
||||
return (
|
||||
metric || {
|
||||
timestamp: hourBucket.timestamp,
|
||||
no: 0,
|
||||
yes: 0,
|
||||
appName,
|
||||
environment,
|
||||
featureName,
|
||||
}
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
const result = environments.flatMap((environment) =>
|
||||
applications.flatMap((appName) =>
|
||||
hours.flatMap((hourBucket) => {
|
||||
const metric = metrics.find(
|
||||
(item) =>
|
||||
compareAsc(hourBucket.timestamp, item.timestamp) ===
|
||||
0 &&
|
||||
item.appName === appName &&
|
||||
item.environment === environment,
|
||||
);
|
||||
return (
|
||||
metric || {
|
||||
timestamp: hourBucket.timestamp,
|
||||
no: 0,
|
||||
yes: 0,
|
||||
appName,
|
||||
environment,
|
||||
featureName,
|
||||
}
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
return result.sort((a, b) => compareAsc(a.timestamp, b.timestamp));
|
||||
} else {
|
||||
return metrics;
|
||||
}
|
||||
return result.sort((a, b) => compareAsc(a.timestamp, b.timestamp));
|
||||
}
|
||||
|
||||
resolveMetricsEnvironment(user: User | ApiUser, data: IClientApp): string {
|
||||
|
@ -38,10 +38,6 @@ export const defaultExperimentalOptions = {
|
||||
process.env.UNLEASH_EXPERIMENTAL_CLONE_ENVIRONMENT,
|
||||
false,
|
||||
),
|
||||
fixHourMetrics: parseEnvVarBoolean(
|
||||
process.env.UNLEASH_EXPERIMENTAL_FIX_HOUR_METRICS,
|
||||
false,
|
||||
),
|
||||
},
|
||||
externalResolver: { isEnabled: (): boolean => false },
|
||||
};
|
||||
|
@ -41,7 +41,6 @@ process.nextTick(async () => {
|
||||
syncSSOGroups: true,
|
||||
changeRequests: true,
|
||||
cloneEnvironment: true,
|
||||
fixHourMetrics: true,
|
||||
},
|
||||
},
|
||||
authentication: {
|
||||
|
@ -30,7 +30,6 @@ export function createTestConfig(config?: IUnleashOptions): IUnleashConfig {
|
||||
syncSSOGroups: true,
|
||||
changeRequests: true,
|
||||
cloneEnvironment: true,
|
||||
fixHourMetrics: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user