LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-05-2012, 10:12 AM   #1
turkejd
LQ Newbie
 
Registered: Jan 2012
Posts: 10

Rep: Reputation: Disabled
Calculate power usage real time


Hi,

I am willing to calculate the power usage of my laptop during, for example, 5 minutes (short lapse of time).
Then I change something in my system (like I turn off network interfaces, etc)
and redo this calculation, in order to see the differences.

So far I found out gnome-power-statistics and powertop which both do not what I want.

Is there a software that show the amount of energy used in a certain interval of time?

Thanks.
 
Old 03-05-2012, 12:58 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,730

Rep: Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919
I do not know what other applications are out there but it would be easy to create a script to calculate whatever you want. The values are located in the file /proc/acpi/battery/BAT0/state (BAT0 directory name depends on distribution). The value you are looking for is present state (current) and present voltage.

Power watts = (present state X Present voltage)/1000
 
Old 03-05-2012, 01:32 PM   #3
turkejd
LQ Newbie
 
Registered: Jan 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
I do not know what other applications are out there but it would be easy to create a script to calculate whatever you want. The values are located in the file /proc/acpi/battery/BAT0/state (BAT0 directory name depends on distribution). The value you are looking for is present state (current) and present voltage.

Power watts = (present state X Present voltage)/1000
That is wonderful. It is the simplest solution!

However there is a little problem. I get an 'unknown' value on present voltage.
Is it meaningful to use only the present state as an indicator?

Thanks
 
Old 03-05-2012, 01:48 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,730

Rep: Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919
Yes since any changes you make to the system will be shown in the amount of current draw.
 
Old 03-05-2012, 03:33 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,993

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
You'd be better off with a kill-a-watt meter. The one I have has a time monitor. I can monitor for a few minutes to years.

Any OS based will not be very accurate.
 
Old 03-05-2012, 04:51 PM   #6
turkejd
LQ Newbie
 
Registered: Jan 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jefro View Post
You'd be better off with a kill-a-watt meter. The one I have has a time monitor. I can monitor for a few minutes to years.

Any OS based will not be very accurate.
Thank you, but I don't need something too accurate for what I want to do.
As long as I can get a significant difference of power usage when I, for example, turn off a network interface, or something like that.

I am taking your advice for future needs though.
 
Old 03-06-2012, 03:51 AM   #7
turkejd
LQ Newbie
 
Registered: Jan 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
Since you've been so helpful I want to ask you this other question.

I noticed that there is no decrease in the present rate when I switch off a network interface.

A little background:
I am using an experimental protocol (MPTCP) to use all network interfaces simultaneously in a TCP connection.
If I download a file with both interfaces on (eth0 and wlan0), every interface receive at 400 KB/s. The total bandwidth achieved is about 800 KB/s.

If I switch off, let's say, wlan0, I get all traffic on eth0 (800 KB/s).
The problem is that there is no decrease in the power consumption.

Is that because the interface that stays on receive double the traffic than before? Or is it because, as jefro said, this OS based method is not accurate?
How is this possible that there is no decrease in power usage?

Thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple tool to monitor real-time bandwidth usage of all connected hosts on LAN? mattp52 Linux - Networking 5 02-13-2008 11:18 PM
LXer: Real-time garbage collection with Real-time Java LXer Syndicated Linux News 0 05-05-2007 12:16 PM
LXer: Real-time Linux gains real-time JVM LXer Syndicated Linux News 0 10-12-2006 10:54 AM
Monitoring traffic tool/web based(non-cgi?)/non-SNMP/low CPU usage/non-real time pe2338 Linux - Networking 3 05-04-2006 01:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration