curiouslearning / followthelearners

MIT License
2 stars 1 forks source link

aggregate learner metrics prior to ingestion #542

Closed eric-gt closed 3 years ago

eric-gt commented 3 years ago

User Stories

As a developer, I want to pre-aggregate the following metrics prior to ingesting new learners into Firestore:

So that I can be confident that we maintain an accurate count without using too much of our Firestore read quota

Acceptance Criteria Given that I am viewing the Follow the Learners Firestore database

When the user-update script runs, I should see an update to the aggregate metrics in aggregate_data and loc_ref that corresponds with the data logged by the update script And When I look at the Firestore Usage tab for Follow the Learners I should see a nominal increase to the read counts, and an increase to the write count commensurate with 1) the number of learners added and 2) the number of regions and campaigns updated + the master count