Bug 1429510 - Make last shutdown time a scalar. r=chutten

This commit is contained in:
Georg Fritzsche 2018-01-15 13:22:56 +01:00
Родитель 115b9999dc
Коммит e415abb416
3 изменённых файлов: 24 добавлений и 0 удалений

Просмотреть файл

@ -1311,6 +1311,22 @@ timestamps:
record_in_processes: record_in_processes:
- main - main
browser.timings:
last_shutdown:
bug_numbers:
- 1429510
description: >
The time, in milliseconds, it took to complete the last shutdown.
On successful shutdown, Telemetry saves this to disk into Telemetry.ShutdownTime.txt.
On the next startup this is loaded and recorded.
expires: never
kind: uint
notification_emails:
- florian@mozilla.com
release_channel_collection: opt-in
record_in_processes:
- 'main'
# The following section contains the service worker scalars. # The following section contains the service worker scalars.
sw: sw:
synthesized_res_count: synthesized_res_count:

Просмотреть файл

@ -312,6 +312,10 @@ public:
mTelemetry->mLastShutdownTime = mTelemetry->mLastShutdownTime =
ReadLastShutdownDuration(mShutdownTimeFilename); ReadLastShutdownDuration(mShutdownTimeFilename);
mTelemetry->ReadLateWritesStacks(mProfileDir); mTelemetry->ReadLateWritesStacks(mProfileDir);
TelemetryScalar::Set(Telemetry::ScalarID::BROWSER_TIMINGS_LAST_SHUTDOWN,
mTelemetry->mLastShutdownTime);
nsCOMPtr<nsIRunnable> e = nsCOMPtr<nsIRunnable> e =
NewRunnableMethod("nsFetchTelemetryData::MainThread", NewRunnableMethod("nsFetchTelemetryData::MainThread",
this, this,

Просмотреть файл

@ -330,6 +330,10 @@ function checkPayload(payload, reason, successfulPings, savedPings) {
let activeTicks = payload.simpleMeasurements.activeTicks; let activeTicks = payload.simpleMeasurements.activeTicks;
Assert.ok(activeTicks >= 0); Assert.ok(activeTicks >= 0);
if ("browser.timings.last_shutdown" in payload.processes.parent.scalars) {
Assert.equal(payload.processes.parent.scalars["browser.timings.last_shutdown"], SHUTDOWN_TIME);
}
Assert.equal(payload.simpleMeasurements.failedProfileLockCount, Assert.equal(payload.simpleMeasurements.failedProfileLockCount,
FAILED_PROFILE_LOCK_ATTEMPTS); FAILED_PROFILE_LOCK_ATTEMPTS);
let profileDirectory = Services.dirsvc.get("ProfD", Ci.nsIFile); let profileDirectory = Services.dirsvc.get("ProfD", Ci.nsIFile);