···137 sendOrAggregateInteractionsForStats(
138 aggregatedStats.current,
139 interactionsToSend,
140- feed?.feedDescriptor ?? 'unknown',
141 )
142 throttledFlushAggregatedStats()
143 logger.debug('flushed')
···274function sendOrAggregateInteractionsForStats(
275 stats: AggregatedStats,
276 interactions: AppBskyFeedDefs.Interaction[],
277- feed: string,
278) {
279 for (let interaction of interactions) {
280 switch (interaction.event) {
281- // Pressing "Show more" / "Show less" is relatively uncommon so we won't aggregate them.
282- // This lets us send the feed context together with them.
283- case 'app.bsky.feed.defs#requestLess': {
284- logger.metric('feed:showLess', {
285- feed,
286- feedContext: interaction.feedContext ?? '',
287- })
288- break
289- }
290- case 'app.bsky.feed.defs#requestMore': {
291- logger.metric('feed:showMore', {
292- feed,
293- feedContext: interaction.feedContext ?? '',
294- })
295- break
296- }
297-298- // The rest of the events are aggregated and sent later in batches.
299 case 'app.bsky.feed.defs#clickthroughAuthor':
300 case 'app.bsky.feed.defs#clickthroughEmbed':
301 case 'app.bsky.feed.defs#clickthroughItem':
···137 sendOrAggregateInteractionsForStats(
138 aggregatedStats.current,
139 interactionsToSend,
0140 )
141 throttledFlushAggregatedStats()
142 logger.debug('flushed')
···273function sendOrAggregateInteractionsForStats(
274 stats: AggregatedStats,
275 interactions: AppBskyFeedDefs.Interaction[],
0276) {
277 for (let interaction of interactions) {
278 switch (interaction.event) {
279+ // The events are aggregated and sent later in batches.
00000000000000000280 case 'app.bsky.feed.defs#clickthroughAuthor':
281 case 'app.bsky.feed.defs#clickthroughEmbed':
282 case 'app.bsky.feed.defs#clickthroughItem':