Skip to content

Commit

Permalink
Update preset logic per code review
Browse files Browse the repository at this point in the history
  • Loading branch information
kpollich committed Dec 7, 2023
1 parent 52efb79 commit 8a98ce0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions x-pack/plugins/fleet/server/collectors/agents_per_output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ export async function getAgentsPerOutput(
};
}

['balanced', 'custom', 'latency', 'scale', 'throughput'].forEach((preset) => {
if (output.preset === preset) {
outputTelemetryRecord.preset_counts![preset] += 1;
}
});
if (output.preset && output.preset in outputTelemetryRecord.preset_counts) {
outputTelemetryRecord.preset_counts[
output.preset as keyof typeof outputTelemetryRecord.preset_counts
] += 1;
}
});

return Object.values(outputTypes);
Expand Down

0 comments on commit 8a98ce0

Please sign in to comment.