MCPcopy Create free account
hub / github.com/cloudquery/cloudquery / TrackSyncCompleted

Function TrackSyncCompleted

cli/internal/analytics/client.go:186–218  ·  view source on GitHub ↗
(ctx context.Context, invocationUUID uuid.UUID, event SyncFinishedEvent)

Source from the content-addressed store, hash-verified

184}
185
186func TrackSyncCompleted(ctx context.Context, invocationUUID uuid.UUID, event SyncFinishedEvent) {
187 if client == nil {
188 return
189 }
190
191 details := getSyncEventDetails(ctx)
192 if details == nil {
193 return
194 }
195
196 if details.isCurrentTeamInternal {
197 return
198 }
199
200 status := "success"
201 if event.AbortedDueToError != nil {
202 status = "error"
203 }
204
205 props := getSyncCommonProps(invocationUUID, event.SyncStartedEvent, details).
206 Set("duration", event.Duration).
207 Set("status", status).
208 Set("total_rows", event.ResourceCount).
209 Set("errors", event.Errors).
210 Set("warnings", event.Warnings).
211 Set("aborted_due_to_error", event.AbortedDueToError)
212
213 _ = client.Enqueue(rudderstack.Track{
214 UserId: details.user.ID.String(),
215 Event: "sync_run_completed",
216 Properties: props,
217 })
218}
219
220type InitEvent struct {
221 Source string

Callers

nothing calls this directly

Calls 4

getSyncEventDetailsFunction · 0.85
getSyncCommonPropsFunction · 0.85
SetMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected