How to log and visualize resource usage stats (to identify resource hogs)? I want to be able to collect up to, say, a couple of day's worth of resource usage statics for my android, at the resolution of individual apps, and ordered according to their shares of the resource.  And I would like then to be able to view this information in such a way that I can easily identify the worst resource hogs.

Any suggestions for how to do this would be appreciated.

(FWIW, my phone is rooted.)

Thanks!

PS: There is a bazillion of apps for monitoring CPU usage, memory usage, etc., but all the ones I have found give only global statistics.  I.e. they will tell me that, e.g. 84% of my phone's CPU is being used, but none will give me a weighted breakdown of that percentage over the apps responsible for it.  Monitoring apps that do not collect and display statistics at the resolution of individual applications are of little use to me.  And of course, it goes without saying that "task manager" apps, or even for apps like Watchdog are even farther removed from what I'm looking for; these apps may be very good at what they do, but they simply are not designed to do what I want done.
You might be able to get some of what you want from Carat. This app is a project from UC-Berkeley to measure what's using your battery and how your battery life compares to other people's devices.

It doesn't directly measure CPU, but your resource hogs are going to use more battery by implication.

From the description:


  Carat will tell you which apps it thinks are hogs (they use a lot of battery) and which are bugs (they use a lot of battery on your device but not most others). Being a hog or a bug does not make an app 'bad', but a user trying to improve their battery life can use these designations to adjust their behavior.
  
  == Carat Features ==
  
  
  Action List telling you how to improve your battery life and by how much
  Device information detailing exactly what data we are recording
  Reports apps that are using lots of energy and whether that is happening on other devices, too
  Detail views let you dive down into the data and see graphs of energy use
  Low-overhead sampling requires almost no energy or CPU
  J-Score tells you how your battery efficiency compares to other users
  Sharing features let you post/tweet/blog about your experience; more users means more data which means better recommendations for you