Skip to content

Commit a904411

Browse files
committed
Merge branch 'rossgrambo-extra-telemetry-fields' of https://github.com/microsoft/FeatureManagement-Dotnet into rossgrambo-extra-telemetry-fields
2 parents e53aeb0 + 9406999 commit a904411

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/Microsoft.FeatureManagement/Telemetry/FeatureEvaluationTelemetry.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,7 @@ public static void Publish(EvaluationEvent evaluationEvent, ILogger logger)
6969
if (evaluationEvent.VariantAssignmentReason == VariantAssignmentReason.DefaultWhenEnabled)
7070
{
7171
// If the variant was assigned due to DefaultWhenEnabled, the percentage reflects the unallocated percentiles
72-
double allocatedPercentage = 0;
73-
74-
if (evaluationEvent.FeatureDefinition.Allocation?.Percentile != null)
75-
{
76-
allocatedPercentage += evaluationEvent.FeatureDefinition.Allocation.Percentile
77-
.Sum(p => p.To - p.From);
78-
}
72+
double allocatedPercentage = evaluationEvent.FeatureDefinition.Allocation?.Percentile?.Sum(p => p.To - p.From) ?? 0;
7973

8074
tags["VariantAssignmentPercentage"] = 100 - allocatedPercentage;
8175
}

0 commit comments

Comments
 (0)