mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 852452 - Measure how long SessionStore writing blocks the main thread;r=ttaubert
This commit is contained in:
parent
87feff8212
commit
413a6dee87
@ -202,13 +202,20 @@ let SessionFileInternal = {
|
||||
let self = this;
|
||||
return TaskUtils.spawn(function task() {
|
||||
TelemetryStopwatch.start("FX_SESSION_RESTORE_WRITE_FILE_MS", refObj);
|
||||
TelemetryStopwatch.start("FX_SESSION_RESTORE_WRITE_FILE_LONGEST_OP_MS", refObj);
|
||||
|
||||
let bytes = gEncoder.encode(aData);
|
||||
|
||||
try {
|
||||
yield OS.File.writeAtomic(self.path, bytes, {tmpPath: self.path + ".tmp"});
|
||||
let promise = OS.File.writeAtomic(self.path, bytes, {tmpPath: self.path + ".tmp"});
|
||||
// At this point, we measure how long we stop the main thread
|
||||
TelemetryStopwatch.finish("FX_SESSION_RESTORE_WRITE_FILE_LONGEST_OP_MS", refObj);
|
||||
|
||||
// Now wait for the result and measure how long we had to wait for the result
|
||||
yield promise;
|
||||
TelemetryStopwatch.finish("FX_SESSION_RESTORE_WRITE_FILE_MS", refObj);
|
||||
} catch (ex) {
|
||||
TelemetryStopwatch.cancel("FX_SESSION_RESTORE_WRITE_FILE_LONGEST_OP_MS", refObj);
|
||||
TelemetryStopwatch.cancel("FX_SESSION_RESTORE_WRITE_FILE_MS", refObj);
|
||||
Cu.reportError("Could not write session state file " + self.path
|
||||
+ ": " + aReason);
|
||||
|
@ -2461,6 +2461,13 @@
|
||||
"extended_statistics_ok": true,
|
||||
"description": "Session restore: Time to write the session data to the file on disk (ms)"
|
||||
},
|
||||
"FX_SESSION_RESTORE_WRITE_FILE_LONGEST_OP_MS": {
|
||||
"kind": "exponential",
|
||||
"high": "3000",
|
||||
"n_buckets": 10,
|
||||
"extended_statistics_ok": true,
|
||||
"description": "Session restore: Duration of the longest uninterruptible operation while writing session data (ms)"
|
||||
},
|
||||
"FX_SESSION_RESTORE_CORRUPT_FILE": {
|
||||
"kind": "boolean",
|
||||
"description": "Session restore: Whether the file read on startup contained parse-able JSON"
|
||||
|
Loading…
Reference in New Issue
Block a user