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

Function pushToFirestore

e2e/benchmarks/browserstack-benchmark/app.js:340–357  ·  view source on GitHub ↗

* Pushes all benchmark results to Firestore. * * @param benchmarkResults List of all benchmark results

(benchmarkResults)

Source from the content-addressed store, hash-verified

338 * @param benchmarkResults List of all benchmark results
339 */
340async function pushToFirestore(benchmarkResults) {
341 let firestoreResults = [];
342 let numRejectedPromises = 0;
343 console.log('\Pushing results to Firestore...');
344 for (result of benchmarkResults) {
345 if (result.status == 'fulfilled') {
346 firestoreResults.push(
347 addResultToFirestore(db, result.value.tabId, result.value));
348 } else if (result.status == 'rejected') {
349 numRejectedPromises++;
350 }
351 }
352 return await Promise.allSettled(firestoreResults).then(() => {
353 console.log(
354 `Encountered ${numRejectedPromises} rejected promises that were not ` +
355 `added to the database.`);
356 });
357}
358
359/** Set up --help menu for file description and available optional commands */
360function setupHelpMessage() {

Callers 1

benchmarkFunction · 0.85

Calls 3

addResultToFirestoreFunction · 0.85
logMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…