0

The official document of Firebase Realtime profiler says:

The profiler tool logs all the activity in your database over a given period of time, then generates a detailed report.

But it doesn't tell the specific time like last 24 hours.

My database usage shows that on a particular day, bandwidth consumed is X so I want to specify a particular day or time duration like last 24 hours in Firebase Realtime database profiler >

Q1. Is it possible to specify the duration in profile like last 24 hours?

Q2. How does profiler work?

I think, profiler just scans some log and keeps writing/streaming the operations to user console unless user stops the the profiling tool. Correct me if I am wrong here.

Sachin Jain
  • 21,353
  • 33
  • 103
  • 168

1 Answers1

2

Q1. Is it possible to specify the duration in profile like last 24 hours?

No, it's not possible to profile "last" hours. But you can profile the next 24. (I'll get to that on Q2)

Q2. How does profiler work?

What the profiler does is it logs all the operations happening on your database from the time you run the command until the time you stop it. When you run the command, the console will show you how many operations have been logged so far and you can use Enter to stop logging. It will then show you (or save it to a file if you prefer) speed and bandwidth reports.

But it also has an option to set the logging duration (in seconds). For example, if you want to log the next 24 hours you can use:

firebase database:profile -d 86400

But have in mind that logging only happens if the computer that started it is still on. This means you'll need to keep your computer on for the next 24h.