Class: Toybox::System::Stats

Inherits:
Lang::Object show all

Overview

Represents various statistics available on a device, such as the battery charge and memory use.

Examples:

using Toybox.System;
var myStats = System.getSystemStats();
System.println(myStats.battery);
System.println(myStats.totalMemory);

See Also:

Since:

  • 1.0.0

Instance Attribute Summary collapse

Method Summary

Methods inherited from Lang::Object

equals, hashCode, method, toString, weak

Instance Attribute Details

batteryToybox::Lang::Float

Note:

Some devices may report slightly less than 100% charge immediately after being removed from the charging cradle or cable. While the device is on the charger, the charger will disable itself after the battery charges to 100%. The battery will then very slowly discharge until it hits a hysteresis threshold, at which point the charger will reactivate. This is intentionally done to extend the life of the battery if the device is left on the charger for a long time. Garmin artificially locks the charge indicator on the charge page to 100% once the unit reaches full charge to mask this minor charge cycle fluctuation.

The remaining battery life as a percentage.

Returns:

Since:

  • 1.0.0



7534
7535
7536
# File 'Monkeybrains.rb', line 7534

def battery
  @battery
end

freeMemoryToybox::Lang::Number

The current free memory in bytes.

Returns:

Since:

  • 1.0.0



7544
7545
7546
# File 'Monkeybrains.rb', line 7544

def freeMemory
  @freeMemory
end

totalMemoryToybox::Lang::Number

The total available memory in bytes.

Returns:

Since:

  • 1.0.0



7549
7550
7551
# File 'Monkeybrains.rb', line 7549

def totalMemory
  @totalMemory
end

usedMemoryToybox::Lang::Number

The memory used by the application in bytes.

Returns:

Since:

  • 1.0.0



7539
7540
7541
# File 'Monkeybrains.rb', line 7539

def usedMemory
  @usedMemory
end