0

I am trying to understand how much resources (Google Cloud, Firebase) each user of my app is using. I would be glad for links to relevant documentation and implementation examples.

I would want users to pay in advance and block the costly services for the user when the debit is below 0.

Leo
  • 4,136
  • 6
  • 48
  • 72

1 Answers1

1

There is nothing built into Firebase or the Google Cloud Platform to break down resource consumption to the users of your apps.

If you need that for your use-case, you will have to build it yourself. How to do that depends on each individual product you use.

Alex Mamo
  • 130,605
  • 17
  • 163
  • 193
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Thanks Frank. Is it possible? I am using two resources that might be costly. The first is speech-to-text. (Unavoidable.) The second is Firestore, used in real time updates with messages to the users doing shared editing. (Which I can potentially move to another platform.) – Leo Apr 06 '19 at 14:19
  • 1
    We're talking about software here, so most things are possible if you're willing to spend the time and effort. If you're calling the GCP text-to-speech API, you are (or at least *should*) be doing so from a server, in which case you can securely log what user you're making each call for, and whatever other information you need to implement your charging model. For Firestore you can't implement a *read* rate limit in security rules. See https://stackoverflow.com/questions/53227674/limit-a-specific-type-of-user-in-firestore-to-read-documents-based-on-time – Frank van Puffelen Apr 06 '19 at 14:43
  • Yes, the text-to-speech part doesn't worry me much. The Firestore worries me more since each "document" to edit in my editor consists of a lot of records ("documents" in Firestore). If I understand it correctly, however, retrieving a snapshot of a collection (which is my "document to edit") and starting listening to changes is only 1 read. But... I am not sure of that. And that worries me. – Leo Apr 06 '19 at 15:45