Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,22 @@ function SpanCount(props: HeaderItemProps) {
);
}

// Because the frequency is computed using `count_unique(id)` internally,
// it is an approximate value. This means that it has the potential to be
// greater than `totals.count` when it shouldn't. So let's clip the
// frequency value to make sure we don't see values over 100%.
const frequency = defined(totals?.count)
? Math.min(suspectSpan.frequency, totals!.count)
: suspectSpan.frequency;

const value = defined(totals?.count) ? (
<Tooltip
title={tct('[frequency] out of [total] transactions contain this span', {
frequency: suspectSpan.frequency,
frequency,
total: totals!.count,
})}
>
<span>{formatPercentage(suspectSpan.frequency / totals!.count)}</span>
<span>{formatPercentage(frequency / totals!.count)}</span>
</Tooltip>
) : (
String(suspectSpan.count)
Expand Down