MCPcopy Create free account
hub / github.com/tensorflow/tfjs / addResultToFirestore

Function addResultToFirestore

e2e/benchmarks/browserstack-benchmark/firestore.js:62–72  ·  view source on GitHub ↗

* After being returned from Browserstack, benchmark results are stored as * a list of fulfilled promises. * * As results are being iterated through, this function handles taking a result, * serializing it, and pushing it to Firestore. * * @param db Reference to Firestore collection * @param r

(db, resultId, result)

Source from the content-addressed store, hash-verified

60 * @param result Individual result in a list of fulfilled promises
61 */
62async function addResultToFirestore(db, resultId, result) {
63 try {
64 const firestoreMap =
65 formatForFirestore(result, makeCompatableWithFirestore, getReadableDate);
66 await db.add({ result: firestoreMap }).then((ref) => {
67 console.log(`Added ${resultId} to Firestore with ID: ${ref.id}`);
68 });
69 } catch (err) {
70 throw err;
71 }
72}
73
74/**
75 * This functions calls other formatting functions on a benchmark result so that

Callers 2

pushToFirestoreFunction · 0.85
app_node_test.jsFile · 0.85

Calls 3

formatForFirestoreFunction · 0.85
addMethod · 0.65
logMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…