2

Is there any way to check CPU usage within flutter, so I could output to a widget, rather than the debugger/profiler ? (even better if there are other resource stats as well)?

There are a couple of reasons behind this, one is I have an app that crashes, and I'm trying to isolate it (the IDE profiling doesn't work in this case, and typically the device also crashes when monitored), but also in the app itself, if it's already busy, I'd like to back off from performing certain tasks.

Ian
  • 13,724
  • 4
  • 52
  • 75
  • Have you been trying to monitor flutter or monitor android/ios? I don't know what you're doing, but high enough cpu usage to crash the device shouldn't be possible. I'd look into tools for native profiling, or using ADB top or the like from your computer. However, it is possible to get some of that info in the app, but not from flutter directly so you'll have to use method channels. – rmtmckenzie Nov 16 '18 at 18:57
  • 1
    See [this answer](https://stackoverflow.com/questions/46714396/how-to-find-cpu-load-of-any-android-device-programmatically) for android and [this one](https://stackoverflow.com/questions/8223348/ios-get-cpu-usage-from-application) for ios. – rmtmckenzie Nov 16 '18 at 18:57

1 Answers1

0

Flutter Performance view has greatly improved since. If you'd like to get more granular data on the app's CPU usage, you can use the CPU profiler.

Omatt
  • 8,564
  • 2
  • 42
  • 144