From ad623f13e3922801d4163e28c4d414017d84f22c Mon Sep 17 00:00:00 2001 From: mertmit Date: Thu, 26 May 2022 20:46:04 +0300 Subject: [PATCH] feat: sync telemetry Signed-off-by: mertmit --- .../src/lib/noco/meta/api/sync/helpers/job.ts | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/packages/nocodb/src/lib/noco/meta/api/sync/helpers/job.ts b/packages/nocodb/src/lib/noco/meta/api/sync/helpers/job.ts index 01c7ddb195..329a085e49 100644 --- a/packages/nocodb/src/lib/noco/meta/api/sync/helpers/job.ts +++ b/packages/nocodb/src/lib/noco/meta/api/sync/helpers/job.ts @@ -1,5 +1,6 @@ import FetchAT from './fetchAT'; import { UITypes } from 'nocodb-sdk'; +import { Tele } from 'nc-help'; // import * as sMap from './syncMap'; import FormData from 'form-data'; @@ -1869,6 +1870,32 @@ export default async ( spaces: 2 }); } + + Tele.event({ + event: 'a:airtable-import:success', + data: { + stats: { + migrationTime: duration, + totalTables: aTblSchema.length, + totalColumns: columnSum, + links: linkSum, + lookup: lookupSum, + rollup: rollupSum, + totalFilters: rtc.filter, + totalSort: rtc.sort, + view: { + total: rtc.view.total, + grid: rtc.view.grid, + gallery: rtc.view.gallery, + form: rtc.view.form + }, + axios: { + count: rtc.fetchAt.count, + time: rtc.fetchAt.time + } + } + } + }); } ////////////////////////////// @@ -2230,6 +2257,10 @@ export default async ( } } catch (e) { if (e.response?.data?.msg) { + Tele.event({ + event: 'a:airtable-import:error', + data: { error: e.response.data.msg } + }); throw new Error(e.response.data.msg); } throw e; @@ -2264,5 +2295,5 @@ export interface AirtableSyncConfig { syncRollup: boolean; syncLookup: boolean; syncFormula: boolean; - } + }; }