This API is available on Firefox OS for internal applications only.
Summary
The MozNetworkStatsManager
interface provides methods and properties to monitor data usage.
Properties
MozNetworkStatsManager.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.
Methods
MozNetworkStatsManager.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 aDOMRequest
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.
Constants
- MozNetworkStatsManager.WIFI
- Returns 0, identifying Wifi
- MozNetworkStatsManager.MOBILE
- Returns 1, identifying Mobile
Specification
Not part of any specification.