Re: [gpm] Storing energy data in a database for future polling , to find cumulative energy cost of a computing session



2009/9/13 Chris Adams <chris stemcel co uk>:
> I'm trying to work out if there's a way to easily store energy consumption
> data of a computer, so I can add these readings up over a set period to work
> out how much energy in watts has been used for a particular computing
> session.
> However Gnome power manager already offers some graphing of power usage when
> turned on - so before reinventing the wheel, and creating an sqllite
> database to store data that's already being stored, I wanted to check - is
> this already being done internally somewhere?

Checkout the statistics interface on DeviceKit-power -- but you'll
need a proper power meter plugged in like a a Watts Up Pro if you want
to get accurate data, or data when you're not discharging or charging.

> If so, how can I poll it?

You don't want to poll, polling is bad for battery life.

> My current approach was going to be as follows:
> 1) setting up a daemon to grep the output of  the
> `/usr/share/gnome-power-manager/gnome-power-bugreport` command, every n
> seconds.

No, just use DeviceKit-power.

> 2) store current charge in a database

DeviceKit-power already stores this.

> To give some context, I'm hoping to do this so I can eventually take this
> figure and pipe it through the AMEE carbon calculator, to work out the
> carbon footprint of using a machine for a set period. I then want to pipe
> THAT through http://carbon.to, to see what else could have been done with
> the energy I just spent using my computer...
> Thanks,

You'll need to use a watts up pro device then, using a laptop battery
only works when you're discharging or charging, and at the limits of
the range it's not accurate at all.

Richard.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]