зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1360567 - Add telemetry probes for Indexeddb storage types, r=janv, datareview=francois
This commit is contained in:
Родитель
2bc5c3208b
Коммит
a99c46071a
|
@ -19,6 +19,7 @@
|
|||
#include "mozilla/ipc/BackgroundUtils.h"
|
||||
#include "mozilla/ipc/PBackground.h"
|
||||
#include "mozilla/ipc/PBackgroundChild.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozIThirdPartyUtil.h"
|
||||
#include "nsAboutProtocolUtils.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
@ -477,6 +478,28 @@ IDBFactory::Open(JSContext* aCx,
|
|||
CallerType aCallerType,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
if (!IsChrome() &&
|
||||
aOptions.mStorage.WasPassed()) {
|
||||
switch (aOptions.mStorage.Value()) {
|
||||
case StorageType::Persistent: {
|
||||
Telemetry::ScalarAdd(Telemetry::ScalarID::IDB_TYPE_PERSISTENT_COUNT, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
case StorageType::Temporary: {
|
||||
Telemetry::ScalarAdd(Telemetry::ScalarID::IDB_TYPE_TEMPORARY_COUNT, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
case StorageType::Default:
|
||||
case StorageType::EndGuard_:
|
||||
break;
|
||||
|
||||
default:
|
||||
MOZ_CRASH("Invalid storage type!");
|
||||
}
|
||||
}
|
||||
|
||||
return OpenInternal(aCx,
|
||||
/* aPrincipal */ nullptr,
|
||||
aName,
|
||||
|
|
|
@ -1052,6 +1052,35 @@ network.tcp:
|
|||
record_in_processes:
|
||||
- 'main'
|
||||
|
||||
idb.type:
|
||||
persistent_count:
|
||||
bug_numbers:
|
||||
- 1360567
|
||||
description: >
|
||||
Number of times indexeddb.open(name, {storage: "persistent"}) has been used.
|
||||
expires: "60"
|
||||
kind: uint
|
||||
notification_emails:
|
||||
- shuang@mozilla.com
|
||||
release_channel_collection: opt-in
|
||||
record_in_processes:
|
||||
- 'main'
|
||||
- 'content'
|
||||
|
||||
temporary_count:
|
||||
bug_numbers:
|
||||
- 1360567
|
||||
description: >
|
||||
Number of times indexeddb.open(name, {storage: "temporary"}) has been used.
|
||||
expires: "60"
|
||||
kind: uint
|
||||
notification_emails:
|
||||
- shuang@mozilla.com
|
||||
release_channel_collection: opt-in
|
||||
record_in_processes:
|
||||
- 'main'
|
||||
- 'content'
|
||||
|
||||
# The following section contains probes that record timestamps.
|
||||
timestamps:
|
||||
first_paint:
|
||||
|
|
Загрузка…
Ссылка в новой задаче