Class: IStats::Cpu
Class Method Summary collapse
-
.all ⇒ Object
Call all functions (stats).
-
.cpu_temperature ⇒ Object
Print CPU temperature with sparkline.
-
.delegate(stat) ⇒ Object
Delegate CLI command to function.
Methods included from CPU_STATS
Class Method Details
.all ⇒ Object
Call all functions (stats)
24 25 26 |
# File 'lib/iStats/cpu.rb', line 24 def all cpu_temperature end |
.cpu_temperature ⇒ Object
Print CPU temperature with sparkline
30 31 32 33 34 35 36 37 38 |
# File 'lib/iStats/cpu.rb', line 30 def cpu_temperature t = get_cpu_temp thresholds = [50, 68, 80, 90] value, scale = Printer.parse_temperature(t) if Printer.get_temperature_scale == 'fahrenheit' thresholds.map! { |t| Utils.to_fahrenheit(t) } end Printer.print_item_line("CPU temp", value, scale, thresholds) end |