feat: count analytics
This commit is contained in:
@@ -325,6 +325,12 @@ async function executeRun(id: string) {
|
|||||||
binaryOutput: uploadedBinaryOutput,
|
binaryOutput: uploadedBinaryOutput,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let totalRowsExtracted = 0;
|
||||||
|
updatedRun.serializableOutput['item-0'].forEach((item: any) => {
|
||||||
|
totalRowsExtracted += Object.keys(item).length;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
captureServerAnalytics.capture({
|
captureServerAnalytics.capture({
|
||||||
distinctId: id,
|
distinctId: id,
|
||||||
event: 'maxun-oss-run-created-api',
|
event: 'maxun-oss-run-created-api',
|
||||||
@@ -332,6 +338,9 @@ async function executeRun(id: string) {
|
|||||||
runId: id,
|
runId: id,
|
||||||
created_at: new Date().toISOString(),
|
created_at: new Date().toISOString(),
|
||||||
status: 'success',
|
status: 'success',
|
||||||
|
extractedItemsCount: updatedRun.serializableOutput['item-0'].length,
|
||||||
|
extractedRowsCount: totalRowsExtracted,
|
||||||
|
extractedScreenshotsCount: updatedRun.binaryOutput['item-0'].length,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -253,6 +253,13 @@ router.post('/runs/run/:id', requireSignIn, async (req: AuthenticatedRequest, re
|
|||||||
serializableOutput: interpretationInfo.serializableOutput,
|
serializableOutput: interpretationInfo.serializableOutput,
|
||||||
binaryOutput: uploadedBinaryOutput,
|
binaryOutput: uploadedBinaryOutput,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let totalRowsExtracted = 0;
|
||||||
|
run.serializableOutput['item-0'].forEach((item: any) => {
|
||||||
|
totalRowsExtracted += Object.keys(item).length;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
captureServerAnalytics.capture({
|
captureServerAnalytics.capture({
|
||||||
distinctId: req.user?.id,
|
distinctId: req.user?.id,
|
||||||
event: 'maxun-oss-run-created-manual',
|
event: 'maxun-oss-run-created-manual',
|
||||||
@@ -261,6 +268,9 @@ router.post('/runs/run/:id', requireSignIn, async (req: AuthenticatedRequest, re
|
|||||||
user_id: req.user?.id,
|
user_id: req.user?.id,
|
||||||
created_at: new Date().toISOString(),
|
created_at: new Date().toISOString(),
|
||||||
status: 'success',
|
status: 'success',
|
||||||
|
extractedItemsCount: run.serializableOutput['item-0'].length,
|
||||||
|
extractedRowsCount: totalRowsExtracted,
|
||||||
|
extractedScreenshotsCount: run.binaryOutput['item-0'].length,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -133,6 +133,12 @@ async function executeRun(id: string) {
|
|||||||
binaryOutput: uploadedBinaryOutput,
|
binaryOutput: uploadedBinaryOutput,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let totalRowsExtracted = 0;
|
||||||
|
run.serializableOutput['item-0'].forEach((item: any) => {
|
||||||
|
totalRowsExtracted += Object.keys(item).length;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
captureServerAnalytics.capture({
|
captureServerAnalytics.capture({
|
||||||
distinctId: id,
|
distinctId: id,
|
||||||
event: 'maxun-oss-run-created-scheduled',
|
event: 'maxun-oss-run-created-scheduled',
|
||||||
@@ -140,6 +146,9 @@ async function executeRun(id: string) {
|
|||||||
runId: id,
|
runId: id,
|
||||||
created_at: new Date().toISOString(),
|
created_at: new Date().toISOString(),
|
||||||
status: 'success',
|
status: 'success',
|
||||||
|
extractedItemsCount: run.serializableOutput['item-0'].length,
|
||||||
|
extractedRowsCount: totalRowsExtracted,
|
||||||
|
extractedScreenshotsCount: run.binaryOutput['item-0'].length,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user