Skip to content

Commit 9406999

Browse files
Update src/Microsoft.FeatureManagement/Telemetry/TelemetryEventHandler.cs
Co-authored-by: Sami Sadfa <71456174+samsadsam@users.noreply.github.com>
1 parent f9cb776 commit 9406999

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/Microsoft.FeatureManagement/Telemetry/TelemetryEventHandler.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,7 @@ public static void HandleEvaluationEvent(EvaluationEvent evaluationEvent, ILogge
5757
if (evaluationEvent.VariantAssignmentReason == VariantAssignmentReason.DefaultWhenEnabled)
5858
{
5959
// If the variant was assigned due to DefaultWhenEnabled, the percentage reflects the unallocated percentiles
60-
double allocatedPercentage = 0;
61-
62-
if (evaluationEvent.FeatureDefinition.Allocation?.Percentile != null)
63-
{
64-
allocatedPercentage += evaluationEvent.FeatureDefinition.Allocation.Percentile
65-
.Sum(p => p.To - p.From);
66-
}
60+
double allocatedPercentage = evaluationEvent.FeatureDefinition.Allocation?.Percentile?.Sum(p => p.To - p.From) ?? 0;
6761

6862
tags["VariantAssignmentPercentage"] = 100 - allocatedPercentage;
6963
}

0 commit comments

Comments
 (0)