MozNetworkStatsManager
#
DescriptionThe MozNetworkStatsManager interface provides methods and properties to monitor data usage.
#
PropertiesMozNetworkStatsManager.maxStorageAge
read-only
A number representing the time in milliseconds recorded by the API until present time for each type of connection. All samples older than maxStorageAge from now are deleted.MozNetworkStatsManager.sampleRate
read-only
A number representing the minimum time in milliseconds between samples stored in the database.
#
MethodsMozNetworkStatsManager.addAlarm()
Allows to install an alarm on a network. Returns a DOMRequest object to handle the success or failure of the request.MozNetworkStatsManager.clearAllStats()
Allows to clear all the statistics about the data usage. Returns a DOMRequest object to handle the success or failure of the request.MozNetworkStatsManager.clearStats()
Allows to clear all the statistics about the data usage on a specific network. Returns a DOMRequest object to handle the success or failure of the request.MozNetworkStatsManager.getAllAlarms()
Allows to obtain all alarms for those networks returned by MozNetworkStatsManager.getAvailableNetworks. Returns a DOMRequest object to handle the success or failure of the request.MozNetworkStatsManager.getAvailableNetworks()
Allows to obtain an Array of available networks that used to be saved in the database. Returns a DOMRequest object to handle the success or failure of the request.MozNetworkStatsManager.getAvailableServiceTypes()
Allows to obtain an Array of available service types that used to be saved in the database. Returns a DOMRequest object to handle the success or failure of the request.MozNetworkStatsManager.getSamples()
Allows to access the data usage statistics. Returns a DOMRequest object to handle the success or failure of the request.MozNetworkStatsManager.removeAlarms()
Allows to remove all network alarms, or a specific network alarm, if an alarmId is provided. Returns a DOMRequest object to handle the success or failure of the request.
#
ConstantsMozNetworkStatsManager.WIFI
- Returns 0, identifying WifiMozNetworkStatsManager.MOBILE
- Returns 1, identifying Mobile