Storing energy data in a database for future polling , to find cumulative energy cost of a computing session

View: New views
2 Messages — Rating Filter:   Alert me  

Storing energy data in a database for future polling , to find cumulative energy cost of a computing session

by Chris Adams-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi there,

First post to the list, and if this qn has been asked already,and I missed when I first skimmed the docs please forgive me. 

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?

If so, how can I poll it?

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.

2) store current charge in a database

3) at the end of a computing session (say, on sleep, or log off, or shutdown) measure the difference in charge inside the battery (taking into account whether it's plugged in or not to external power etc).

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,


---
I'm currently only checking my email at 9am, midday and at 4pm.
If you need a response from me urgently, please call or text my mobile, or contact me via Skype (chris.d.adams).
---
Chris Adams
Stemcel Studios
The Hub
5 Torrens Street
London
EC1V 1NQ

email: chris@...
web:  www.stemcel.co.uk
twitter:chris_d_adams
skype: chris.d.adams
mob: 07974 368 229
tel: 0207 558 8971


_______________________________________________
gnome-power-manager-list mailing list
gnome-power-manager-list@...
http://mail.gnome.org/mailman/listinfo/gnome-power-manager-list

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

by Richard Hughes-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/9/13 Chris Adams <chris@...>:
> 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.
_______________________________________________
gnome-power-manager-list mailing list
gnome-power-manager-list@...
http://mail.gnome.org/mailman/listinfo/gnome-power-manager-list