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

fix: include first day of range in the extended metrics (#6245)

This commit is contained in:
Mateusz Kwasniewski 2024-02-16 08:36:25 +01:00 committed by GitHub
parent a8fa1ae347
commit f0d5c8e3d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -223,10 +223,13 @@ export default class ClientMetricsServiceV2 {
let hours: HourBucket[];
let metrics: IClientMetricsEnv[];
if (this.flagResolver.isEnabled('extendedUsageMetrics')) {
// if we're in the daily range we need to add one more day
const normalizedHoursBack =
hoursBack > 48 ? hoursBack + 24 : hoursBack;
metrics =
await this.clientMetricsStoreV2.getMetricsForFeatureToggleV2(
featureName,
hoursBack,
normalizedHoursBack,
);
hours =
hoursBack > 48