1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
7 [CheckPermissions="resourcestats-manage",
8 Pref="dom.resource_stats.enabled",
9 AvailableIn="CertifiedApps",
10 JSImplementation="@mozilla.org/networkStatsData;1"]
11 interface NetworkStatsData
13 readonly attribute unsigned long long receivedBytes;
14 readonly attribute unsigned long long sentBytes;
15 readonly attribute DOMTimeStamp timestamp; // timestamp of the record
18 [CheckPermissions="resourcestats-manage",
19 Pref="dom.resource_stats.enabled",
20 AvailableIn="CertifiedApps",
21 JSImplementation="@mozilla.org/powerStatsData;1"]
22 interface PowerStatsData
24 readonly attribute unsigned long long consumedPower; // unit: mW
25 readonly attribute DOMTimeStamp timestamp; // timestamp of the record
28 [CheckPermissions="resourcestats-manage",
29 Pref="dom.resource_stats.enabled",
30 AvailableIn="CertifiedApps",
31 JSImplementation="@mozilla.org/resourceStats;1"]
32 interface ResourceStats
37 readonly attribute ResourceType type;
40 * The |component| specifies statistics belongs to. This will be null if
41 * the ResourceStatsOptions.component argument passed to getStats() is null.
43 readonly attribute DOMString? component;
46 * |serviceType| specifies the system service. This will be null if the
47 * ResourceStatsOptions.serviceType argument passed to getStats() is null.
49 readonly attribute SystemService? serviceType;
52 * |manifestURL| specifies the manifestURL of an application. This will be
53 * null if the ResourceStatsOptions.manifestURL argument passed to getStats()
56 readonly attribute DOMString? manifestURL;
59 * Statistics, one element per day
61 sequence<(NetworkStatsData or PowerStatsData)> getData();
66 readonly attribute DOMTimeStamp start; // start timestamp
67 readonly attribute DOMTimeStamp end; // end timestamp