CPU Meter
Shows a notification icon indicating current CPU usage. Something like the app OSMonitor does…
It reads out cpu stats file periodically, checks differences between each interval's cpu load and calculates usage in percent.
- Open Tasker
- Press "+" to create a Profile
- select "Event"
- name it "CPU Meter"
- add new Task "CPU Meter"
- add Action "File" "Read Line" File: "/proc/stat" Line: "1" To Var: "%stat"
- add Action "Variable Split" Name: "%stat" Delete Base: "Yes"
- add Action "Variable Set" Name: "%cputotalnew" To: "%stat2 + %stat3 + %stat4 + %stat5" Do Maths: "Yes"
- add Action "Variable Set" Name: "%cputotaldiff" To: "%cputotalnew - %CPUSUM" Do Maths: "Yes"
- add Action "Variable Set" Name: "%cpuidlediff" To: "%stat5 - %CPUIDLE" Do Maths: "Yes"
- add Action "Variable Set" Name: "%cpuusage" To: "100 - round( %cpuidlediff / %cputotaldiff * 100 )" Do Maths: "Yes"
- add Action "Variable Set" Name: "%CPUSUM" To: "%cputotalnew"
- add Action "Variable Set" Name: "%CPUIDLE" To: "%stat5"
- add Action "IF" "%SCREEN" ~ "on"
- add Action "Wait" 3 Seconds (or whatever time interval you want it to update, dont set too low, because it also needs some cpu time!)
- add Action "Alert" / "Notify" Title: "CPU" Text: "CPU: %cpuusage%" Icon: (choose what you like, i chose the the % sign) Number: "%cpuusage"
- add Action "Perform Task" Name: "CPU Meter" Stop: "yes"
This doesn't work so well on JB since the Notification count isnt displayed on the icon anymore. Instead it is a small number on the right of the notification list entry :/
So on JB I use IF/ELSE to change the Tasker notification icon depending on %cpuusage instead of setting "Notify". E.g. Red icon for high usage, green icon for low usage…
page revision: 0, last edited: 06 Apr 2013 18:49