Skip to content

Commit

Permalink
chore: Trace RRule
Browse files Browse the repository at this point in the history
There is a 5s gap in the traces from fetching all the meeting series'
last meetings and starting the new ones. In this time we only do some
RRule parsing and calculations. Let's trace these.
  • Loading branch information
Dschoordsch committed May 15, 2024
1 parent a5d4bad commit f3e5ad7
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ const processRecurrence: MutationResolvers['processRecurrence'] = async (_source

// For meetings that should still be active, start the meeting and set its end time.
// Any subscriptions are handled by the shared meeting start code
const rrule = RRule.fromString(meetingSeries.recurrenceRule)
const rrule = tracer.trace('RRule.fromString', () =>
RRule.fromString(meetingSeries.recurrenceRule)
)
// technically, RRULE should never return NaN here but there's a bug in the library
// https://github.com/jakubroztocil/rrule/issues/321
if (isNaN(rrule.options.interval)) {
Expand All @@ -202,9 +204,8 @@ const processRecurrence: MutationResolvers['processRecurrence'] = async (_source
Math.max(lastMeeting.createdAt.getTime() + ms('10m'), now.getTime() - ms('24h'))
)
: new Date(0)
const newMeetingsStartTimes = rrule.between(
getRRuleDateFromJSDate(fromDate),
getRRuleDateFromJSDate(now)
const newMeetingsStartTimes = tracer.trace('RRule.between', () =>
rrule.between(getRRuleDateFromJSDate(fromDate), getRRuleDateFromJSDate(now))
)
for (const startTime of newMeetingsStartTimes) {
const err = await tracer.trace('startRecurringMeeting', async (span) => {
Expand Down

0 comments on commit f3e5ad7

Please sign in to comment.