Skip to content

Commit 4261167

Browse files
Zylphrexshashjar
authored andcommitted
chore(logs): Update copy for logs chart footer (#102283)
Update copies based on latest feedback
1 parent cc4c249 commit 4261167

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

static/app/views/explore/logs/confidenceFooter.tsx

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -75,59 +75,61 @@ function ConfidenceMessage({
7575
}
7676

7777
const noSampling = defined(isSampled) && !isSampled;
78-
const matchingLogsCount = <Count value={sampleCount} />;
78+
const matchingLogsCount =
79+
sampleCount > 1
80+
? t('%s matches', <Count value={sampleCount} />)
81+
: t('%s match', <Count value={sampleCount} />);
7982
const downsampledLogsCount = rawLogCounts.normal.count ? (
80-
<Count value={rawLogCounts.normal.count} />
83+
rawLogCounts.normal.count > 1 ? (
84+
t('%s samples', <Count value={rawLogCounts.normal.count} />)
85+
) : (
86+
t('%s sample', <Count value={rawLogCounts.normal.count} />)
87+
)
8188
) : (
8289
<OffsetContainer>
8390
<Placeholder width={40} />
8491
</OffsetContainer>
8592
);
8693
const allLogsCount = rawLogCounts.highAccuracy.count ? (
87-
<Count value={rawLogCounts.highAccuracy.count} />
94+
rawLogCounts.highAccuracy.count > 1 ? (
95+
t('%s logs', <Count value={rawLogCounts.highAccuracy.count} />)
96+
) : (
97+
t('%s log', <Count value={rawLogCounts.highAccuracy.count} />)
98+
)
8899
) : (
89100
<OffsetContainer>
90101
<Placeholder width={40} />
91102
</OffsetContainer>
92103
);
93-
const suffix = rawLogCounts.highAccuracy.count ? t('logs') : '';
94104

95105
if (dataScanned === 'full') {
96106
if (!hasUserQuery) {
97107
if (isTopN) {
98108
return tct('Log count for top [topEvents] groups: [matchingLogsCount]', {
99109
topEvents,
100-
matchingLogsCount,
110+
matchingLogsCount: <Count value={sampleCount} />,
101111
});
102112
}
103113

104114
return tct('Log count: [matchingLogsCount]', {
105-
matchingLogsCount,
115+
matchingLogsCount: <Count value={sampleCount} />,
106116
});
107117
}
108118

109119
// For logs, if the full data was scanned, we can assume that no
110120
// extrapolation happened and we should remove mentions of extrapolation.
111121
if (isTopN) {
112-
return tct(
113-
'[matchingLogsCount] matching logs for top [topEvents] groups after scanning [allLogsCount] [suffix]',
114-
{
115-
topEvents,
116-
matchingLogsCount,
117-
allLogsCount,
118-
suffix,
119-
}
120-
);
121-
}
122-
123-
return tct(
124-
'[matchingLogsCount] matching logs after scanning [allLogsCount] [suffix]',
125-
{
122+
return tct('[matchingLogsCount] for top [topEvents] groups in [allLogsCount]', {
123+
topEvents,
126124
matchingLogsCount,
127125
allLogsCount,
128-
suffix,
129-
}
130-
);
126+
});
127+
}
128+
129+
return tct('[matchingLogsCount] in [allLogsCount]', {
130+
matchingLogsCount,
131+
allLogsCount,
132+
});
131133
}
132134

133135
const downsampledTooltip = <DownsampledTooltip noSampling={noSampling} />;
@@ -140,27 +142,25 @@ function ConfidenceMessage({
140142

141143
if (isTopN) {
142144
return tct(
143-
'[warning] Extrapolated from [matchingLogsCount] matching logs for top [topEvents] groups after scanning [tooltip:[downsampledLogsCount] of [allLogsCount] [suffix]]',
145+
'[warning] Extrapolated from [matchingLogsCount] for top [topEvents] groups after scanning [tooltip:[downsampledLogsCount] of [allLogsCount]]',
144146
{
145147
warning,
146148
topEvents,
147149
matchingLogsCount,
148150
downsampledLogsCount,
149151
allLogsCount,
150-
suffix,
151152
tooltip: downsampledTooltip,
152153
}
153154
);
154155
}
155156

156157
return tct(
157-
'[warning] Extrapolated from [matchingLogsCount] matching logs after scanning [tooltip:[downsampledLogsCount] of [allLogsCount] [suffix]]',
158+
'[warning] Extrapolated from [matchingLogsCount] after scanning [tooltip:[downsampledLogsCount] of [allLogsCount]]',
158159
{
159160
warning,
160161
matchingLogsCount,
161162
downsampledLogsCount,
162163
allLogsCount,
163-
suffix,
164164
tooltip: downsampledTooltip,
165165
}
166166
);

0 commit comments

Comments
 (0)